/threat-model:threat-model-surface <in-scope component families to read>from threat-model
Performs deep attack surface analysis for threat models: derives trust tables, contract matrices, side-effects inventory, reachability preconditions, and output taint from code. Read-only, timeboxed per component family.
Ships in threat-model. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Phase 3.3. The orient pass was minutes; this is hours, and that is expected. Three of the output's most valuable artifacts cannot be produced any other way:
MODEL-GAP
findings; andRead principles.md and the §1.5 / §1.7 / §1.8 specs in output-structure.md first.
contrib/, examples, or out-of-scope families beyond confirming
they are separable.security-critical property needs its
off-switches found by reading statements: the API call that relaxes a
check, the flag that removes one, the mode that trades it for speed. Cite each
as <file>:<line> at the statement that implements it. A comment describing
the function does not qualify — the check that matters may have no comment at
all, which is exactly why comment-harvesting misses it.
These are easy to walk past because they are not input operands: no
attacker-controlled parameter appears, so an input-shaped reading of the API
sees nothing. They are property switches. Grep for names built on validate,
undermine, relax, skip, permit, trust, unsafe, strict, and
sane, then read what each one assigns.grep -rn 'PATTERN' <file set> — N hits, all in X.
"I searched and found nothing" is not reviewable and has been wrong every
time it has been checked.package-info, manpage, and
README — a fact stated there is (documented, source), not inferred. Turning
a false-inferred into a true-documented row is pure accuracy and directly
reduces the escalation count.disclaimed with (documented, source), routing to §1.12, not as
unresolved. Reserve unresolved / inferred for dimensions where a
guarantee plausibly exists but you could not confirm it. Where you must
reason past the verifiable to a clear safe default, tag (assumption, QN)
rather than (inferred, QN).One row per direct parameter and each security-relevant indirect input of every public entry point:
| Function | Input operand | Attacker-controllable? | Control kind | Caller must enforce | Provenance |
|---|---|---|---|---|---|
gzopen | path | no — trusted caller string | data, resource-name | path sanitization | (documented, gzopen contract) |
gzread | file contents | yes | data, size | output buffer >= len | (inferred, Q4) |
gzprintf | format | no — trusted literal | x-format-string | never source from input | (inferred, Q5) |
For a network service, the first column is the route/endpoint or protocol
message (POST /v1/configuration, Handshake frame), and rows must cover
headers and connection metadata as well as bodies — header-presence checks
(X-Forwarded-*, auth tokens) are common false friends. Group rows by component
family if the table grows large. Prose is not sufficient: tool/AI findings are
reported against specific sinks, and the triager must look up the exact parameter.
Do not collapse all control into a boolean. Use one or more control kinds:
data, size/rate, type/class, callback/code, object-graph topology,
collaborator implementation, resource-name, serialized state, or a
project-specific x- kind. Distinguish an attacker choosing data passed
through a trusted callback from an attacker choosing the callback itself.
Also capture size/shape/rate assumptions (bounded? streaming? memory-mapped?), and flag any input whose magnitude drives resource allocation (memory, threads, file handles) — that feeds the §1.11 resource-property threshold.
For every in-scope component family, fill every applicable row. A blank cell is not allowed:
| Dimension | Status | Conditions / boundary | Routes to | Provenance |
|---|---|---|---|---|
| numeric domain and representational limits | claimed / disclaimed / N/A / unresolved | maximum size, overflow behavior, normalization domain | §1.11 / §1.12 / §1.18 | (inferred, QN) or cited documented/maintainer source |
| failure and exception atomicity | claimed / disclaimed / N/A / unresolved | state after validation or callback failure | §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| recursive or cyclic topology | claimed / disclaimed / N/A / unresolved | self-reference, graph depth, reentrancy | §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| callback and collaborator execution | claimed / disclaimed / N/A / unresolved | comparator, predicate, factory, virtual dispatch | §1.7 / §1.10 / §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| serialization and reconstruction | claimed / disclaimed / N/A / unresolved | restored types, callbacks, invariant rebuilding | §1.3 / §1.7 / §1.10 / §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| reference and object lifecycle | claimed / disclaimed / N/A / unresolved | weak/soft references, GC clearing, invalidation | §1.5 / §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| concurrency and reentrancy | claimed / disclaimed / N/A / unresolved | shared mutation, callback reentry | §1.5 / §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
| resource complexity | claimed / disclaimed / N/A / unresolved | CPU, heap, stack, I/O as a function of input/state | §1.7 / §1.11 / §1.12 / §1.18 | (inferred, QN) or cited source |
Add project-type rows when needed, such as Unicode/canonicalization,
probabilistic-result semantics, protocol state transitions, clock behavior, or
distributed consistency. The matrix is a contract inventory, not a bug list.
A demonstrably-absent guarantee is a disclaimed row with documented
provenance; only a dimension where a guarantee might exist stays unresolved
and becomes a proposed-answer question for the interview. A guarantee "might
exist" when the project has historically fixed reports of that class, or when a
documented guarantee already implies it — in that case narrow the claimed row
rather than disclaiming. Record the disclaimer's conditions and tier (see
§1.12): a disclaimer with no boundary is the one that over-closes, and the tier
is the worst impact of a report the disclaimer would close.
For stateful APIs, explicitly record the postcondition on failure: unchanged, partially committed, best-effort cleanup, or unspecified. Cover failures from validation, allocation, caller callbacks, and delegated collaborator methods.
Scan for what the project does to its host, then state the negative claims: does it open sockets? spawn processes? install signal handlers? read environment variables? write to stdout/stderr? touch global locale or FPU state? mutate process-wide state?
Tag these by how good your scan was, not by a default. A negative here says no such behaviour was observed; the project has not promised to keep it that way, so it is a §1.5 inventory row rather than a documented contract:
dlopen or another dynamic dispatch, an #ifdef
branch you did not read, or a dependency that could do it on the project's
behalf. Name the specific hole in the question, so the maintainer knows what
you could not see.Do not pre-label the whole inventory inferred before scanning. A negative you actually verified across the supported build is worth more to a triager than a blanket hedge, and the difference is exactly what the maintainer is being asked to ratify.
inflate.c is in-model only if reachable from the compressed input
bytes"). This is the first test a triager applies to a tool/AI hit.Hand back: the §1.7 table (with coverage note if partial), the completed
contract-dimension matrix, the §1.5 side-effects inventory, per-family §1.4
reachability preconditions, and §1.8 output-taint statements — each tagged with
its actual provenance. Mark code-derived contract hypotheses (inferred, QN) and
call out unresolved dimensions and wave-1/2 confirmation targets for
threat-model-interview.
What SKILL.md sets; muted values are Claude Code's defaults
8 skills in this plugin
/threat-modelProduce a threat model for a targeted open-source repository or package: its implicit security contract (assumptions, guarantees, disclaimed properties, and known misuses), not an audit, pentest, CVE list, or build-hygiene review. USE WHEN asked to produce, write, or generate a threat model, model the security contract, or explain which threats a library accepts. This orchestrator runs the canonical workflow, delegates to threat-model-* specialists, and publishes threat-model.md, threat-model.yaml, and threat-model.json (authority: prose > YAML > JSON). To classify a finding against an existing model, use threat-model-triage. DO NOT USE FOR bug hunting, code review, CVE enumeration, or supply-chain/SDLC hygiene.
/threat-model-authoringDraft phase 3.5 of a threat model from the orientation brief, surface analysis, and maintainer answers. USE WHEN writing threat-model.md to the canonical §1.1–§1.19 structure. Combines concise prose with the §1.7 trust table and contract matrix, §1.8 output statements, §1.17 disposition table, §1.1 triager quick-start, and any prior-policy back-map. Tags every non-trivial claim as documented, maintainer, or inferred; maps inferred claims to §1.18; and maintains confidence counts. DO NOT USE FOR: sidecar generation, backtesting, or triage.npx claudepluginhub alpha-omega-security/threat-model --plugin threat-modelOther plugins' skills for the same job