Public service commissioner John Lloyd will resign as his agency denies the timing is influenced by a possible investigation into an alleged breach of a code of conduct.

His decision came after mounting pressure over his connection to right-wing think tank the Institute of Public Affairs, and revelations two weeks ago he faced a possible investigation into allegations received by the Prime Minister's department.

Mr Lloyd, who has been a controversial figure since the Abbott government appointed him to lead the Australian Public Service Commission in 2014, told the governor-general Sir Peter Cosgrove he will resign on August 8.

His links to the think tank came under growing scrutiny after it was revealed at a Senate estimates hearing in October he sent an email to a member of the IPA with an attachment showing what he described as "generous" provisions in public service enterprise agreements.