The Federal Government has announced a crackdown on the disclosure of classified information by former Defence personnel.

Those who divulge the nation's most classified secrets could face long prison sentences under new legislation introduced by Defense Minister Richard Marles.

The proposed law mandates that ex-military personnel and Defense staff obtain approval before working for foreign military or government entities. 

Failure to secure approval could result in a 20-year prison term, while those granted permission who then violate their obligations may face up to five years behind bars.

Individuals providing military training or information on weaponry will also be subject to a maximum sentence of 20 years in prison.

The Government claims that these laws will enhance national security by identifying individuals who may, intentionally or unwittingly, collaborate with foreign entities or governments.

Exemptions are expected for the “Five Eyes” nations, comprising the US, UK, New Zealand, and Canada.

Marles says the legislation demonstrates Australia's commitment to safeguarding classified information under the AUKUS agreement, which involves the acquisition of nuclear-powered submarines.

The legislation is modelled after comparable US measures and aims to facilitate technology transfers between AUKUS partners without impeding Australians from working abroad or with all foreign governments or militaries.

Factors considered when evaluating applications will include the individual's level of access to sensitive defence information, duration of service in defence, the nature of the desired work, and the foreign country involved.

The new rules will not apply to activities related to providing aid, humanitarian assistance, working in an official capacity for the United Nations, or Red Cross missions.

The Safeguarding Australia's Military Secrets Bill emerged from an investigation into allegations of China targeting Western military pilots. 

The findings of the inquiry have not been disclosed, but it recommended strengthening national security laws.

The bill will be referred to the parliamentary intelligence and security committee for private and public hearings.