From the 2011 Report of the Intelligence Services Commissioner:
The purpose of section 7 [of the Intelligence Services Act] is to ensure that certain SIS or GCHQ activity overseas, which might otherwise expose its officers or agents to liability for prosecution in the UK, is, where authorised by the Secretary of State, exempted from such liability. I would however emphasise that the Secretary of State, before granting each authorisation, must be satisfied of the necessity and reasonableness of the act authorised.
This is the Section that MPs used to call “the James Bond section” when it was going through Parliament in 1994.