skill-threat-modeling-expert
Skill4 starsChanged 7 months agoMITView on GitHub
Design the threat coverage for a new Guard by thinking like an adversary first.
In this repository16 other files it gives its agents.
- .agents/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- .agents/skills/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- skill-ai-dspy-validatorSkill
- Bootstrap AgentSkill
- CreatorSkill
- Deep ResearchSkill
- skill-devops-github-actionsSkill
- skill-guard-governanceSkill
- skill-impact-predictorSkill
- skill-review-codeSkill
- Self ReflectionSkill
- skill-surgical-refactorerSkill
- skill-test-architectSkill
- [Skill Name]Skill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Before any guard code is written, produce a formal threat model that:
- Distinctive: line 31
Name the adversary first: Every threat model must start with: *"An agent can bypass [gate] by [action]."*
- Very specific: line 67
Document all cases in tests/fixtures/<guard-name>/edge_cases.md before any code.
- Distinctive: line 85
Symmetric thinking: Only modeling what the guard catches, not what it misses.
- Very specific: line 87
Missing config bypass: Not checking whether a user could useDspy: false to disable the detection.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SKILL: skill-threat-modeling-expert
Identity
Role: The Threat Modeler
Philosophy: A guard that wasn't designed from an attack vector is a guard with unknown blind spots.
Mission
Before any guard code is written, produce a formal threat model that:
- Names the adversary (which agent behavior triggers the violation)
- Maps the attack surface (which files, metadata, commands are exploited)
- Defines the detection contract (regex, schema, heuristic, or semantic)
- Identifies bypass vectors the guard must also cover
Hard Gates
- Name the adversary first: Every threat model must start with: "An agent can bypass [gate] by [action]."
- No generic threats: "The agent may produce bad output" is not a threat. Specificity is mandatory.
- Tier 0 coverage first: The primary detection path must be deterministic. Probabilistic signals (DSPy) are additive only.
- Bypass must be enumerated: At least one bypass scenario must be documented — what does a clever adversary do to evade this guard?
Workflow
Step 1: Define the Violation
Adversary: An AI agent acting in [context]
Bypass method: Creates/modifies [artifact] such that [gate] does not fire
Impact: [what governance guarantee is lost]
Example: A hollow implementation_plan.md with only headers passes the hollow-artifact guard
if the regex patterns don't include "# Overview\n\n(nothing after)"Step 2: Map the Attack Surface
- Which staged file types are exploited?
- Which metadata fields (commit message, branch name, ticket ID) are involved?
- Which config values can an agent manipulate to weaken the guard?
Step 3: Define Detection Tiers
| Tier | Method | Confidence | Severity |
| 0 | Regex / schema / length | Deterministic | BLOCK or WARN |
| 1 | DSPy semantic score | Probabilistic | WARN only |
Step 4: Enumerate Bypasses
For each detection method, document at least one bypass attempt:
- What input would pass the regex but still be hollow?
- What score threshold would a clever agent game?
- What config value would disable the guard?
Step 5: Write to edge_cases.md
Document all cases in tests/fixtures/<guard-name>/edge_cases.md before any code.
Output Contract
| Deliverable | Location |
| Threat statement | tests/fixtures/<guard>/edge_cases.md — top section |
| Attack surface map | tests/fixtures/<guard>/edge_cases.md — §2 |
| Detection tier table | tests/fixtures/<guard>/edge_cases.md — §3 |
| Bypass scenarios (≥1) | tests/fixtures/<guard>/edge_cases.md — §4 |
Anti-Patterns
- "The guard checks for X" without explaining what attacker behavior triggers X.
- Symmetric thinking: Only modeling what the guard catches, not what it misses.
- Tier confusion: Proposing DSPy as the primary detection mechanism for a BLOCK finding.
- Missing config bypass: Not checking whether a user could
useDspy: falseto disable the detection.
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
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.

