Safeguard
Security Guides•

How do you write security requirements a tester can verify?

A testable security requirement names the actor, action, condition and result. Here is a template, weak versus strong examples and steps to write one.

Safeguard Security Team
4 min read

A testable security requirement names who acts, what they do, under what condition and what must happen, in terms a tester can check. "The system shall be secure" cannot fail, so it cannot pass. "A user without the admin role gets a denial on the delete call" can.

Why vague requirements fail

If a requirement cannot be tested, teams argue about whether it was met. NIST's Secure Software Development Framework asks organizations to identify and document the security requirements their software must meet and to maintain them over time (PO.1.2), and to verify compliance at key points in the lifecycle. Verification needs a requirement that can be verified.

A four part template

Use this sentence shape: Given a condition, when an actor does an action, then a specific result occurs, and it is recorded or limited in a stated way.

PartQuestionExample
ActorWho?A signed-in user without the editor role
ActionDoes what?Calls the update endpoint
ConditionWhen?For a record they do not own
ResultWhat must happen?The call is denied and the denial is logged

Weak versus strong

WeakStrong
Passwords must be strongPasswords shorter than the agreed minimum length are rejected at signup with a clear message
The system must be protected from injectionInput containing a quote or script tag is stored and displayed as plain text, and never executed
Access must be controlledA user can view only records that belong to their organization
Logs must be secureLogs contain no passwords or full card numbers, and only the audit group can read them
Data must be encryptedData at rest in the customer table is encrypted with a key held outside the database

Steps to write one

  1. Start from a risk. Ask what could go wrong. The Threat Modeling Manifesto's second question is "what can go wrong?"
  2. Write the safe behavior in a sentence. Name the actor and the action.
  3. Add a number or a state. Length, count, time or a named result.
  4. Ask how you would test it. If you cannot say, rewrite it.
  5. Decide where it is checked. Unit test, integration test, review, scan or manual test.
  6. Link it to the story. A requirement without a home is forgotten.

Pick a source for the content

You do not need to invent requirements. The OWASP Application Security Verification Standard provides a basis for testing application technical security controls and a list of requirements for secure development, and it is a practical menu to choose from. Pick the items that match your risks and rewrite them in your own words with your own roles and data.

Where thresholds come from

Some thresholds, such as password length or session timeout, are policy choices. Write them in a shared policy document and refer to them from requirements, so changing the policy updates every story. Do not hard code the number in dozens of tickets.

Check coverage

Once a quarter, list your requirements and tick whether each has a test. Missing tests are a to-do list. Requirements that nobody can test are candidates for rewriting or removal.

Common mistakes

  • Listing technologies instead of outcomes, such as "use TLS" with no statement of what must be protected.
  • Writing requirements that duplicate the definition of done.
  • Making them so detailed they describe the design, not the behavior.
  • Leaving out the negative case.

Link to evidence

A requirement with a passing test is evidence. Store the test result with the release so you can show it later. Safeguard offers compliance and evidence automation, which can map checks and results to controls and keep them for reviews. A free scan is at gold.safeguard.sh/scan.

Quick check

What makes a security requirement testable?

It names the actor, action, condition and a specific observable result, so a tester can try it and see pass or fail.

Where can I find requirement wording to start from?

The OWASP ASVS is a practical menu of requirements. Choose the ones that match your risks and rewrite them with your roles and data.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.