An AFP officer looked up details of a pimp on the police database for an ex-girlfriend, an alleged sex worker who said she wanted to work for someone else.
When police later searched the officer's Queanbeyan property, they found MDMA and methamphetamine, which he said he had bought over the internet.
The officer had also taken AFP property home from Parliament House, including a Glock pistol, because he "thought they'd be handy for something, you know".
John Lewis Wallis, 44, was a protective services officer with the AFP in September last year when police got wind that someone on the outside was receiving information from an AFP member, court documents show.
Protective services officers are armed and uniformed, and charged with guarding Commonwealth properties, such as Parliament House, among other duties.
Wallis was charged last year with multiple Commonwealth criminal offences, including using information gained through his role as a public official with the intention of dishonestly obtaining a benefit, and traffic and possession of drugs.
At a District Court sitting in Queanbeyan on Friday, he was sentenced to 12 months in prison and eight months on a recognisance (good behaviour) order, due to expire in January 2018.
Court documents show the offending began when Wallis was contacted last year by an ex-girlfriend, an alleged sex worker at the time, with whom he still spoke.
She told him she was unsatisfied with her current arrangement, and she wanted to work for another alleged pimp, giving Wallis a name.
Later at work in Canberra, Wallis accessed the database. He took photos of the screen – including details of the alleged pimp's criminal histories, involvements and locations – and sent them to the man using the mobile number on the database.
He looked up the man and other names multiple times that September
When police found out someone within the organisation was sending information to someone on the outside, the matter was referred to the Australian Commission for Law Enforcement Integrity.
Later that month, police stopped Wallis on the Kings Highway. He spoke with officers and told them he had accessed the alleged pimp's information because he thought he might help with an issue he was having, in which Wallis felt threatened by someone he thought had a gun.
He told officers he had looked up people on the AFP system before to show his girlfriend that her friends were not good people, but that he knew it was wrong and in contravention of his training.
Police searched his Queanbeyan home, where they found 2.5 grams of methamphetamine and three MDMA tablets in a cigarette packet in a safe.
The court heard he had used a fake name to have them sent to an abandoned warehouse. Wallis told police he had bought the drugs online, using bitcoin, and had sold some to friends.
Officers also found guns, including an AFP training Glock, batons and handcuffs, which Wallis said he had taken from Parliament House.
Police later searched the alleged pimp's property and questioned him about the photographs of information. Asked if Wallis had asked him for anything, the man said: "He did state that I could be useful to him, and that I said 'what the f--- do you want from me', and he goes, 'I haven't quite figured that out yet'."
In sentencing, Justice Phillip Mahony said that although Wallis had been of prior good character, he had gained a position of authority and trust, and it was "this position that was exploited in the commission of this offence".