Rebekah Brooks was asked on Friday to explain the legality of a series of contacts between her journalists at the Sun and sources connected to the police, military and MI5.

The jury in the phone-hacking trial were shown an email from April 2006, in which a reporter asked her to authorise a payment to a source who had provided a story involving the royal mayor of Tetbury who was leaving his wife.

The reporter wrote: "I would like to keep it anonymous because the contact is a serving police officer. He has supplied us with numerous other tips in the past." The reporter asked that the payment be made in cash through a branch of the Thomas Cook travel agency.

Questioned by her barrister, Jonathan Laidlaw QC, Brooks said: "Obviously, a police officer selling information directly associated with their duty, I was absolutely aware of the illegality."

She said such a payment could be justified in the public interest only with a high threshold, such as the exposure of high-level police corruption.

She continued: "But, of course, police officers are just as likely to come across a story that comes about in their daily lives. If a copper is living next door to the royal mayor of Tetbury wife-swapping situation, it's not in the course of his duty. People may have an issue with it, but it's not – as far as I'm concerned – against the law for me to authorise it."

She was shown another email, dated February 2006, in which the Sun's crime editor, Mike Sullivan, said a police source had suggested the then home secretary, Charles Clarke, had given the News of the World a story about a police cover-up and then asked her to authorise a payment of £500 for a source who had helped on stories about Kate Moss's drug dealer and about a woman who had hired a hitman who turned out to be a police officer. Sullivan added: "With respect, I'm not sure it's wise putting this kind of thing down on emails where there is a permanent record."

Brooks told the court that Sullivan had been crime editor for a long time and received "a lot of information from serving police officers but also not necessarily – I would say rarely – for money".

She said that the Sun had a pretty good relationship with Scotland Yard, which included sponsoring its football team. Turning to the email, she said: "Nothing would suggest to me that this was payment going to a serving officer. I would probably have read it and thought it was one of Mike's contacts – crime journalists, ex-crime journalists, all with contacts at the Yard."

Asked to explain Sullivan's final line about it being unwise to record "this kind of thing" in an email, she told the jury that that could refer to writing about sources. "If you want to see something sinister, you could read it that he didn't want this payment to be discussed on email. But it could be that you shouldn't be naming a source for the police cover-up in email."

She added: "It sounds a little bit chippy, the end. It could be that he just didn't like to be questioned about a payment for one of his sources."

Another email, dated April 2008, asked her to authorise a payment of £1,000 for a picture of an army officer who had been involved in a road accident which had killed a police officer: "We need to pay in cash as the guy who got us the picture works at Sandhurst and went into Sandhurst and took the picture off the wall so he doesn't want it to be traced back to him." Brooks said she did not remember the email but said that it did not necessarily refer to a public official.

On another occasion, in July 2005, an executive emailed her that "a tipster who says he's a policeman" had told the news desk that the singer George Michael had been arrested on suspicion of driving under the influence of drugs and had then been released without charge. Brooks said this had nothing to do with money. "It isn't unusual, in my experience, for a police officer to ring up the paper. He is clearly not doing so for money."

Questioned about an email from a senior journalist in which he referred to "my man in Five", Brooks said she understood that that referred to a source in MI5. She told the court that at some point, MI5 and MI6 had decided to be "a little bit more open" with the media and that she had attended briefings with both services.

She went on to describe an incident in March 1998 when, as deputy editor of the Sun, she had been called in to Downing Street to meet representatives of MI5, MI6 and GCHQ after a source had told them that all ports had been alerted to watch for anthrax being smuggled into the country on the orders of Saddam Hussein. She said they had asked her not to publish the story but she had argued that the public had a right to know about the threat. On the basis that this was justified by high public interest, she had authorised a payment to the source, a chief petty officer who subsequently had been arrested and prosecuted for breaking the Official Secrets Act.

She said she had been offered the chance to pay a source for details of the "MPs' expenses fraud" in the spring of 2009 but had found it a very difficult decision. "In terms of error of judgment, I think this is probably quite high on my list. I thought about it too long. I drove my news team crazy with my indecision." In the end, the information had been bought by the Daily Telegraph who had done a brilliant job with it. "It was quite embarrassing that we didn't get it," she said.

Brooks denies conspiring to commit misconduct in public office.

The trial continues.