hermes

Threat model a feature

Builds a threat model for one feature or change, mapping data flows and trust boundaries to ranked threats and mitigations. Use during design, before the code is written or merged.

context

A threat model is useful only when it is specific to this feature. Generic lists ("use HTTPS", "validate input") are already known and get ignored. The value is in naming the exact place where an attacker crosses a trust boundary, what they gain, and the one control that stops them, while the design is still cheap to change.

task

Threat model this feature: Only if [SYSTEM_CONTEXT] is given: System context: Depth: .

  1. Read the spec and, if the code exists, the code that implements it. State what you read.
  2. List the elements: actors (human and machine), processes, data stores and external services. Mark each data store with the most sensitive data it holds (credentials, personal data, payment data, secrets, internal only).
  3. Draw the data flows between elements and mark every trust boundary: where data or control crosses from less trusted to more trusted (internet to service, tenant to tenant, user to admin, service to third party, CI to production).
  4. At each boundary, apply STRIDE (spoofing, tampering, repudiation, information disclosure, denial of service, elevation of privilege). Keep a threat only when you can name the attacker, the entry point, what they send or do, and what they gain.
  5. For each kept threat, check whether a control already exists. Mark it "verified" only if you saw it in code or config, otherwise "assumed" or "missing".
  6. Rate likelihood and impact as low, medium or high, and rank by their combination.
  7. For each threat rated high on either axis, give the smallest mitigation that closes it and the test that would prove the mitigation works.
  8. Only at thorough depth: also cover abuse of legitimate features (scraping, enumeration, free-tier abuse, spam) and the dependencies and build steps the feature adds.
constraints
  • Every threat names a specific element and boundary from step 3. Drop threats that would apply to any web app unchanged.
  • Never claim a control exists unless you saw it. Say what you would need to see to verify it.
  • Prefer design changes (remove the boundary crossing, narrow a permission, drop a field) over adding more checks.
  • For quick depth, stop at 5 threats. For standard and thorough, stop at 15 and say how many you dropped as low risk.
  • Describe attacks at the level a defender needs to test them. No weaponised exploit code.
  • Read the relevant code before making a claim about it. Do not guess what a file, function or config contains.
  • If the information you need is not available, say what is missing and how to get it instead of inventing it.
  • Separate what you verified from what you inferred. Mark inferences as such.
  • When you do not know, say "I don't know" once and state what would settle it.
output format

Scope and assumptions

What is in and out of scope, what you read, and each assumption you made.

Data flows

A numbered list of flows (1. Browser -> API: session cookie, order JSON), with each trust boundary marked [TB-n: name]. A Mermaid flowchart is welcome if it stays under 20 nodes.

Threats

| ID | Boundary | STRIDE | Threat (attacker, entry, action, gain) | Control (verified / assumed / missing) | Likelihood | Impact |

Top mitigations

Numbered, highest risk first. Each: threat IDs it closes, the change, and the test that proves it.

Open questions

Questions whose answers would change a rating, each with the threat ID it affects. "None" if there are none.

1 required value still a placeholder; the assistant will ask for it.

details

kind
Prompt: a task you run by name to get one finished thing back
domain
Software engineering
category
Security
level
Intermediate
made for
Security engineer, Software engineer, Software architect, Tech lead / staff engineer
needs
repo-read
risk
read-only
version
v1.0.0 · experimental
reviewed
2026-10-02
works in
Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md

Edit on GitHubReport a problem

use in

Hodios CLI
npx @hermes-hq/hodios install threat-model-feature --target claude-code
Agent Skills
npx skills add hermes-hq/hodios-dist --skill threat-model-feature -a claude-code
Add the Hodios marketplace (once)
claude plugin marketplace add hermes-hq/hodios-dist
Install the software-engineering plugin
claude plugin install hodios-software-engineering@hodios

The plugin brings every entry in this domain at once.

pairs well with

All of Security
PersonaSecurity

Security auditor

Reviews code for exploitable weaknesses and reports only issues with a concrete attack path. Use as a reviewer persona or subagent for security-sensitive changes.

security-auditor
PromptSecurity

Review a pull request for security

Reviews a diff for exploitable vulnerabilities and reports only findings with a concrete attack path. Use before merging changes to input handling, auth, data access or dependencies.

review-pr-for-security
PromptSecurity

Respond to a leaked secret

Produces an ordered response plan for an exposed key, token or password - revoke and rotate, audit use, clean up copies, notify and prevent. Use right after a secret is committed, logged or shared.

respond-to-leaked-secret
PromptSecurity

Review an API against the OWASP API Top 10

Reviews an API design or implementation against the OWASP API Security Top 10, from object-level authorization and mass assignment to rate limits and SSRF, with attack paths and fixes.

review-api-security
PromptSecurity

Review a cloud IAM policy

Reviews AWS, GCP or Azure IAM policies for over-broad permissions, privilege-escalation paths, wildcard resources and missing conditions, and proposes least-privilege versions.

review-cloud-iam-policy
PromptSecurity

Triage a vulnerability report

Triages an external vulnerability or bug bounty report by checking the claim, rating severity with CVSS, deciding valid, duplicate or out of scope, and drafting the reply. Use for security inboxes.

triage-vulnerability-report