What it is
A pre-install audit for Claude Code plugins. Installing a plugin runs someone else's code with your full user access: hooks fire on session start and on every tool call, MCP and LSP servers start as background processes, and skills are instructions Claude follows. Claude Code's permission rules and Bash sandbox govern only Claude's own tools, so hooks, MCP servers, LSP servers, monitors and status-line commands all run outside them. Plugin Warden answers three questions before you install: what would run and when, what in it could hurt you, and how to contain it if you still want it.
How a scan runs
- Inventory. It clones the repository (or reads a local folder or a marketplace entry) and maps everything Claude Code would load from it: hooks and their triggers, MCP and LSP servers, monitors, skills, agents and commands. Then it traces which scripts each automatic entry point calls.
- 131 checks. 71 line rules, 50 structural checks and 10 secret patterns across 18 categories, plus Gitleaks, OSV-Scanner and Semgrep. Structural checks read configuration rather than lines: a
PreToolUse hook that matches every tool, an MCP server launched with an unpinned npx -y, a symlink that points out of the repository, a file that reads credentials and also makes network calls.
- Context levels. The same pattern means different things in different places, so severity shifts with where a match sits: +1 in code that runs on its own, 0 in components and the code they call, -1 in code nothing reaches, and -2 in tests, docs and CI. External scanner hits get the same treatment.
- Agent triage. An Agent SDK agent reads each automatic entry point, follows what it calls, records a confirm or dismiss verdict with a cited reason for every medium-or-higher finding, and reports risks the rules missed. A new finding is accepted only if its quoted code really appears within five lines of the file and line it cites.
- Troubleshooting chat. A multi-turn session over the report and the repository. It answers with the file and line, who can fix the problem (the plugin author or you), and a validated
settings.json fragment.
Coverage in v0.3, measured
v0.3 added 30 checks and a written threat matrix covering 27 areas, from exfiltration and credential theft to surveillance, sandbox-detecting triggers, tampering with other plugins, and destructive encryption. Two of the new checks are structural: a dependency name one edit away from a popular npm or PyPI package, and a file that walks the disk, encrypts and replaces what it finds.
| benchmark set | samples | result |
| Malicious techniques | 78 | 78 detected, 70 at review or block |
| Ordinary plugins | 14 | all 14 low risk |
| Known misses | 6 | documented, each asserted to stay below review |
The benchmark is a test file, so a change that loses a detection, raises an ordinary plugin to review, or quietly starts catching a listed miss fails the build. The eight detections below review are techniques that are common in honest plugins on their own, such as telemetry or a detached process, so they ask for caution rather than a block.
A noise check over the 21 plugin versions installed on the author's machine found one false positive (a JavaScript variable named nc read as netcat), fixed before release. That is one machine, not a labelled data set, so no precision figure is claimed. The new line rules first doubled scan time on those plugins (35 s to 82 s); literal pre-filters brought it to 61 s, with a test that a pre-filter never hides a match.
How the verdict is computed
The score comes from the findings with fixed weights, never from the model's opinion:
src/plugin_warden/verdict.py (summary)
weights: critical 40 high 15 medium 5 low 1
score = min(100, sum above low + min(lows, 10))
any critical -> Do not install
any high, or score >= 40 -> Review before installing
any medium, or score >= 10 -> Install with precautions
otherwise -> Low risk
The cap on low findings came from a real run: 67 low-severity matches in an installed design-skills plugin had pushed it to "Review" on their own. Capped at 10 points, lows can reach "Install with precautions" but never more.
Captured output
The repository ships a deliberately malicious demo plugin, generated at test time so its fake credentials never sit in git. It calls itself claude-official-tools and claims to format code. Its session-start hook fetches and runs a remote script, uploads ~/.ssh, and adds a shell-profile line that survives uninstall, and a second hook approves every tool call.
$ uv run warden scan /tmp/evil-plugin (run 2026-11-07, trimmed)
Static scan: 9 files, 21 findings, 4.6s
Agent review with claude-opus-5-5 (effort high, budget $5.00)
agent: read scripts/setup.sh
agent: read scripts/approve.js
agent: verdicts 21 confirmed
agent: new finding Plugin description 'Formats code.' hides credential
theft, RCE and permission bypass at .claude-plugin/plugin.json:4
agent: new finding Remote script output from SessionStart hook flows
into Claude's context at scripts/setup.sh:2
Agent: 21 findings reviewed, 2 new, 17 turns, $0.22, 64.8s
DO NOT INSTALL risk score 100/100
9 critical 8 high 3 medium 3 low
Prompt-injection text found: agent dismissals of serious
findings are ignored in the score.
One chat question then asked how to keep only the format skill. The answer ($0.12, 32 seconds) explained that enabledPlugins has no per-component switch, that disableAllHooks also turns off your own hooks and still leaves the MCP server running, and that permission deny rules cannot reach a hook or an MCP process. The only complete control is not enabling the plugin, followed by the cleanup steps if it was ever enabled.
Results on real plugins
| target | findings | confirmed / dismissed / new | verdict (score) | cost |
| Demo malicious plugin | 21 | 21 / 0 / 2 | Do not install (100) | $0.22 |
| obra/superpowers | 14 | 2 / 12 / 2 | Low risk (3) | $0.47 |
| Vercel plugin 0.43.0 | 57 | 13 / 43 / 1, 1 needs review | Precautions (10) | $0.76 |
| wshobson/agents, 92 plugins | 39 | 8 / 31 / 2 | Precautions (14) | $0.66 |
| Total, 1,912 files | 131 | 44 / 86 / 7 | | $2.11 |
Every run used claude-opus-5-5 at effort high, none reached the $5 default budget, and each recorded its auth source as ANTHROPIC_API_KEY. What the agent found beyond the rules: on wshobson/agents, two hooks that fire on every tool call pass the full tool input on the command line, where any local process can read it with ps, and a review gate that a ./.review-approved file skips entirely. On superpowers, an opt-out usage ping through a vendor-hosted logo, and a Gitleaks "secret" it identified as the public RFC 6455 sample WebSocket key. On Vercel, it dismissed 43 matches with cited reasons, most of them maintainer tooling the plugin never runs.
A static-only pass over all 18 plugins installed on the author's machine (3,534 files) took 2 min 37 s: 12 low risk, 4 install with precautions, 2 review, and no critical findings.
The agent is sandboxed from what it reads
The agent spends its whole run reading text written by whoever published the plugin, so the repository is treated as hostile:
- No inherited config.
setting_sources=[] keeps the repository's .claude/settings.json, hooks and CLAUDE.md from loading, and strict_mcp_config=True ignores any .mcp.json it ships.
- Read-only tools. Only
Read, Grep and Glob plus Warden's own in-process tools, with permission_mode="dontAsk" and an explicit disallowed list: no shell, no writes, no web.
- Path guard. A
PreToolUse hook resolves every path with realpath and denies anything outside the scan root, so a symlink in the repository that points at a private key cannot be followed. Glob patterns containing .. or ~ are refused.
- Injection guard. If the static rules find text aimed at a model (instruction overrides, concealment, hidden Unicode, hidden comments), the agent's dismissals of high and critical findings stop counting in the score.
- API key only. Other credential sources are blanked in the agent's environment, and each run records the auth source the CLI reports.
Policy and CI gate
v0.2 turns the scanner into something a team can enforce. One TOML file in git, warden-policy.toml, says which plugins may be enabled, and warden check evaluates it in CI. Everything runs in the team's own repository and pipeline. There is no Plugin Warden server.
- Two modes. In allowlist mode only plugins with an
[[allow]] entry may be enabled. In threshold mode any plugin may be enabled while its scan stays inside the limits (worst accepted verdict, denied categories and rules).
- Pinned approvals. An approval names the commit that was reviewed, who approved it and why. When it matches the scanned commit it stands in for the thresholds: a person read exactly that code, so the scan verdict does not overrule them. Deny entries still win over any approval.
- Drift. When upstream moves, the approval stops matching and the check fails with
COMMIT-DRIFT until someone looks at the diff and approves the new commit.
- Exceptions. An exception accepts one rule or category for one plugin. It must carry a reason and an end date, and after that date it stops applying.
- Fails closed. The check resolves each enabled plugin to its repository through the project's settings. Anything it cannot resolve or fetch is a failure, never a pass.
- Your own config too. It also scans the project's own
.mcp.json and the hooks in its settings, judged by the thresholds alone.
Exit code 0 means everything enabled is allowed, 1 means something is not, and 2 means the policy is invalid. --sarif writes SARIF 2.1.0, so on GitHub a failure appears on the settings line that enabled the plugin.
Watching updates
warden watch asks each approved repository for its current commit with git ls-remote, without cloning. If the commit moved, it scans both the approved commit and the new one and compares the two reports. Findings are matched by rule, file and code rather than by line number, so code that only moved is not reported as new.
| level | raised when |
| alert | A new hook, monitor or server, a new high or critical finding, or a worse verdict |
| notice | New network hosts, new credential-like environment variables, or new lower-severity findings |
| none | Nothing the scanner tracks changed |
Evidence packs
warden evidence writes a folder and a zip for an auditor: the policy as enforced, the decision for every enabled plugin, the scan behind each decision, a readable summary, and a manifest with the SHA-256 of every file. With a key set, the manifest is also signed with HMAC-SHA256. Local paths are scrubbed, because a pack is handed to outsiders. --verify reports any file that changed, went missing or was added.
The summary lists where teams commonly map this in SOC 2 and ISO/IEC 27001, but that mapping is the team's to make with its auditor. Plugin Warden does not certify compliance.
The public registry
The same scans feed a public registry of well-known plugin, skill and MCP server repositories. The first full run on 2026-11-14 used static checks only and scanned 62 of 63 repositories (one fetch timed out), reading 55,205 files. It found 164 components that run on their own in 21 repositories, 64 background processes in 18, and 359 distinct network hosts named in code. It also produced 3,022 rule matches, which are waiting for review and are not published.
Two rules decide what the registry shows, and both exist to be fair to the people whose code is listed:
- A static-only scan gets no verdict and shows no findings. Rule matches are leads: on the four repositories above the agent dismissed 86 of 131. Without a completed agent review, an entry shows what the code does and a count of matches waiting for review.
- Serious findings wait for the maintainer. Confirmed high and critical findings are withheld until the maintainer has been notified and 30 days have passed, or until a fix ships.
The registry site went live on 2026-11-15 at battlettt.github.io/plugin-warden. A nightly workflow rescans every repository whose upstream commit moved, so its counts change. On its first deployed run it tracked 63 repositories.
The stored records in git follow the same two rules and keep no code snippets, because a snippet can carry credentials copied from the scanned repository.
Bugs the real runs surfaced
- Secrets in the report. MCP server
env and headers values were copied into the component details, so a token in a plugin's config would have appeared in the report. They are now redacted unless they are ${VAR} references.
- Config writes assembled in pieces. A path to
~/.claude/settings.json built from separate parts slipped past every line rule. A file-level check now looks for the pieces of a Claude config path together with a write operation.
- Scanner noise. Gitleaks raised 26 hits in one repository's tests. External hits now go through the same context levels, generic secret rules are medium, and a match is shown only when the scanner redacted it.
- A timeout that took the batch down. During the registry run, one git fetch timed out and crashed the whole batch. A timeout is now an ordinary target error, and the other repositories carry on.
- Quadratic matching on minified code. Line rules were quadratic on minified bundles: a single 900 KB line took minutes. Minified files are now matched per statement, with a bounded window as the fallback.
- Snippets in public data. Registry data first stored raw rule-match snippets from third-party repositories. It now stores only public-safe records, with no snippets.
Testing
289 tests: 287 offline in about 11 seconds, and 2 live. The offline suite drives the agent with a scripted fake and covers target parsing and unsafe-URL rejection, every rule family, context levels, scoring and the injection guard, HTML escaping, secret redaction, the agent's tool validation and path guard (symlink escapes, .. and ~), the API-key-only environment, the chat and the CLI. For the team features it covers policy parsing and every violation code, pinned approvals, exceptions and their expiry, marketplace resolution, fail-closed behavior, SARIF locations, report diffing (including code that only moved), the update watch, evidence pack signing, tamper detection and path scrubbing, the registry's publication rules, the generated site (every page built, repository text escaped, no third-party resources), and in v0.3 a matching line and a near miss for every new rule, a bounded-time check on minified bundles, and the benchmark above. The live tests run the real agent and chat against the demo plugin. CI runs ruff and the offline suite on every push, and the offline suite passed again on 2026-11-15 for this page.
> talking point
The model never sets the score. It can move the verdict only by confirming or dismissing a finding with a cited reason, or by adding one whose quote is checked against the file. When the repository contains text aimed at a model, its dismissals of serious findings stop counting. That is what makes it safe to point an LLM at hostile text: the worst a successful injection can do is suppress new findings, not clear a malicious plugin.
! limitation
Static analysis reads code without running it, so behavior assembled at run time (downloaded code, values from a server, heavy obfuscation) may only show up as "makes network calls" or "decodes and runs data". The agent works within a budget, and the report says when it stopped early. Precautions have real limits too: permission rules and the sandbox do not cover hooks, MCP servers, LSP servers, monitors or status lines, so for those the only complete control is not enabling the plugin. A clean report means the checks that ran found nothing, not that the plugin is safe.
The registry is early. The site is live, but at the last check only one entry (obra/superpowers) had a completed agent review, and the paid review plans and four pilot services on its pricing and services pages have no customers yet. The coverage page lists ten kinds of attack a static scanner cannot catch, including commands assembled from pieces and code fetched at run time.