COMP-220 · Lesson 3 of 12 · 20 min
Contracts and legal agreements
▶ Video coming soon A video version of this lesson is on the way.
Ruth Mbatha sent her first set of comments on Ironwhistle's draft contracts on September 2, 2026. There were forty-one of them. Tobias, who had been asked to keep the comment log, assumed this meant the engagement was in trouble. Marguerite laughed. "Forty-one comments means she read it," she said. "The clients who sign without reading are the ones who end up surprised."
Penetration testing is, legally, an unusual service: the client pays the tester to do things that would be crimes without permission. The contracts around an engagement therefore do more than set a price. They define the permission, allocate the risk of something going wrong, protect confidential information, and record that everyone understood what was agreed. PT0-003 objective 1.1 names four agreement types (NDA, MSA, SOW and terms of service) and three legal and ethical considerations (authorization letters, mandatory reporting requirements and risk to the penetration tester). This lesson covers all of them.
The agreement types
Non-disclosure agreement (NDA). An NDA obliges one or both parties to keep certain information confidential. It is usually the first document signed, because scoping conversations reveal sensitive details: network diagrams, known weaknesses, upcoming projects. Ironwhistle and Prairiefold signed a mutual NDA on August 20, 2026, a week before the scoping call. A good NDA defines what counts as confidential, how long the obligation lasts, how information must be returned or destroyed at the end, and what happens if a court or regulator compels disclosure. Testers should note that an NDA usually binds the firm and, through employment agreements, its individual staff.
Master services agreement (MSA). An MSA sets the long-term terms of the relationship so they need not be renegotiated for every project: payment terms, limitation of liability, indemnification, insurance, ownership of work product, confidentiality, dispute resolution and how the agreement ends. Individual projects then sit under the MSA as statements of work. Prairiefold was a new client, so the MSA was negotiated alongside the first SOW. Most of Ruth's forty-one comments concerned the MSA.
Statement of work (SOW). The SOW describes one specific project: objectives, scope (often by reference to an annex), approach, deliverables, milestones, dates, assumptions, roles and price. Where the SOW and MSA conflict, the MSA usually says which wins. Prairiefold's SOW committed Ironwhistle to a draft report by November 23, 2026, a readout meeting in December and one free retest of critical and high findings within 90 days of the final report.
Terms of service (ToS). The ToS of platforms involved in the engagement constrain what may be tested, and sometimes what tools may be used. Cloud providers publish testing policies; software-as-a-service vendors often prohibit security testing entirely without permission; some platforms forbid automated access. The client signing an authorization letter does not override a provider's terms with that client. Ironwhistle's RoE listed each platform in scope and the policy that applied to it, with the date the policy was checked.
| Document | Main purpose | Typical signers | Prairiefold date |
|---|---|---|---|
| NDA | Protect confidential information exchanged during scoping and testing | Authorized officers of both parties | August 20, 2026 |
| MSA | Long-term legal and commercial terms | Executives; reviewed by counsel | September 11, 2026 |
| SOW | This project's goals, deliverables, dates and price | Sponsor and the firm's principal | September 11, 2026 |
| Rules of engagement | How testing is carried out | Sponsor and engagement lead | September 14, 2026 |
| Authorization letter | Permission for named testers to test named targets | Someone with authority over the targets | September 14, 2026 |
Clauses that matter most in testing contracts
Some clauses deserve particular attention because testing carries unusual risks.
Limitation of liability caps what one party can recover from the other if something goes wrong. Testers want a cap, often tied to the fees paid, because a test that accidentally interrupts a client's systems could otherwise cost more than the firm is worth. Clients want the cap not to apply to gross negligence, wilful misconduct or breaches of confidentiality. Ruth and Marguerite settled on a cap of twice the fees, with those exceptions.
Indemnification means one party agrees to cover the other's losses from certain claims. Testers usually ask the client to indemnify them against claims by third parties arising from authorized testing, for example if a cloud provider or landlord complains about activity the client authorized. Clients usually ask the tester to indemnify them for testing outside the scope or for mishandling data.
Insurance clauses require the testing firm to carry professional liability (errors and omissions) and cyber liability cover at stated levels. Clients sometimes ask for a certificate of insurance before testing begins.
Data ownership and handling clauses say who owns the findings, evidence and report (normally the client owns the report; the firm keeps its own methods and tools), how evidence is stored and how long it is kept, and how it is destroyed. Prairiefold's MSA required Ironwhistle to destroy raw evidence 90 days after the final retest, with a signed destruction certificate.
Staffing clauses may require background checks for testers, named key personnel, and notice before staff change. Financial institutions often require background checks for anyone who will have access to their systems or premises, and Prairiefold did.
Computer-crime law and the line authorization draws
Every technique in the PenTest+ courses is a potential offense when used without permission. The law in Canada and the United States differs in detail but agrees on the core: accessing a computer system without authorization is a crime, and the tester's defense is the authorization itself.
In the United States, the main federal law is the Computer Fraud and Abuse Act (CFAA), 18 U.S.C. § 1030. It makes it an offense to access a computer without authorization or to exceed authorized access and thereby obtain information, and covers damaging a protected computer, trafficking in passwords and related conduct; it also lets people harmed by violations sue. In *Van Buren v. United States* (2021), the Supreme Court read "exceeds authorized access" narrowly, as entering parts of a system that are off limits to the person rather than misusing information they are entitled to reach. In May 2022 the Department of Justice revised its charging policy to say that good-faith security research should not be charged under the CFAA, but that policy binds only federal prosecutors; it does not prevent civil lawsuits or prosecution under state law. Every state has its own computer-crime statute, and physical testing engages state trespass and burglary law.
The practical lesson is the same on both sides of the border. Authorization must come from someone with actual authority, be in writing, name the targets and the testers, and exist before testing starts. Activity outside the authorization is not protected by it, however good the tester's intentions.
Authorization also has to match the technique, not only the target. A letter covering network testing of a range does not necessarily cover password attacks against the client's single sign-on service, physical entry to the building that houses the servers, or phishing the people who administer them. Each of those is a separate activity with its own risks, and each needs to be named. Ironwhistle's letter listed permitted activities by category, so that a tester could check any planned action against a specific line.
Risk to the penetration tester
PT0-003 lists risk to the penetration tester as a legal and ethical consideration, and it is real. The best-known cautionary example is from Iowa in September 2019, when two employees of a security firm were arrested during a physical test of a county courthouse. Their contract had been signed by the state judicial branch, but the county sheriff disputed that the state body had authority over the county-controlled building. The charges were eventually dropped, but the testers spent a night in jail, and the case became a standard illustration of why authorization must come from whoever actually controls the premises.
Tester risks fall into several groups.
| Risk | Example | Mitigation |
|---|---|---|
| Legal: insufficient authority | Signer does not control a building or system | Confirm authority in writing; get consent from landlords, providers and third parties |
| Legal: scope breach | Testing an address outside the annex by mistake | Technical guardrails such as target allow lists in tools; peer review of target lists |
| Physical safety | Confrontation with security staff or police | Carry the letter; agree a protocol of stopping and complying; never run or resist |
| Civil liability | An outage causes the client financial loss | Liability caps, insurance, careful testing methods, stop conditions |
| Personal data exposure | Tester's laptop holding client evidence is stolen | Full-disk encryption, minimal collection, secure evidence storage |
| Psychological strain | Discovering disturbing material on a file share | Clear procedure, access to support, no obligation to view more than needed |
Ironwhistle's physical testing protocol, which every tester signed, was blunt: if challenged by anyone, stop, identify yourself, show the letter and ask them to call the emergency contact. If police arrive, comply completely, do not argue the law, and let the client and the firm resolve it. Dario told Tobias that the most important skill in physical testing is knowing when to stop being clever.
Mandatory reporting requirements
The objectives also list mandatory reporting requirements: legal duties to report certain discoveries regardless of what the contract says about confidentiality. Testers sometimes find things that are not vulnerabilities at all. The RoE should say what happens in each case, and the contract should make clear that confidentiality does not prevent reporting that the law requires.
The most serious example is discovering material that appears to be child sexual abuse material on a system under test. Both Canadian and American law treat possession and distribution of such material as serious crimes, and testers must never copy, download or further view it. The standard procedure is to stop work on that system immediately, record only the location and time without collecting the material, and escalate at once to the engagement lead and the client's designated legal contact so that law enforcement can be notified in accordance with the law. Prairiefold's RoE named Ruth as the contact for any such discovery.
Other discoveries create obligations for the client rather than the tester. Evidence that a real attacker has already compromised the environment may trigger the client's own breach-notification duties, including the National Credit Union Administration's rule requiring federally insured credit unions to notify the agency within 72 hours of reasonably believing a reportable cyber incident has occurred, and state breach-notification laws. The tester's duty is to stop, preserve what they observed, and tell the client promptly so the client can meet its obligations. Lesson 4 covers these regimes and lesson 8 the escalation itself.
Worked problem
Whose signature is needed?
A retail chain's IT director signs an authorization letter for a physical test of a distribution warehouse. The warehouse is operated by a logistics contractor in a building the contractor leases from a property company. What is wrong, and what should the tester ask for?
Show solution
- Identify who controls each thing to be tested: the retailer owns its stock and perhaps some systems, the contractor operates the site and its staff, and the property company controls the building.
- Recognize that the IT director may lack authority even within the retailer to approve physical testing of a third party's site.
- Ask for written consent from the contractor (for its staff, systems and operations) and from the property company (for the building and common areas), and confirm the retail signer's authority.
- List all of them as emergency contacts in the letter, and do not proceed until every consent is in hand.
Answer: The letter is not enough on its own. Obtain written consent from everyone who controls the premises and systems, as the 2019 courthouse case shows.
Bringing it together for Prairiefold
By September 11, the MSA and SOW were signed. The RoE and authorization letter followed on September 14, after Ruth obtained the landlord's consent for the head office lobby and confirmed that the processor would not consent to testing of production online banking. Ana created the engagement folder: every signed document, every scope change form that would follow, and a register of contacts. Tobias was asked to read each document twice and list anything that would change how he worked. His list included the 90-day evidence destruction rule, the requirement to carry the letter on site, and the clause that no member data could leave Prairiefold's systems, even in a screenshot.
Common mistakes
MistakeAssuming an NDA authorizes testing.
InsteadAn NDA protects information; only the authorization letter grants permission to test.
MistakeTreating the client's permission as overriding a cloud provider's terms of service.
InsteadCheck and follow each platform's current testing policy and record it in the RoE.
MistakeCopying suspected illegal material as evidence.
InsteadStop, record only location and time, and escalate to the designated legal contact.
MistakeBelieving a good-faith motive is a complete legal defense.
InsteadWritten authorization from someone with real authority is what separates testing from an offense.
MistakeIgnoring liability and insurance terms as "just legal".
InsteadThese clauses decide who bears the cost if testing causes harm; testers should understand them.
Summary and key terms
- The NDA protects confidential information, the MSA sets long-term terms, the SOW defines one project, and platform terms of service limit what may be tested.
- Key clauses include limitation of liability, indemnification, insurance, data ownership and destruction, and staffing requirements.
- Unauthorized access is a crime under the CFAA and state computer-crime laws; written authorization from someone with actual authority is the tester's protection.
- Risks to the tester include legal exposure, physical confrontation, liability, data exposure and psychological strain.
- Mandatory reporting duties, such as those for illegal material or real breaches, override confidentiality; the RoE should name who is told.
- Non-disclosure agreement (NDA)
- A contract obliging parties to keep specified information confidential.
- Master services agreement (MSA)
- A contract setting the long-term legal and commercial terms under which individual projects are performed.
- Statement of work (SOW)
- A document defining one project's objectives, scope, deliverables, schedule and price.
- Terms of service (ToS)
- A platform's conditions of use, which may restrict security testing.
- Limitation of liability
- A clause capping the damages one party can recover from the other.
- Indemnification
- A promise by one party to cover the other's losses from specified claims.
- Mandatory reporting requirement
- A legal duty to report certain discoveries to authorities regardless of confidentiality terms.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Which document is usually signed first, and why?
Show answer
The NDA, because scoping discussions reveal sensitive information.
Where would you find the price and delivery date for one specific test?
Show answer
In the statement of work.
What lesson does the 2019 Iowa courthouse arrest teach?
Show answer
Authorization must come from whoever actually controls the premises or systems.
What should a tester do on finding evidence that a real attacker is already in the network?
Show answer
Stop, preserve observations without disturbing evidence, and escalate to the client promptly so it can respond and meet any notification duties.
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.