agentleFS
epicsagasepicsagas/epic-harness/skills/threat-model/SKILL.md

threat-model

Skill20 starsChanged 2 months agoApache-2.0View on GitHub

Threat modeling and attack surface analysis. Use when assessing security boundaries, modeling threat actors, or generating threat scenarios.

57 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use supply-chain-review, patch and 8 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.
  • MesteriisSkill

    supply-chain-review

    Reviews lockfiles, installers, provenance, CI permissions, dependency confusion, artifacts, registries, and publishing.

    Also in 3 projects that use this

  • AnthropicSkill

    patch

    Generate candidate fixes for verified security findings. Consumes

    Also in 4 projects that use this

  • mbwsimsSkill

    test-plan

    This skill should be used when the user asks to "plan tests", "what should I test", "what tests do I need", "test plan for", "testing strategy for", "test matrix for", "what cases should I cover", "help me plan tests", mentions "/test-plan", or wants to understand what tests are needed before writing any test code.

    Also in 3 projects that use this

  • Sagargupta16Skill

    dependency-audit

    Audit project dependencies for security vulnerabilities, licensing issues, maintenance health, and optimization opportunities. Use it during regular security audits (monthly or quarterly); before a major release when you want to ensure the dependency tree is clean; when evaluating whether to adopt or replace a dependency; after a security advisory affects one of your dependencies; when your install times or bundle sizes have grown noticeably.

    Also in 4 projects that use this

  • patrickserranoSkill

    performance-audit

    Audit and improve SwiftUI runtime performance. Use for requests to diagnose slow rendering, janky scrolling, high CPU/memory usage, excessive view updates, or layout thrash in SwiftUI apps.

    Also in 3 projects that use this

  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 6 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 51 edited versions we read keep these.

  • 3

    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. Distinctive:

    Every system has an attack surface.

    line 10
  2. Very specific:

    Check for .harness/engagement.md in the project root.

    line 16
  3. Distinctive:

    After producing the threat model, suggest:

    line 87
  4. Distinctive:

    No assumptions section — means assumptions are hidden, not absent

    line 112

“Common” is measured: kept by at least 6 in 10 of the 51 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 Model — Attack Surface Analysis

Iron Law

Every system has an attack surface. If you haven't identified it, you haven't secured it.

Process

Step 0: Load Engagement Context

Check for .harness/engagement.md in the project root. If present, load the scope (in-scope/out-of-scope) and constraints. Skip threat modeling for explicitly out-of-scope components.

Without engagement context, proceed with full-surface analysis.

Step 1: Identify Trust Boundaries

Map every boundary where data crosses a trust level:

  1. External → Internal: API endpoints, webhooks, file uploads, user input
  2. Internal → Privileged: DB queries, file system access, shell execution
  3. Service → Service: Inter-service communication, message queues, shared state
  4. Client → Server: Auth tokens, session state, CORS origins

For each boundary, document:

  • Data flow direction
  • Input validation present (yes/no/partial)
  • Authentication required (yes/no)
  • Encryption in transit (yes/no)

Step 2: Enumerate Threat Actors

ActorMotivationCapabilityTarget
Anonymous userExplorationLowPublic endpoints
Authenticated userData accessMediumOwn data + IDOR targets
Malicious insiderData exfiltrationHighAll internal systems
Compromised dependencySupply chainVariableBuild/deploy pipeline

Step 3: Generate Threat Scenarios

For each trust boundary × threat actor combination, generate:

  1. Attack vector: How the boundary is crossed maliciously
  2. Impact: What is compromised (CIA triad — Confidentiality, Integrity, Availability)
  3. Likelihood: High/Medium/Low based on exposure and complexity
  4. Existing mitigations: What already prevents this
  5. Gap: What is missing

Step 4: Produce Output

Write THREAT_MODEL.md:

# Threat Model — {project}

## Scope
- In-scope: {from engagement.md or full codebase}
- Out-of-scope: {from engagement.md or none}
- Date: {ISO date}

## Trust Boundaries
| # | Boundary | Direction | Validation | Auth | Encryption |
|---|----------|-----------|------------|------|------------|
| 1 | ... | ... | ... | ... | ... |

## Threat Scenarios
| ID | Boundary | Actor | Vector | Impact | Likelihood | Mitigated | Gap |
|----|----------|-------|--------|--------|------------|-----------|-----|
| T1 | ... | ... | ... | ... | ... | Partial | ... |

## Priority Remediation
1. [CRITICAL] {highest risk gap}
2. [HIGH] {next gap}
3. [MEDIUM] {remaining gaps}

## Assumptions
- {list all assumptions made during analysis}

Step 5: Feed into vuln-scan

After producing the threat model, suggest: "Run /vuln-scan to validate threat scenarios against the codebase."

Anti-Rationalization

ExcuseRebuttalWhat to do instead
"We don't have any external-facing components"Internal trust boundaries are attack surfaces too. Lateral movement starts inside.Model internal boundaries with the same rigor.
"Threat modeling is overkill for a small project"Small projects get breached too. The model is proportional to the codebase.Run the process. It takes 10 minutes. A breach takes months.
"We already have a threat model"Threat models expire. Every code change can invalidate assumptions.Update the model when significant changes land.
"The framework handles security"Frameworks don't model YOUR business logic threats.Add application-layer threat scenarios on top of framework defaults.

Evidence Required

  • Every trust boundary in the codebase identified
  • At least 2 threat scenarios per boundary
  • Each scenario has impact, likelihood, and gap assessment
  • Priority remediation list ordered by risk
  • Assumptions explicitly listed (not hidden)

Red Flags

  • Skipping boundaries because they're "internal"
  • Listing only one threat scenario per boundary
  • Marking all scenarios as "already mitigated" without evidence
  • No assumptions section — means assumptions are hidden, not absent
  • Threat model that doesn't reference actual code paths

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.