A Canberra woman says security guards forced her two-year-old son to check in a toy lightsaber during a visit to Parliament House because they considered it a "weapon".

The family, who did not want their name to be published, was visiting Parliament House on Friday when they were told the battery-powered plastic lightsaber was not allowed through security.

"They told me it was a weapon so he couldn't have it," the boy's mother said.

"And it's the green lightsaber, which is apparently the good guys."

The lightsaber was checked in during the family's visit and returned when they left the building.

She said her son, whose favourite Star Wars character was Darth Vader, was a "huge fan" of the iconic movie from 1977, which has since been turned into a multi-billion-dollar franchise.

The green lightsaber was used by Star Wars character Yoda, and protagonist Luke Skywalker in Return of the Jedi.

"It will be something to print in his baby book," his mother said.

The Department of Parliamentary Services (DPS) said Parliament House contained many artworks of "significant value".

"Given the length of the item and that it has the potential to cause damage to property, a decision was made by a security officer on duty to request the item be cloaked with a return on departure," a DPS spokesperson said in a statement.

"This rule is applicable to all visitors … whether the force is with them or not!"