Is penetration testing legal in the UK?

No, not when it is properly authorised. Penetration testing is legal in the UK when someone entitled to give permission has done so, ideally in writing. Without that authority the same actions can be offences under the Computer Misuse Act 1990, even with good intentions.

Last updated · Precursor Security
Where this stands

Status checked : the Bill passed the House of Lords on 2 November 2026 and returns to the Commons to consider Lords amendments (no date set). On 4 November 2026 the Commons extended its carry-over, so it lapses if not passed by the end of 29 April 2027. It is not yet law. References are to HL Bill 62 (as amended on Report), so wording and numbering may still change in the final Act. This guide is general information, not legal advice.

Key points

  • Penetration testing is legal in the UK when someone entitled to authorise it has done so, ideally in writing.
  • Without authority, testing can be an offence under the Computer Misuse Act 1990, whatever your motive.
  • Your customer may not be able to authorise testing of cloud or hosting infrastructure it doesn’t own.
  • The Bill doesn’t require penetration testing by name, but testing helps show security measures work.
  • A defence for accredited researchers is promised through a National Security Bill but is not yet law.

Yes, when it's properly authorised. Without authority, the same actions can be crimes under the Computer Misuse Act 1990, even if you mean well. UK law has no general exception for good-faith security research, so the written authority you hold before a test is what makes it lawful.

Disclosure: this site is run by Precursor Security, which sells authorised penetration testing. This guide is general information, not legal advice.

Which offences matter for testers?

Four sections of the Computer Misuse Act do most of the work. All turn on whether what you did was unauthorised.

Offence What it covers Maximum on indictment
Section 1 Causing a computer to perform a function, intending to secure access you know is unauthorised 2 years
Section 2 Section 1 access with intent to commit or help a further serious offence 5 years
Section 3 Unauthorised acts intended to impair a computer, or reckless as to impairing it 10 years
Section 3A Making, supplying or obtaining articles for use in these offences 2 years

Three points matter most in practice:

  • Authority is the key test. Under section 17(5), access is unauthorised if you aren't entitled to control it and don't have consent from someone who is.
  • Motive isn't a defence. Section 1 asks about your intent to get access and your knowledge that it's unauthorised, not whether you were trying to help.
  • Recklessness counts under section 3. An authorised test that strays outside scope and takes down a service could raise questions, so agree limits in advance.

Who can authorise a test?

Only someone entitled to control access to the systems being tested. That is usually the system owner, acting through someone with authority to bind them.

This gets harder with third-party infrastructure. Your customer can authorise testing of its own applications and accounts, but it may not own the cloud platform, hosting, SaaS service or managed network underneath. Many providers publish testing policies that set what customers may test without asking. Read them, and get the provider's consent for anything outside them.

Common situations

Situation Position
You hired a tester and own the systems Legal if the test stays within your written authority
A customer asks you to test a system hosted by a cloud or hosting provider Check the provider's terms; your customer may not be able to authorise everything
You test a website you don't own, without permission, to report a bug Risky, and may be an offence
You try SQL injection on a live site out of curiosity Risky, and may be an offence
You scan the internet for exposed systems Depends on what you do; interacting beyond what is publicly offered raises the risk
You take part in a bug bounty Stay inside the published scope; the programme's permission only covers what it says
You keep security tools for authorised work Section 3A turns on use in offences, so keep records of legitimate purpose

Where a situation looks borderline, get legal advice before testing, not after.

What should the authorisation say?

A good authorisation answers nine questions before testing starts:

  1. Who is authorising: name, role and why they're entitled to authorise it
  2. What is in scope: IP ranges, domains, applications and accounts
  3. What is out of scope: especially third-party systems and fragile services
  4. Permitted techniques: for example, whether denial of service or social engineering is allowed
  5. Timing: start and end dates, plus any restricted hours
  6. Third-party consent: from cloud, hosting or other providers where needed
  7. Data handling: what happens to personal data testers see, under UK GDPR
  8. Emergency contacts: who to call if something breaks, and how to stop the test
  9. People covered: the firm and individual testers the authority applies to

Testers should carry a copy during the work and keep a record of what they did. If the scope changes mid-test, get the change in writing.

What about public sector and critical infrastructure?

Use an assured scheme where one applies. The NCSC's CHECK scheme lets NCSC-assured firms carry out authorised penetration tests of public sector and critical national infrastructure systems. It is aimed at central government departments, public sector bodies and CNI organisations. Other organisations can follow the NCSC's guidance on commissioning a penetration test, and many use CREST-accredited providers.

Does the Cyber Security and Resilience Bill require penetration testing?

Not by name. Under the NIS Regulations as the Cyber Security and Resilience Bill (CSRB) would amend them, regulated organisations would have to take appropriate and proportionate security measures. For managed service providers that duty would be new regulation 14B, inserted by clause 10, and would have regard to "the state of the art". The Bill doesn't say "you must run a penetration test".

Testing is still one of the clearest ways to show your measures work. The Cyber Assessment Framework, which regulators use to assess organisations, expects organisations to identify and manage vulnerabilities in the systems that support their service. See CAF principle B4: system security and the MSP compliance checklist.

Regulators may also expect evidence after an incident. A recent independent test helps you show you took appropriate measures.

Could the law change?

Probably, but not through this Bill. The Bill as amended on Report (HL Bill 62) contains no change to the Computer Misuse Act.

Here's how the issue has moved:

Date What happened
December 2025 Security minister Dan Jarvis said the Government was looking at a statutory defence for researchers who identify and report vulnerabilities, subject to safeguards
13 May 2026 The King's Speech committed to updating the Computer Misuse Act through a National Security Bill. Briefing notes said it would "unlock the power of cyber security professionals"
September 2026 A Lords amendment seeking a review of a statutory defence was withdrawn at Committee Stage
26 October 2026 At Report Stage, Lord Clement-Jones spoke to Amendment 158, which sought a 12-month review. The Government said the Home Office "proposes to introduce a defence to Section 1 for accredited cyber security researchers", and the amendment did not become part of the Bill

Critics, including the CyberUp Campaign, argue a defence limited to accredited researchers would be too narrow. Until a change is enacted, assume the current law applies in full. See the Computer Misuse Act explained.

Common mistakes

  1. Relying on a verbal "go ahead". If anything goes wrong, you need it in writing.
  2. Testing a cloud tenant without checking the provider's policy. Your customer's consent may not be enough.
  3. Letting scope drift. Retesting a fix on a new host is a new scope.
  4. Treating a bug bounty as blanket permission. It only covers its published scope.

Sources

Frequently asked questions

Yes, when it is unauthorised. Section 1 of the Computer Misuse Act 1990 makes knowingly unauthorised access to computer material a crime, with up to two years in prison on indictment. Impairing a computer under section 3 carries up to ten years. Authorised testing is lawful.

It can be. If you intend to access data or programs and know you are not authorised, it may be an offence under section 1, whatever your motive. The Act currently has no general defence for good-faith security research, so get permission first.

Someone entitled to control access to the systems being tested, usually the system owner. Take care with third-party systems: your customer may not be able to authorise testing of infrastructure owned by a cloud, hosting or SaaS provider, whose own testing policy may apply.

Not by name. Under the Bill, regulated organisations would have to take appropriate and proportionate security measures having regard to the state of the art, and regulators use the Cyber Assessment Framework to assess them. Independent testing is a common way to show those measures work.

No. Amendments seeking a review of a statutory defence were raised at Committee and Report but are not in the Bill. The Government says the Home Office proposes a defence for accredited researchers through a separate national security Bill announced in May 2026.

Get ready

Know where you stand before the duties land.

Take the free readiness assessment to see how your organisation measures up against the Cyber Security and Resilience Bill, or talk to our team about a plan.