The SDLC pipeline
Threat model
STRIDE threats over the design's trust boundaries, answered with OWASP ASVS controls.
7 min read7 sections
The Threat Model step analyses the design for security threats with STRIDE (spoofing, tampering, repudiation, information disclosure, denial of service and elevation of privilege) and answers each threat with OWASP ASVS controls. The agent, working as an application security architect, applies STRIDE at every trust boundary the TAD recorded and to the design components in the SDS, rates each threat, and maps the controls to the compliance frameworks the project carries. It runs beside the chain once the SDS exists, so the controls are decided while they are still cheap to build.
What you get
A Markdown document titled Threat Model. The bridge adds the title block on top, and after the agent's text it adds a Threat Register built from the typed data, then the version history. The agent writes six sections in this order:
| Section | Contents |
|---|---|
| 1. Scope | The system, the assets worth protecting, the attackers considered and what is out of scope, with an Asset Inventory table, a Threat Actors table and a list of Assumptions and Dependencies |
| 2. Trust Boundaries | A data-flow diagram of the users, design components (by DC id), data stores and external services with each trust boundary marked, then a table of what each boundary separates and what data crosses it |
| 3. Threats | One row per threat, THR-001 upward: the boundary or component, the STRIDE category, the threat, likelihood and impact, and the OWASP Risk Rating |
| 4. Controls | For each threat id, the control, the ASVS 4.0.3 requirement it satisfies, the component that implements it and how it is verified, including detection, logging and secret handling |
| 5. Residual Risk | What remains after the controls, its rating, and the role that must accept it |
| 6. Compliance Mapping | For each framework in the project's compliance flags, the requirement and the threats and controls that satisfy it |
The bridge requires these six headings (Scope, Trust Boundaries, Threats, Controls, Residual Risk and Compliance Mapping) and at least one Mermaid diagram.
Before you run it
- The SDS must exist. It does not need to be approved. Until it exists,
/threatis locked with "Run System Design Spec first". If the project state lacks it, the run stops with "Cannot write the Threat Model: sds artifact is missing from state.json. Run /sds first." - The TAD is not required, but it makes the model stronger. When the project holds a TAD model, its trust boundaries (
TB-NN) are sent to the agent, which must use them in section 2 and give each one a threat. Without a TAD model the message carries no boundaries, and the boundary coverage check does not run. - The agent also receives the requirements, the design components, the architecture decisions, the compliance flags and the list of ids it may cite. It receives the approved TAD and SDS as source documents.
How it works
Threat makes one skill call, sdlc-threat-modeler. The reply is one JSON object with two keys: markdown, and threats, a typed list restating sections 3 and 4 as data. The bridge checks the reply the same way it checks the TAD: hard problems are repaired once, everything else becomes a note for the reviewer.
- Trust boundaries from the TAD to sdlc-threat-modeler
- Design components from the SDS to sdlc-threat-modeler
- sdlc-threat-modeler to Threats: boundary, STRIDE category, controls
- Threats: boundary, STRIDE category, controls to Every boundary has a threat?
- Every boundary has a threat? to Note: boundary uncovered, No
- Every boundary has a threat? to Every threat has a control?, Yes
- Note: boundary uncovered to Every threat has a control?
- Every threat has a control? to Note: threat has no control, No
- Every threat has a control? to Add Threat Register, write threat-vN.md, Yes
- Note: threat has no control to Add Threat Register, write threat-vN.md
A hard problem is a missing required section, a design component id that does not exist in the SDS, or an empty document. The attempt is spent again only when a reply cannot be read or the document is empty; the first draft with any text is kept with its hard problems listed, and Fix failed checks then asks the agent to rewrite just the sections they sit in. The bridge makes no repair call by itself unless an operator allows more attempts. Everything else is accepted with a note shown above Approve.
| Note | Raised when |
|---|---|
| Too few diagrams | The document has no Mermaid block, or a block does not start with a diagram type |
| Typed part missing or malformed | threats is absent or empty, or rows were dropped for a bad THR id or missing fields |
| Boundary uncovered | A trust boundary from the TAD is named by no threat, by its TB id or its exact name |
| Threat with no control | A threat has an empty controls list. Give it a control, or move it to Residual Risk with an owner |
| No framework obligation | The project has compliance flags, and a threat names no frameworkControls |
The skill also asks that each THR id appears in the Controls table or explicitly in Residual Risk, that every STRIDE category is considered at every boundary, and that each threat names a real component, data store or external service. The bridge does not enforce those three, so they belong on your review list. When the product uses Poly-X for identity or notifications, the skill treats Poly-X as a trusted external dependency, draws it as its own zone and models threats at that boundary, such as token replay, a mismatched organization id and an introspection outage.
The run panel shows: Checking project state, Modelling threats, Writing the Markdown document.
Ids this step owns
| Id | Meaning |
|---|---|
THR-NNN | A threat, with the boundary it applies to, its STRIDE category, its controls and the framework obligations those controls meet |
The model cites TB-NN boundaries from the TAD, DC-NNN components from the SDS and requirement ids from the SRS, and creates none of them.
Reviewing it
Threat is a supporting step: it finishes as Awaiting your review, but nothing waits for it and approving it unlocks nothing. Check that:
- every trust boundary in the TAD appears in section 2 and in at least one threat;
- the threats name real components and data stores, not generic ones, and cover payment, authentication and personal-data flows;
- each control is specific (a mechanism and a limit, not "use encryption") and says how it is verified;
- the compliance mapping names only frameworks the project carries, and the residual risks have an owner role you recognise;
- the likelihood and impact ratings are ones you would defend.
You can edit the draft while it is under review. The Threat Register stays as the bridge wrote it. Request changes sends the agent the draft and your change list and asks for only what changes, so everything you did not mention is kept as it was.
While a draft is under review, a re-run or Request changes rewrites the same version. After approval, the next run writes the next version.
When it fails
| What you see | Why | What to do |
|---|---|---|
/threat locked: "Run System Design Spec first" | The SDS has not been produced. | Run /sds. |
| "The agent did not return a usable reply." | Every attempt returned something that could not be read, or an empty document. | Run it again. |
| A "problems to fix" note about a boundary or a control | The model left a TB uncovered or a threat without a control. | Request changes naming the boundary or the THR id. |
| A design component id reported as not existing | The document cites a DC id the SDS does not have, and the draft was kept as written. | Request changes, or re-run after the SDS settles. |
Under the hood
- The driver is
bridge/src/services/threatPipeline.service.ts; the headings and diagram minimum are inbridge/src/lib/documentSpecs.tsand the typed-part and quality rules inbridge/src/lib/documentQuality.ts. - The document is
.sdlc/artifacts/threat-vN.md, registered asartifacts.threat. The draft and its reply are kept in.sdlc/tmp/threat-data.jsonwhile under review. - The Compliance step reads the threat model as evidence when it exists.