
The rules of engagement for a penetration test are the signed terms that say what testers may touch, what they must not, when, who can stop them and what happens to the data. Most engagements that go wrong legally or operationally fail on four or five clauses. This guide works through each one and ends with a 15-clause template.
The short answer
- A penetration test rules of engagement is the signed, expiring annex that defines scope, exclusions, techniques, windows, abort authority and data handling.
- It must be signed by someone who can bind the legal entity, and the consent it gives does not cover cloud, CDN or SaaS vendors.
- The clauses that most often fail are the out-of-bounds list, named abort authority, production data minimization and AI-agent action caps.
- Every scope change needs a written, versioned amendment. A verbal expansion on a call is how authorized tests become unauthorized.
Key takeaways
- A penetration test's rules of engagement is a separate, versioned, expiring annex, not part of the statement of work.
- The authorization letter must name the legal entity, assets, source IPs, dates with time zone and testers, and be signed by someone who can bind the organization.
- Your own AWS, Azure and Google Cloud workloads generally need no prior approval, but DoS and provider infrastructure do, and CDN, WAF and SaaS vendors need their own permission.
- Abort authority belongs to a named person with a mobile number and an alternate, reachable through a channel outside the systems under test.
- AI-agent tests need hard action limits: sandbox only, no real transactions or outbound messages, extraction caps and an explicit rule on registering MCP servers.
What is a penetration test's rules of engagement?
A penetration test’s rules of engagement (RoE) is the signed annex that defines what may be tested, what must not be touched, when testing may occur, who can stop it, how findings are reported and how data is handled. It sits beside the statement of work, carries its own version number and expires on a fixed date.
Without one, your tester’s traffic is legally and operationally indistinguishable from an intrusion. A weak one can be lawful on paper and still let a test lock out every user in a region, hit a CDN vendor’s edge, or let an AI agent under test refund real orders.
The RoE is one of four documents in a typical engagement:
| Document | What it does | Who signs | If it is missing |
|---|---|---|---|
| Master Services Agreement | Liability, indemnity, confidentiality, payment terms | Legal or procurement on both sides | No liability cap, no indemnity when something breaks |
| Statement of work | Deliverables, effort, timeline, price | Business owners | Disputes over what was bought and delivered |
| Rules of engagement | Scope, exclusions, techniques, windows, stop conditions, data handling | Security lead plus an officer with binding authority | Testers make up the boundaries as they go |
| Authorization letter | Legal consent for named testers, assets and dates | Officer who can bind the legal entity | The test may be unauthorized access |
Keep the RoE out of the SoW body. When scope shifts mid-engagement, you amend one annex instead of reopening commercial terms.
Who signs the authorization letter, and how long does it stay valid?
Someone with authority to bind the legal entity that owns the assets: usually the CISO, CTO, COO or General Counsel. An email from a security engineer is not authorization, however senior the engineer. The letter, sometimes called the “get-out-of-jail letter”, should name:
- The legal entity, not a brand or product name.
- The specific assets, by reference to the RoE scope annex.
- The source IP ranges the testers will originate from.
- Start and end dates and times, with time zone.
- The named testers or the firm.
- A consent statement: the organization will not pursue civil or criminal action for in-scope activity, and will notify its ISP, cloud provider or law enforcement if they are contacted about it.
Consent is the operative defense in every major jurisdiction:
- US: authorization is the core defense under the Computer Fraud and Abuse Act, 18 U.S.C. § 1030. Van Buren v. United States (2021) narrowed the “exceeds authorized access” theory, but it is not a safe harbor. Verbal scope changes made on a call still create legal exposure.
- UK: Computer Misuse Act 1990 sections 1-3 criminalize unauthorized access and impairment, and section 3ZA covers unauthorized acts causing serious damage. Consent from the system owner is the defense.
- EU: Directive 2013/40/EU, implemented nationally, leads to the same answer: written consent from an authorized signatory, scoped tightly.
Watch group structures. A parent-company CISO cannot automatically authorize testing of a recently acquired subsidiary that is still a separate legal entity on separate contracts.
Expiry, amendment and revocation
Authorization should cover the testing window plus a short buffer, and no more. Every RoE needs a version number, an effective date and an explicit expiry date. Undated or open-ended authorizations are a recurring audit finding and become real legal exposure when engagement dates slip.
Every scope change is a written, versioned amendment signed by the same authority as the original. Revocation should also be written, and it takes effect when the tester acknowledges it.
How do you write scope so testers do not pivot into a third party?
Define scope as assets, not intent, and write the out-of-bounds list with more care than the in-scope list. “The customer portal” is intent. Assets are CIDR ranges, hostnames, API base URLs and versions, mobile bundle IDs, cloud account, subscription and project IDs with regions, tenant IDs, repositories and the exact test identities provisioned.
Bound every wildcard. *.example.com should mean enumerated subdomains confirmed by the customer on a dated list. Exclude any subdomain CNAMEd to a SaaS or hosting provider: the hostname is yours, the server is not.
Typical out-of-bounds entries: sister and parent entities, acquisitions not yet integrated, third-party SaaS, CDN, WAF and DNS registrar infrastructure, payment processors, identity providers, OT and building systems, and executives’ personal devices and homes.
Then add a stumble protocol. A tester who reaches a system not clearly in scope stops, does not pivot or escalate privileges, keeps minimal evidence and notifies the primary contact within an agreed window (one hour is a sensible default). Silent exploration is the most common way an authorized test becomes unauthorized access.
Cloud provider permission
For standard testing of your own workloads on AWS, Azure and Google Cloud, prior approval is generally not required. Denial-of-service simulation and anything aimed at the provider’s own infrastructure are different. Under the shared responsibility model you test your configuration and workloads, not the AWS control plane, the Azure fabric or the Google front end.
| Provider | Own workloads | Needs approval or prohibited |
|---|---|---|
| AWS | Permitted without approval for a published list of services (EC2, RDS, Lambda, API Gateway, CloudFront and others) | Simulated DoS, DDoS and flooding need prior approval; Route 53 hosted-zone walking is prohibited under the policy as published when we wrote this |
| Microsoft Azure | Permitted under Microsoft’s published penetration testing rules | No testing of Microsoft infrastructure, no DoS, no social engineering of Microsoft staff; the Microsoft 365 and Dynamics 365 process has changed more than once |
| Google Cloud | Permitted without approval within the Acceptable Use Policy | No Google-owned infrastructure, no other tenants |
| Oracle, IBM, Alibaba Cloud | Each publishes its own policy | Notification requirements differ by provider |
These policies change. Re-read the live provider page before signing, and record the policy name and retrieval date per cloud in the RoE. “The cloud is in scope” is not a clause.
CDN and SaaS vendors
Your consent does not extend to vendors. Cloudflare, Akamai, Fastly and AWS Shield-fronted CloudFront distributions generally do not permit testing of their edge networks, and bypassing a managed WAF can mean attacking the vendor’s system. Test the origin directly from allowlisted source IPs, or get written vendor permission. For SaaS, review your own Salesforce org or Workday tenant configuration; anything deeper goes through the vendor’s security-testing request process, with the approval attached to the RoE.
Which techniques are allowed, and who can stop the test?
Use an allowlist of permitted techniques backed by an explicit denylist of high-blast-radius actions. An allowlist is auditable; a denylist alone leaves everything unnamed open to interpretation.
- Allowed: reconnaissance, authentication testing, injection, access control bypass, privilege escalation, limited password spraying, and social engineering only under its own clause.
- Prohibited: DoS and resource exhaustion, deleting or altering production records, ransomware simulation without a separate written addendum, physical entry, hardware implants.
Password attacks need numbers: the lockout threshold, maximum attempts per account per window, and prior coordination with the identity team. Name blackout periods (quarter-end close, Black Friday, major releases, regulatory filing dates) and who may approve an out-of-window exception in writing.
Deconfliction with the SOC
Make tester traffic distinguishable: allowlisted source IPs, a custom HTTP header or User-Agent, a documented test identifier and a briefed SOC. For purple-team tests, share a daily activity log with the defenders. Keep the stop channel out of band. If corporate email is in scope, it cannot carry the stop signal; use a phone bridge, named contacts’ mobile numbers and an agreed messaging channel.
A blind test raises the operational requirements. In red team operations the SOC is meant to detect you and may escalate. The RoE needs a verification phrase, a 24/7 number for a small control group that knows the test is running, and a rule that any escalation outside the test (the SOC calling its IR retainer or the police, for example) is verified with that group first.
Abort authority and stop conditions
Abort authority belongs to a named individual with a mobile number, plus a named alternate. “The CISO” is unreachable on a Saturday flight, and “the SOC” is a mailbox. A sensible default: the tester stops active exploitation immediately and acknowledges within 15 minutes. That is common practice, not a standard, so agree a figure and write it down.
List the stop conditions: unplanned production outage or degradation, data corruption, evidence of a real adversary, a critical vulnerability under active exploitation, illegal content or insider fraud, a physical safety risk, and contact from law enforcement. On a live adversary, the tester stops offensive work, preserves evidence and notifies the primary contact within one hour. Testing alongside an intruder contaminates the forensic record.
Define “critical finding” too: unauthenticated RCE, authentication bypass, domain admin, confirmed exposure of regulated data. A workable default is verbal notification within one hour and written notice within 24 hours, to named recipients.
How should the RoE handle production data, PII, PHI and cardholder data?
Default to staging, and where production is unavoidable, capture only what proves the finding. Staging is not automatically safe: it often holds production copies, live third-party API keys and real customer records, so the same rules apply there.
- Minimization: one record identifier or a redacted screenshot as proof. No bulk export. Never retain a full PAN.
- No reuse: no real data in model training, prompt examples or tool demos.
- Storage: encrypted at rest (AES-256 or equivalent), with PII redacted before it reaches the report.
- Retention: a fixed window, commonly 30-90 days after report delivery, then a certificate of destruction. Thirty days limits exposure but can expire before the retest; ninety days covers it. Your counsel should choose the window.
Agree breach ownership in advance. Under GDPR Article 33 the controller generally has 72 hours from awareness to notify, so the RoE should require the tester to report a suspected breach within 24 hours and say who drafts the notification. For US public companies, a cybersecurity incident the company determines to be material triggers SEC Form 8-K Item 1.05 disclosure within four business days of that determination. Require immediate escalation so the customer can make the call.
DPA and BAA with the testing firm
Usually both are required. A tester processing personal data on your behalf is a processor, so GDPR Article 28 requires a data processing agreement and Article 32 requires appropriate technical and organizational measures. Under HIPAA, a tester who may access ePHI is a business associate, and the BAA must be signed before any access. List both in the RoE annexes so nobody starts without them.
How should an AI agent penetration test's rules of engagement limit actions?
Give AI systems their own section and cap what the agent may actually do. Action authority is the biggest gap we see: an agent tricked into sending an email or issuing a refund performs that action for real, against real people.
Scope by component: model endpoints (self-hosted, Azure OpenAI, Amazon Bedrock, OpenAI API, Anthropic API), orchestration (LangChain, LlamaIndex or custom), named MCP servers and tools, vector stores (pgvector, Pinecone, Weaviate) and environments. Then set the limits:
- A sandbox or dedicated test tenant only: zero real financial transactions, no outbound messages to real customers, no public posts.
- Whether guardrails are on (testing as deployed) or off (testing underlying model behavior), who may disable them and where. The two produce different findings.
- Extraction caps for prompt injection and jailbreaks: a fixed token limit on system prompt or training data exfiltrated as proof, and no reconstruction of memorized personal data at scale.
- Whether the tester may register their own MCP server in the agent’s tool list. That is high impact and needs explicit approval or an explicit prohibition. Our MCP server and tool-chain security testing covers tool poisoning, confused deputy and token passthrough under these limits.
Model provider terms apply on their own. Adversarial testing of your deployment is normally fine; testing the provider’s hosted infrastructure is not, whatever the customer consents to.
Map coverage to the OWASP Top 10 for LLM Applications 2025 (LLM01 Prompt Injection, LLM06 Excessive Agency, LLM07 System Prompt Leakage) and to MITRE ATLAS. For scoping detail, see our AI agent penetration test scope checklist.
Pentest rules of engagement template: the 15 clauses
Adapt this list to your environment. Each clause maps to a section above; the last few cover the gaps behind most post-engagement incidents.
- Parties and authority: the legal entity, the signatory’s title, and the consent and non-prosecution statement.
- Scope: CIDRs, hostnames, a bounded wildcard list, API versions, cloud account IDs and regions, tenants, repositories, test identities.
- Out of bounds and stumble protocol: excluded entities and vendors, plus stop-and-notify within an agreed window.
- Third-party and cloud permission: provider policy name and retrieval date per cloud, attached vendor approvals.
- Techniques: allowlist, denylist, password-attack limits.
- Windows: per environment and region, blackout dates, written exception process.
- Deconfliction: source IPs, headers, test identifier, SOC briefing or blind-test control group.
- Communication: out-of-band channels, named contacts and alternates.
- Stop conditions and abort authority: named holder, acknowledgment time, live-adversary clause.
- Critical findings: definition, verbal and written notification windows, recipients.
- Data handling: minimization, encryption, retention, destruction certificate, breach reporting, DPA and BAA.
- AI systems: component scope, action limits, guardrail state, extraction caps, MCP registration rule.
- Social engineering and credentials: target populations, volume limits, HR and legal sign-off, banned pretexts (law enforcement impersonation, medical or family emergencies, contact at home), named tester accounts with MFA, all disabled at close.
- Cleanup, retest and people: removal of webshells, implants, tools, accounts, scheduled tasks and test data with a written attestation; retest window, severities and pass criteria; named testers, NDAs, notice before substitution, certificate of insurance.
- Version and expiry: version number, effective and expiry dates, written amendment and revocation rules.
Two local checks before you sign. In Germany, works council co-determination under BetrVG §87(1) No. 6 can apply to phishing that monitors employee behavior, and other EU jurisdictions have similar rules, so ask local counsel. And auditors will read this document: PCI DSS v4.0.1 Requirement 11.4, NYDFS 23 NYCRR 500.5 and NIS2 all expect documented testing, and DORA Articles 26-27 require threat-led penetration testing for designated financial entities, with TIBER-EU as the reference framework.



FAQ
Do I need AWS, Azure or Google Cloud permission to pentest my own workloads?
Generally no, for standard testing of your own workloads. AWS requires prior approval for simulated DoS and flooding, and none of the three allows testing the provider's own infrastructure or other tenants. Policies change, so record the policy name and retrieval date in the RoE.
Who should sign a penetration test authorization letter?
An officer who can bind the legal entity that owns the assets, typically the CISO, CTO, COO or General Counsel. An email from a security engineer is not authorization, and a parent-company signatory may not cover a subsidiary that is still a separate legal entity.
Can a tester attack the CDN or WAF in front of my application?
Not on your consent alone. Cloudflare, Akamai, Fastly and Shield-fronted CloudFront generally prohibit testing their edge networks. Test the origin directly from allowlisted source IPs, or obtain written permission from the vendor and attach it to the RoE.
Does GDPR require a DPA with a penetration testing vendor?
Usually yes. A tester who processes personal data on your behalf acts as a processor, so GDPR Article 28 requires a data processing agreement. Under HIPAA, a tester with possible ePHI access needs a signed BAA before testing starts.
How long should a penetration test authorization remain valid?
For the testing window plus a short buffer. Give the RoE a version number, effective date and explicit expiry date. Every scope change should be a written, signed amendment, and revocation takes effect when the tester acknowledges it.
agent::offense writes and runs engagements under RoEs like this one, including AI agent penetration testing with action caps agreed before any agent is touched. Send us your draft RoE and we will mark up the clauses that would not survive an incident.