agentleFS
kwhornekwhorne/elyra-skills/skills/threat-modeling/SKILL.md

threat-modeling

Skill1 starsChanged 6 months agoMITView on GitHub

Model threats before building - map assets, trust boundaries, and attack surfaces, walk STRIDE categories, and rank risks with concrete mitigations. Use when the user designs a new feature or system that handles sensitive data or auth, asks "how could this be abused", or wants a threat model or security design review before implementation.

29 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use supply-chain-security, performance-profiling and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    supply-chain-security

    Activate when reviewing or modifying dependency resolution, lockfile schema, package downloaders, signature/integrity checks, file integration cleanup, or anything that could expose APM to dependency confusion, typosquatting, malicious packages, or token leakage.

    Also in 3 projects that use this

  • conorluddySkill

    performance-profiling

    Instruments integration and performance analysis workflows for iOS apps. Use when profiling CPU usage, memory allocation, network activity, or energy consumption. Covers Time Profiler, Allocations, Leaks, Network instruments, and performance optimization strategies.

    Also in 3 projects that use this

  • fefogarciaSkill

    dependency-audit

    Comprehensive dependency health auditing for JavaScript/TypeScript projects. Run npm audit, detect outdated packages, check for security advisories, and verify license compliance. Prioritises vulnerabilities by severity and provides actionable fix recommendations.

    Also in 4 projects that use this

  • Microsoft AzureSkill

    skill-authoring

    Write Agent Skills that comply with the agentskills.io specification. WHEN: "create a skill", "new skill", "write a skill", "skill template", "skill structure", "review skill", "skill PR", "skill compliance", "SKILL.md format", "skill frontmatter", "skill best practices". DO NOT USE FOR: general documentation. INVOKES: vally CLI.

    Also in 3 projects that use this

  • OpenAISkill

    test-driven-development

    Use when implementing any feature or bugfix, before writing implementation code

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 27 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before spec-writing finalizes scope for a sensitive feature

    line 22
  2. Distinctive:

    Trust boundaries are where it happens: Every place data crosses from less-trusted to more-trusted is a finding generator.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 27 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Threat Modeling

Find the attacks on paper, before the code exists. A security-audit reviews what was built; a threat model shapes what gets built.

When to use

  • Designing anything that touches auth, money, PII, file uploads, or external input
  • "How could this be abused?" / "Is this design secure?"
  • Adding a new integration, webhook, or API surface
  • Before spec-writing finalizes scope for a sensitive feature

Principles

  • Think like the attacker, list like an engineer. Creative in finding threats, systematic in recording them.
  • Trust boundaries are where it happens. Every place data crosses from less-trusted to more-trusted is a finding generator.
  • Rank ruthlessly. Ten mitigated critical threats beat a hundred documented trivial ones.
  • Assume breach of the outer layer. "The WAF catches that" is not a mitigation; defense has depth or it doesn't.

Process

1. Scope and assets

  • What are we protecting? (credentials, PII, money/credits, business data, availability, reputation)
  • Who are the realistic attackers? (anonymous internet, authenticated user, malicious insider, compromised dependency)

2. Draw the data flow

Sketch components and the data moving between them (text diagram is fine):

[Browser] --creds--> [API] --query--> [DB]
                       |--webhook--> [3rd party]

Mark every trust boundary: internet→app, app→db, app→third party, user→admin, tenant→tenant.

3. Walk STRIDE per boundary

CategoryAsk
SpoofingCan someone pretend to be another user/service here?
TamperingCan data be modified in transit or at rest?
RepudiationCan an actor deny an action because we can't prove it?
Information disclosureWhat leaks — errors, timing, IDs, logs, caches?
Denial of serviceWhat's cheap for an attacker and expensive for us?
Elevation of privilegePath from low-priv to high-priv? (IDOR, mass assignment, admin routes)

Also walk the abuse cases: how would a legitimate user cheat? (free-tier laundering, scraping, referral fraud)

4. Rank

Score each threat simply: likelihood (L/M/H) × impact (L/M/H). Anything H×H or H×M gets a mitigation in the design; M×M gets a mitigation or an explicit accepted-risk note; the rest is documented.

5. Mitigate in the design

For each ranked threat, name the concrete control: authz check at X, signed URLs, rate limit per Y, idempotency keys, audit log of Z, input validation at the boundary. Each mitigation should be traceable into the spec/tasks.

6. Decide residual risk

What remains unmitigated, who accepted it, and what would trigger revisiting.

Output format

## Threat model: <feature/system>

**Assets:** …
**Attackers considered:** …

### Data flow & trust boundaries
<diagram>

### Threats
| # | Threat (STRIDE) | Boundary | L×I | Mitigation | Status |
|---|-----------------|----------|-----|------------|--------|
| 1 | …               | …        | H×M | …          | in design / accepted |

### Accepted risks
- <risk>: accepted by <whom>, revisit when <trigger>

### Carry into spec
- [ ] <mitigation as requirement>

Anti-patterns

  • ❌ Threat modeling after the code is written (that's an audit, and rework is 10× pricier)
  • ❌ Only modeling external attackers — insiders and compromised accounts are boundaries too
  • ❌ "We use HTTPS" as the answer to everything
  • ❌ A 60-row threat table with no ranking and no owner
  • ❌ Mitigations that never become spec requirements or tasks — a model nobody builds from is theater
  • ❌ Forgetting abuse cases: the attacker with valid credentials and creative incentives

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.