By Megan Cassella

WASHINGTON (Reuters) - The National Treasury Employees Union (NTEU) said on Wednesday it has sued a federal government hiring agency over recent cyberattacks, alleging it violated constitutional privacy rights of NTEU members by failing to keep their personnel records safe.

The lawsuit, filed in the U.S. District Court for the Northern District of California, asked the court to declare the Office of Personnel Management's (OPM) failure to improve cybersecurity to be unconstitutional.

OPM has been tight-lipped about the extent of the security hack announced last month, which other federal agencies have said could have compromised personal information of as many as 18 million Americans.

The lawsuit also asked the court to order OPM to pay for lifetime credit-monitoring services and identity theft protection for NTEU members, to take steps to heighten its information technology security to prevent future acts, and to no longer collect personal information from NTEU members electronically until those steps are taken.

"We believe that a lawsuit is the best way to force OPM to take immediate steps to safeguard personnel data, prevent such attacks in the future and help our members protect themselves against the fallout," NTEU National President Colleen Kelley said in a statement.

NTEU, the nation’s largest independent federal union, represents 150,000 employees in 31 agencies and departments.

(Reporting by Megan Cassella; Editing by Kevin Drawbaugh and Andrew Hay)