LONDON — British spies have the authority to intercept privileged communications between lawyers and their clients — and may have illegally exploited that access in some sensitive security cases — according to confidential documents that were released Thursday.

Britain’s domestic intelligence service MI5, its international intelligence agency MI6 and the electronic monitoring agency GCHQ were forced to hand over secret internal guidelines for monitoring lawyers in response to a legal challenge.

In the case of GCHQ, the guidelines state that “you may, in principle, target the communications of lawyers,” but instructs agents to “give careful consideration to necessity and proportionality.”

An MI5 document says that legally privileged material can be used “just like any other item of intelligence,” though it stresses the “particular sensitivity” attached to such material and the need to “test thoroughly” the justification for its use.