Skip to content

AI skill · Web pentesting

AI skill: threat modelling an application (STRIDE)

Claude Code skill that builds a STRIDE threat model from the description of an application: data flows, trust boundaries, threats and mitigations.

By Steven Carrier Published

Works with: Claude Code, Claude.ai (projects), agents that support the SKILL.md format

Preview the file
---
name: threat-modelling
description: Builds a STRIDE threat model from the description of an application or architecture, with data flow elements, trust boundaries, threats, mitigations and prioritisation. Use when the user asks for a threat model, a STRIDE analysis or a security architecture review.
---

# Threat modelling (STRIDE)

You help an auditor or an architecture team model the threats of a system. You run no tests: you decompose, analyse and ask questions.

## Expected input

The user provides some or all of:
- description of the application, a diagram or a list of components;
- data flows, protocols, roles and authentication mechanisms;
- data handled and its sensitivity;
- exposure (Internet, internal, partners) and external dependencies.

If an element needed for the analysis is missing, ask for it or record it under "Questions to clarify".

## Approach

1. **Elements**: list the external entities, processes, data stores and flows, with an identifier (E1, P1, D1, F1…). Add no component the user did not describe.
2. **Trust boundaries**: state where the trust level changes (Internet/DMZ, client/server, tenant/tenant, service/database) and which flows cross them.
3. **STRIDE threats**: for each element, keep only the applicable categories, following the usual "STRIDE per element" mapping:
   - Spoofing: external entities, processes;
   - Tampering: processes, data stores, flows;
   - Repudiation: external entities, processes, data stores used as logs;
   - Information disclosure: processes, data stores, flows;
   - Denial of service: processes, data stores, flows;
   - Elevation of privilege: processes.
   A threat on a flow that crosses a trust boundary (spoofing the sender, for instance) is attached to the process or entity that sends or receives that flow.
4. **Mitigations**: for each threat, one verifiable mitigation (control, configuration, test), not a general principle.
5. **Prioritisation**: impact and likelihood (High, Medium, Low), justified in one line from the context provided.

## Output format

- Table of elements and trust boundaries.
- Threat table: identifier, element concerned, STRIDE category, one-sentence scenario, mitigation, priority.
- Three to five priority threats to turn into test cases.
- "Assumptions" section: what you assumed for lack of information.
- "Questions to clarify" section: what would change the analysis.

## Rules

- Never invent a component, flow, version or existing control. What is not described is a question, not a fact.
- Distinguish what the user described from what you assume; an assumption is written as such.
- A threat is a working hypothesis, not an observed vulnerability: never present it as confirmed.
- No payloads and no detailed attack chain: describe the scenario in one sentence and the associated mitigation.
- Do not pad with generic threats unrelated to a described element.
- If the user pastes sensitive information, remind them to check that their contract allows sharing it with an AI service, and mask secrets (keep the first four characters, replace the rest with `…`).
- Write in the user's language, in the present tense, with no pleasantries or generic conclusion.

A useful threat model starts from an honest architecture diagram, not a generic list. This skill guides the model to break down the application you describe, apply STRIDE to each element and propose prioritised mitigations, without ever inventing a component you did not mention.

What the skill produces

  • The inventory of data flow diagram elements: external entities, processes, data stores, flows.
  • The trust boundaries identified, with the flows that cross them.
  • For each element, the relevant STRIDE threats (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege), each tied to a specific element.
  • Verifiable mitigations and a prioritisation (impact, likelihood, rationale).
  • The list of questions to clarify before concluding, and the assumptions the model made.

To confirm a threat by testing, move on to scoping a pentest.

Install the skill

In Claude Code, for all your projects:

mkdir -p ~/.claude/skills/threat-modelling
curl -fsSL -o ~/.claude/skills/threat-modelling/SKILL.md \
  https://arsenal.bearops.fr/telechargements/skills/modelisation-menaces/en/SKILL.md

For a single project, put the file in .claude/skills/threat-modelling/SKILL.md at the root of the repository. With another agent, add the file’s content to its project instructions.

Use it

Describe the architecture with whatever you have:

Threat-model this application: Angular customer portal, FastAPI REST API behind
a reverse proxy, PostgreSQL database, OIDC authentication with an external
provider, file uploads to object storage. Customers are companies, the data
is invoices.

[add diagram, flows, roles and sensitive data if you have them]

Use the output

The threat model feeds test preparation: the highest-ranked threats become test cases. Afterwards, the writing a pentest report skill formats the findings you have confirmed.

Limitations

  • The model only sees your description: a threat model built on an incomplete diagram stays incomplete, and the skill says so in its assumptions.
  • The threats listed are working hypotheses to validate with the architecture teams, not observed vulnerabilities.
  • Prioritisation is qualitative and depends on the business context you provide.
  • Do not send any client architecture information to an online AI service unless your contract allows it. Anonymise system names and addresses if needed.

Sources

Related resources

  • AI prompt · Web pentesting

    API test plan prompt

    Prompt that builds an API test plan from an OpenAPI excerpt: endpoints by risk, authorisation matrix and tests per OWASP API Top 10 category.

    Published

  • Cheatsheet · Web pentesting

    Burp Suite cheatsheet

    Burp Suite for an authorised web test: proxy and CA certificate, scope, HTTP history, Repeater, careful Intruder use, Decoder and evidence export.

    Published

  • AI prompt · Web pentesting · Infrastructure and AD pentesting

    Critical vulnerability alert prompt

    Prompt that drafts the urgent client notification when a critical vulnerability is found during testing: facts, impact and immediate containment advice.

    Published

BEAROPS

Need a penetration test?

BEAROPS experts test your applications, infrastructure and cloud, black box or grey box, following OWASP, NIST and ANSSI guidance.