Under the laws, phone and internet firms will be required to keep all customers' "metadata" such as the time, origin and destination of emails and phone calls – though not the content – for at least two years.

Police and national security agencies say their investigation powers are being eroded as telcos increasingly wipe such data quickly as it is not needed for billing purposes. A mandatory retention period is essential to fighting terrorism and crimes such as online child pornography, agencies and the Abbott government say.

But the telco industry says it could push up internet costs for customers, and privacy advocates say it will create a huge reservoir of personal information that is open to misuse.

Under the changes recommended on Friday by the Parliamentary Joint Committee on Intelligence and Security, the types of data that must be retained and the agencies that can access it would be set in stone in the legislation itself and could not be changed on a whim by the government of the day.

But, in a significant exception, the Attorney-General could in an emergency add new interim classes of data and new authorised agencies, after which Parliament would have 40 sitting days to consider whether the additions should be scrapped or become permanently set in the law.