threat-drift

threat-drift is a command for coding agents from threatcl/claude-plugin. It costs 13 tokens per session (1,639 once invoked), scanned A, original, MIT.

A diagnostic command that compares recent code changes with a documented Threatcl threat model. Threat-model drift means the code no longer matches concrete security claims in that model.

In plain words
What is it for?
Use it during pull-request or release review with a Git reference range, such as the current branch compared with main, to find concrete security-model mismatches.
Why use it?
It can reveal when implementation changes invalidate documented security assumptions, while avoiding invented findings when the model is too vague to check.

Command

Part of the threatcl-cloud plugin — 1 skill, 5 commands, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/threatcl/claude-plugin/threat-drift
Clone the repo
git clone --depth 1 https://github.com/threatcl/claude-plugin

Or install threatcl-cloud, the plugin that ships this one along with the rest of its 1 skill, 5 commands, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for threat-drift

README.md
[![agentmods](https://agentmods.dev/badge/commands/threatcl/claude-plugin/threat-drift.svg)](https://agentmods.dev/commands/threatcl/claude-plugin/threat-drift)
Your own site
<a href="https://agentmods.dev/commands/threatcl/claude-plugin/threat-drift"><img src="https://agentmods.dev/badge/commands/threatcl/claude-plugin/threat-drift.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,639 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.01639
Opus 5 $0.00006 $0.00820
Sonnet 5 $0.00003 $0.00328
Haiku 4.5 $0.00001 $0.00164

Measured 4d ago against content hash 72b3a6315306, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

threat-drift scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/threat-drift.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are checking whether recent code changes have drifted from the documented threat model. The argument $ARGUMENTS is a git ref range (e.g. main...HEAD, HEAD~5..HEAD, v1.2.0...HEAD). If empty, default to main...HEAD — the current branch vs main, which is the natural PR-review scope.

This is a diagnostic command, not a discovery command. You're checking the model's claims against current code reality, not suggesting new threats. (For "what threats apply to this code?" use /threat-for-code instead.)

When the model is too vague to drift

Drift detection requires the threat model to make falsifiable claims about the code — things like "passwords are hashed with BCrypt in auth.go", "the API gateway authenticates via JWT", "no PII flows to third_party Sentry". Models full of generic threats like "an attacker exploits the API" can't drift because they don't assert anything checkable.

If, after reading the model in step 2, you find it's almost entirely vague language with no concrete code references, no DFD, no information_asset blocks, and no third_party_dependency blocks — say so directly to the user and stop. Don't manufacture low-confidence drift findings. Suggest they enrich the model first (a DFD via data_flow_diagram_v2, named information assets, specific control implementations) and re-run.

1. Resolve the diff

git diff $ARGUMENTS --stat   # overview
git diff $ARGUMENTS          # full diff for analysis

If the range is invalid (branch doesn't exist, no common ancestor), tell the user and stop.

If the diff is enormous (hundreds of files), narrow to security-relevant paths first: auth, API handlers, data access, crypto, network, dependency manifests (go.mod, package.json, requirements.txt, etc.), config files, and anything matching paths the threat model explicitly references.

2. Load the threat model

Find the local .hcl threat model file — usually one or two at the repo root or under threatmodels/. Read it fully. Note:

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 129 lines · 13 tokens per session scan A 72b3a6315306

Subscribe to this mod's changes

threat-drift is a command published in the GitHub repository threatcl/claude-plugin (4 stars, last pushed 20d ago), licensed MIT. It adds 13 tokens to every session and 1,639 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.