← Security and risk guides

How to review security-sensitive changes with SpecDD

How-To Security and risk Advanced 1161005HOWTO-1161005

HOWTO-1161005Security and riskAdvanced

This guide shows you how to review security-sensitive changes with SpecDD in a spec-driven development workflow.

In a security review, the question is not only whether the code works. The reviewer must know whether the change stayed inside the right authority, preserved inherited constraints, avoided forbidden dependencies, and produced the evidence the spec requires.

Short answer

Find the governing spec chain, classify the change risk, compare changed files against Can modify or Owns, check that Must not and Forbids rules were not violated or weakened, verify Done when evidence, and require explicit approval for ambiguous changes to security, data, destructive behavior, or public contracts.

When to use this guide

Use this guide for pull requests or agent diffs that touch:

Steps

1. Classify the security surface

Start by naming what kind of security behavior changed.

Examples:

If the pull request description does not say this, request clarification before reviewing implementation detail.

2. Find the governing specs

Review against the spec chain that governs the changed files. Include:

Do not treat every nearby spec as authority. Use the specs that actually govern or are explicitly referenced.

3. Check write authority

Changed files should be inside the nearest relevant spec’s Can modify, or inside Owns when Can modify is absent.

Ask:

For agent-generated changes, this is the first hard boundary to check.

4. Review Must not and Forbids

Security-sensitive diffs often hide risk in negative constraints.

Check whether the change:

Treat removals and weakenings as governance changes. They need rationale and appropriate approval, not just passing tests.

5. Verify required security behavior

Use Must, Handles, Raises, Scenario, and Done when to decide what evidence should exist.

For authentication and authorization:

For privacy:

For payments:

For rate limits:

6. Check logs, secrets, and audit evidence

Security regressions often appear outside the main return value.

Check:

If the spec says an audit event is required, the review should check event content and event timing, not only that a logger was called.

7. Approve, narrow, or block

Approve when:

Request narrowing when the implementation crosses boundaries that can be avoided.

Block when:

Review checklist

Use this checklist for high-risk reviews:

Agent prompt

Use a focused review prompt:

Review the account export change against its security constraints.

For risk first:

Classify the security risk of the password reset change.

Keep review prompts separate from implementation prompts.

Common mistakes

How to verify the result

The review is complete when:

← Security and risk guides