WASHINGTON (AP) — The FBI has imposed new restrictions on its agents' ability to masquerade as reporters following an uproar over the impersonation of an Associated Press journalist, but the agency has stopped short of ruling out the practice as news organizations had wanted.

An inspector general report (pdf) released Thursday said the FBI recently instituted new policies requiring top-level approval before agents can pose as journalists, calling the changes an "important improvement" over past practices. But it also said the impersonation was permissible under policies in place at the time and suggested that there may still be undercover operations in which the tactic could be appropriate to use.

The AP and the Reporters Committee for Freedom of the Press sued the FBI last year after it emerged that the bureau had impersonated an AP journalist to send a bogus news article that was booby-trapped with surveillance software. The ruse, in 2007, resulted in the trial and conviction of a teenage bomb hoaxer in Washington State.

A 2014 news article in the Seattle Times, based on records obtained by the Electronic Frontier Foundation, exposed details about the undercover operation. The impersonation stirred immediate outrage among the news media and First Amendment advocates, and the Justice Department's inspector general opened an investigation into the practice.

In a letter to then-Attorney General Eric Holder, the AP called it "improper and inconsistent with a free press for government personnel to masquerade as The Associated Press or any other news organization." The AP argued such impersonations by law enforcement would intimidate sources who might otherwise speak freely to journalists and erode the AP's ability to gather news.

Paul Colford, AP vice president and director of media relations, said in a statement Thursday that the news cooperative was "deeply disappointed with the inspector general's findings, which effectively condone the FBI's impersonation of an AP journalist in 2007. Such action compromises the ability of a free press to gather the news safely and effectively and raises serious constitutional concerns."

"Once again, AP calls on the government to refrain from any activities involving the impersonation of the news media, and we demand to be heard in the development of any policies addressing such conduct," he added.

FBI Director James Comey defended the tactic in a 2014 New York Times opinion piece as "proper and appropriate," and said that while it would still be permissible today, it would likely need additional levels of approval.

The inspector general looked into whether the tactic was appropriate under policies in place at the time and whether it would require higher levels of approval if conducted today.

As the inspector general was finalizing its report this tear on the undercover operation, the FBI tightened its policies to permit agents to pose as journalists only after approval by headquarters leadership, according to Thursday's report. Those restrictions, the inspector general said, represent "an important and appropriate addition" to other Justice Department policies meant to protect journalists' First Amendment rights.

Under an interim policy that took effect in June, agents may impersonate journalists only if it is done as part of an undercover operation and only after authorization from a special committee at headquarters and the FBI's deputy director, after consultation from the deputy attorney general. The inspector general recommended that the FBI update its general undercover policy guide to incorporate that new directive.

But the inspector general, an independent watchdog office within the Justice Department, also concluded that the 2007 operation did not violate FBI undercover policies at the time.

Those policies, which the IG called "less than clear," did not require agents to seek special approval before impersonating a journalist and did not prohibit them from doing so unless there was a "significant risk" that a third party would develop a confidential relationship with the undercover FBI employee.

The FBI had not expected to have a drawn-out or confidential relationship with the teenage suspect, but once that happened, agents should have considered whether higher-level approval was needed, the report said.

It said the suspect at one point wrote the undercover agent to "leave me alone." The agent responded that he wasn't actually trying to learn the teenager's identity and that "I would rather not know who you are as writers are not allowed to reveal their sources."

That assurance was an "implied promise of confidentiality" and created a risk that the teenager believed that he was entering a confidential relationship with the agent, according to the IG report. It said investigators did not adequately consider whether that communication should have required additional approval.

The communication continued, and the teenager opened a follow-up email from the agent that contained the hidden software. The computer program helped agents identify his actual location.

"We highlight this — that is, how the plan actually unfolded — not because it proves the agents' advance assessment of the plan was wrong, but to demonstrate the plan's inherent unpredictability and of the potential need to reassess the necessary approval requirements," the report states.