Threat Model
@webframp/threat-modelv2026.06.15.1
01README
Agile threat modeling as an agent-guided concept model. Guides structured threat assessment through progressive discovery: scope, identify, evaluate, mitigate, posture. Stores versioned threat models with automatic risk matrix computation, control coverage tracking, and a compact posture snapshot for monitoring.
Follows the discipline's methodology: identify threats, assess likelihood × impact, define compensating controls, and track residual risk through mitigated/accepted/deferred/unaddressed status per scenario.
02Models
@webframp/threat-modelv2026.06.09.2threat-model/mod.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| likelihoodScale | string | Definition of likelihood levels for consistent scoring |
| impactScale | string | Definition of impact levels for consistent scoring |
| mitigationFramework | string | Reference framework for control selection (CWE, NIST, OWASP, custom) |
fn scope(subject: string, scope: string, currentPosture: string, assets: array)
Define the threat assessment scope and establish context.
AGENT GUIDANCE:
1. Ask: "What system, feature, or change are we assessing?"
Get a one-sentence subject and a paragraph of current security posture.
2. Ask: "What assets are at stake? List the key properties — credential types,
data classifications, integration points, trust boundaries."
Record as name/value pairs.
3. Ask: "What is the assessment date and any relevant context about timing
(e.g., pre-deployment, post-inciden
| Argument | Type | Description |
|---|---|---|
| subject | string | What is being assessed (system, feature, change) |
| scope | string | Boundary statement: what is/is not included |
| currentPosture | string | Current security posture before this change |
| assets | array | Key assets at stake (credential types, data, integrations) |
fn identify(threats: array)
Identify threat scenarios through structured conversation.
AGENT GUIDANCE:
1. Read the current assessment resource to understand scope and assets.
2. For each asset/trust boundary, guide discovery:
- "Who might attack this? What is their motivation?"
- "What could go wrong if this is compromised?"
- "What is the attack chain — what steps does exploitation require?"
3. For each threat scenario, capture:
- A short ID (T1, T2, ...)
- Title (one line)
- Description (what could
| Argument | Type | Description |
|---|---|---|
| threats | array |
fn evaluate(openQuestions: array, adjustments: array)
Produce the risk matrix and add open questions.
AGENT GUIDANCE:
1. Read the current assessment to review identified threats.
2. Present the risk matrix (likelihood × impact → risk level) to the user.
Discuss whether any scenarios need re-scoring based on new information.
3. Identify open questions — things that would change the assessment if answered:
- Undocumented behaviors
- Vendor dependencies
- Propagation delays
- Missing telemetry
4. Call this method to record open que
| Argument | Type | Description |
|---|---|---|
| openQuestions | array | |
| adjustments | array | Optional re-scoring of threats based on discussion |
fn mitigate(controls: array, acceptances: array, deferred: array, recommendation: string)
Define compensating controls and produce recommendation.
AGENT GUIDANCE:
1. Read the current assessment and its threat scenarios.
2. For each threat (or cluster of related threats), guide control definition:
- "What compensating control reduces this risk?"
- "Does it fully mitigate, partially reduce, or minimally address the threat?"
- "Is it already implemented or proposed?"
Reference the configured mitigationFramework (globalArgs) for principles.
3. For threats where no control
| Argument | Type | Description |
|---|---|---|
| controls | array | |
| acceptances | array | |
| deferred | array | Threat IDs to mark as deferred |
| recommendation | string |
fn posture()
Compute and write a compact risk posture snapshot. Reads the current
fn revisit(changesNoted: array)
Review an existing threat model against system changes.
AGENT GUIDANCE:
1. Read both the assessment and posture resources. Present the current state.
2. Ask: "What has changed since this was last assessed? Consider:
- New integrations, APIs, or dependencies added
- Configuration changes (features enabled/disabled)
- Incidents that revealed new attack surface
- Controls that have been implemented since last review
- Open questions that now have answers"
3. For each change, dete
| Argument | Type | Description |
|---|---|---|
| changesNoted | array | Summary of changes identified during review discussion |
Resources
assessment(infinite)— Full threat model state: scope, threats, controls, acceptances, recommendation
posture(infinite)— Compact risk posture snapshot. Derived from assessment; safe for periodic monitoring.
03Previous Versions
2026.06.09.2Jun 10, 2026
2026.06.09.1Jun 9, 2026
04Stats
A
100 / 100
Downloads
1
Archive size
19.3 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned
05Platforms
06Labels