Threat model of a system or feature — assets, data flows and trust boundaries, STRIDE per boundary, attack trees, a threat and mitigation register with an owner, an ADR and a test, security requirements, residual risk for a human decision (threat model, STRIDE, attack tree, security architecture, risk register).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Threat Modeling?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/vectora-os-threat-modeling)
---
name: threat-modeling
description: Threat model of a system or feature — assets, data flows and trust boundaries, STRIDE per boundary, attack trees, a threat and mitigation register with an owner, an ADR and a test, security requirements, residual risk for a human decision (threat model, STRIDE, attack tree, security architecture, risk register).
metadata:
category: security
---
# Threat model
## Purpose
This skill builds and updates the project's threat model: from a new feature, ADR or external integration to a threat register with mitigations, owners and evidence. The model relies only on accepted documents: if a trust boundary or a mitigation is not described in them, it is an open question for the owner, not the agent's decision. Residual risk is accepted by a human.
This is a design-time skill. Checking a specific diff before merging is done by `independent-security-review`, and the threat model gives it the list of what to check.
## Inputs
- Feature design, data flows, ADRs.
## Outputs
- Threat model (`templates/threat-model.md`) with register and review items.
## Read first
- [Project Brain](../../../project-brain/README.md) — `npm run brain -- query "threat model"` for prior decisions, patterns and lessons.
- [AGENTS.md](../../../AGENTS.md) — the "Invariants" and "Restrictions" sections.
- [ADR register](../../../docs/adr/README.md) — decisions on authentication, access, tenant isolation, data storage, integrations and deployment.
- The architecture document, if the project has one (for example `docs/architecture.md`) — components, data ownership, external systems.
- The current threat model, if the project has one (for example `docs/security/threat-model.md`); if not, create it from the template below.
- [Glossary](../../../docs/glossary.md) — project terms.
- Template: [../../../templates/threat-model.md](../../../templates/threat-model.md).
## Steps
1. **Scope.** Name the object of the model: a feature, an ADR, an external integration or the whole system. List the assets: user and tenant data, personal data, credentials and sessions, keys and secrets, audit logs, paid resources (compute, external APIs), service availability.
Done when every asset has a named owner and the document where it is described, or the entry "not described — question for the owner".
2. **Flows and boundaries.** Draw the data flows (as text or a diagram in code): client → API, administrator → admin panel, external service → webhook, system → external API, service → storage, CI → deployment environment. Mark the trust boundaries: internet, internal network, privileged zone, third-party service, supply chain.
Done when every flow crosses no more than one boundary and is labelled with its protocol and authentication method.
3. **STRIDE per boundary.** For every boundary go through Spoofing, Tampering, Repudiation, Information disclosure, Denial of service and Elevation of privilege. Use the catalog from the template, but record only applicable threats.
Done when every boundary has STRIDE rows or the entry "not applicable" with a reason.
4. **Attack trees.** Build trees for 2–5 main attacker goals, for example "access another tenant's data", "act on behalf of another user", "escalate to administrator", "leak a secret", "exhaust a resource". Leaves are concrete attacker actions, including an insider (an employee, a database administrator, a compromised dependency).
Done when every leaf leads to a mitigation or an open question.
5. **Mitigations.** For every threat name the existing mitigation with a link to an ADR, a document section or a test. If there is no mitigation, propose options but do not choose.
**Rule:** a new mitigation that affects the architecture is recorded as an ADR per the `architecture-decisions` skill after the owner's decision.
Done when every threat has a mitigation with evidence or a question for the owner.
6. **Security requirements.** Formulate the feature's requirements from the repository's accepted ADRs and documents. An external requirements catalog (for example, OWASP ASVS) is only an optional reference for completeness: its text is not copied and the result is not phrased as conformance to it.
Done when every requirement is phrased as "conforms to document X" or "requires confirmation" with a link to a repository document.
7. **Register and residual risk.** Fill in the register: threat, boundary, likelihood and impact, mitigation, evidence, owner, residual risk. Residual risk above low goes to a human for a decision.
Done when the register is handed to the owner and the items for `independent-security-review` are listed.
## Best practices
- Model per trust boundary.
- Every mitigation has evidence or is open.
- Residual risk accepted by a human.
## Common mistakes
- Generic threats without this system's flows.
- Mitigations without tests.
## Example
Partner API: 3 boundaries, 14 threats, mitigations with tests, 2 residual risks for owner decision.
## Reusable prompt
```text
Apply the threat-modeling skill (.agents/skills/threat-modeling/SKILL.md).
Context: {{task card or question; links to PRD, ADRs, code paths}}
Constraints: {{approved thresholds, deadlines, allowed files}}
Build or update the threat model: assets, flows, boundaries, STRIDE threats, mitigations with evidence and owners, residual risks.
Cite evidence for every claim; list open questions separately.
```
## Checks
- [ ] Every asset has an owner; every flow is labelled with its protocol and authentication method.
- [ ] Every boundary has STRIDE rows or "not applicable" with a reason.
- [ ] Secrets, internal service tokens and integration keys never reach the client; this is recorded as a threat with a mitigation.
- [ ] Tenant isolation (if the project is multi-tenant) is analysed for every store; the "request without a scope" threat is recorded with a mitigation.
- [ ] Every webhook and outgoing integration: signature, time window, replay, address only from approved configuration.
- [ ] An insider and a compromised dependency are considered as attackers.
- [ ] Every mitigation has a link to an ADR, a document or a test; without a link — "no mitigation".
- [ ] Residual risk of medium and above goes to a human for a decision.
- [ ] No "compliant", "certified" or statements of conformance to an external requirements catalog.
## Out of scope
- Reviewing a specific diff — `independent-security-review` in a separate session.
- Active attacks on environments — only authorized penetration testing with separate permission, not an agent.
- The decision to accept a risk and the choice of a protection mechanism — the owner and an ADR (`architecture-decisions`).
- Personal data in substance — `privacy`; legal requirements — a lawyer.