Employment Minister Michaelia Cash has two weeks to hand over documents linked to raids on the Australian Workers Union after she lost a legal bid in the Federal Court.

Justice Mordecai Bromberg on Wednesday found the AWU had a legitimate reason to see the documents from Senator Cash's office to determine if there was political motivation for the October 24 raids in Melbourne and Sydney.

He found the AWU "has a legitimate forensic purpose" in seeing the communications between Senator Cash and the Registered Organisations Commission.

But Senator Cash will not have to hand over all the documents the union sought, with Justice Bromberg limiting access to only relevant paperwork.