← Security and risk guides

How to use SpecDD for risk classification

How-To Security and risk Intermediate 1161006HOWTO-1161006

HOWTO-1161006Security and riskIntermediate

This guide shows you how to use spec-driven development for risk classification.

Risk classification helps teams decide whether a change can proceed directly, needs a plan, needs a spec update, needs security review, or should stop until a human decision is made. SpecDD makes the classification concrete because the reviewer can inspect write authority, inherited constraints, forbidden dependencies, scenarios, and completion criteria.

Short answer

Classify risk before implementation. Check the governing specs, Can modify or Owns, inherited Must not and Forbids, public contracts, security surfaces, data impact, dependency changes, and verification. Label the change low, medium, or high risk with concrete reasons and the smallest safe next step.

When to use this guide

Use this guide when a change:

Steps

1. Classify before implementation

Risk classification should happen before files are edited.

Prompt:

Classify risk for the account deletion task.

Do not combine this with implementation. The point is to identify stop conditions while the repository is still unchanged.

2. Check authority and constraints

Inspect:

Unclear write authority raises risk. A task that violates Must not or Forbids is not low risk just because the code change looks small.

3. Identify risk factors

Use this list as a starting point:

The classification should name the specific factors that apply.

4. Assign a risk level with reasons

Use a simple rubric unless your team already has one.

Low risk:

Medium risk:

High risk:

Example report:

Risk: high.

Reasons:
- The task changes account deletion behavior.
- The local spec requires audit logging and retention checks.
- The requested shortcut would bypass the deletion policy owner.

Smallest safe next step:
Update the account deletion spec and request security review before implementation.

5. Choose the next workflow

Risk classification should end with a next step.

Possible next steps:

The next step should reduce risk, not just continue momentum.

6. Record required evidence

For medium and high risk, name the evidence needed before completion.

Done when:
  Account deletion requires authenticated owner approval.
  Deleted account data is excluded from future exports.
  Deletion audit event includes account id and actor id without private payload data.
  Existing account export and retention checks pass.

Evidence may include focused tests, static checks, migration dry runs, manual review, audit inspection, or CI gates.

7. Put team-wide risk rules in bootstrap.project.md

If your team uses a shared risk rubric, keep the project-wide convention in .specdd/bootstrap.project.md.

Good bootstrap rule:

## Risk Classification

- Treat auth, authorization, secrets, privacy, payments, audit logs, migrations, and public API changes as high risk
  unless the governing spec says otherwise and the security owner agrees.
- Do not implement high-risk work until the governing spec names required verification.

Local behavior still belongs in local .sdd specs. The bootstrap file describes the shared workflow.

Common mistakes

How to verify the result

Risk classification worked when:

← Security and risk guides