Scan before you install: the Spellwarden plugin for Claude Code and Gemini CLI
Last updated 28 November 2026
The Spellwarden plugin lets you check an agent skill, a plugin, a marketplace, an extension or an MCP server before you install it. It teaches your coding agent to run the open-source Spellwarden scanner (Apache-2.0) on the content first, on your own machine, and to tell you what it found, so you can decide. The same repository, spellwarden-ai/agent-plugin, is a Claude Code plugin and a Gemini CLI extension.
The scanner checks skills, Claude Code plugins and marketplaces, hooks, MCP client configurations, instruction files such as AGENTS.md, CLAUDE.md and GEMINI.md, and A2A agent cards against its published rules, each mapped to the OWASP lists for agents and MCP. It reads files and never runs what it reads. A passed scan means that no rule found a problem. It does not prove that the content is safe.
Install the plugin
Claude Code
Run these two commands in Claude Code. The first adds the repository as a plugin marketplace, the second installs the plugin from it:
/plugin marketplace add spellwarden-ai/agent-plugin
/plugin install spellwarden@spellwardenGemini CLI
Run this command in a terminal:
gemini extensions install https://github.com/spellwarden-ai/agent-pluginCursor
The repository also holds a Cursor plugin with the same skill, submitted to the Cursor Marketplace. Once it is listed, open Customize, search for Spellwarden and select Install. Until then, copy it into Cursor's local plugin folder and reload the window (Developer: Reload Window):
git clone --depth 1 https://github.com/spellwarden-ai/agent-plugin
mkdir -p ~/.cursor/plugins/local
cp -r agent-plugin/plugins/spellwarden-cursor ~/.cursor/plugins/local/spellwardenIn Cursor you ask the agent in plain words, as in the examples below; the plugin adds no slash command and no hook there.
What you need on your machine
You also need uv or pipx. The plugin uses whichever is installed to run the scanner, uv first. If neither is installed, the agent tells you and stops: it does not install a tool without asking. Either one downloads the scanner from PyPI the first time it runs.
Use it
The agent uses the plugin's skill before something new is installed or enabled, and whenever you ask for a check of your agent setup. Ask it before an install, for example:
- "Check the skill in github.com/example/skills before I install it."
- "Scan this MCP server entry before you add it to .mcp.json."
- "Check the agent setup of this machine."
Or run a command directly:
| Agent | Command | What it does |
|---|---|---|
| Claude Code | /spellwarden:scan-before-install <target> | Scans a repository, a folder or an MCP server entry. |
| Gemini CLI | /spellwarden:scan <target> | The same. With no target, it scans the current workspace directory. |
| Gemini CLI | /spellwarden:workstation | Scans this machine's agent setup, with scan --user. |
In Claude Code, ask for a check of your agent setup in plain words, as in the third example above.
What the agent scans for each kind of target
The agent puts the content on your machine before anything is installed, in a new temporary directory, and deletes that directory afterwards:
- A skill, plugin, marketplace or extension in a git repository: the agent runs
git clone --depth 1of the address into the temporary directory and scans it. For a marketplace it scans the marketplace repository, and the scanner reads its plugins too. - A folder already on your machine: the agent scans the folder.
- An MCP server: the scanner reads MCP servers from a client configuration file, so the agent writes a scan copy into the temporary directory, a new file named
.mcp.jsonthat holds only the server entry you want to add. Your own configuration stays as it is. - This machine's agent setup: the agent runs
scan --user, which reads the configuration of Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Codex and Gemini CLI in your home directory, read-only. Scan a workstation says what that scan reads.
The agent runs the scanner only on what you are about to install, or on what you asked it to check.
Read the result
The scanner's exit code says what happened:
| Exit code | Meaning |
|---|---|
0 | No finding at or above high. |
1 | At least one finding at or above high. |
2 | The scan is incomplete: something could not be read, or the command was wrong. The agent treats it as not checked, never as a pass. |
The agent reports, in this order:
- The result in one line: passed, failed or incomplete.
- Each critical and high finding, with its rule id, title, file and line.
- The number of medium and low findings.
- The page of each rule, at
https://spellwarden.ai/docs/rules/<rule id in lower case>, which explains the finding and how to fix it. Scanner rules lists them all.
When a scan fails or is incomplete, the agent does not install. It asks you what to do, and installs only if you say so. When a scan passes, the agent says in one sentence that a pass does not prove the content is safe.
The agent treats the scanned content as data: it never follows instructions written in it, whatever they say.
The confirmation hook in Claude Code
In Claude Code, a second, optional plugin from the same marketplace, spellwarden-install-guard, adds a PreToolUse hook. Install it after the main plugin:
/plugin install spellwarden-install-guard@spellwardenThe hook asks you to confirm, and suggests a scan first, when Claude itself is about to:
- run
claude plugin install,claude plugin marketplace add,claude mcp add,claude mcp add-json,npx skills addorgemini extensions install; - edit or write a file named
.mcp.json, in any folder, except the skill's own scan copy inside a temporary directory namedspellwarden-scan-*.
The question you see reads:
Spellwarden: this installs agent content (a plugin, marketplace, skill or MCP server). Ask Claude to run /spellwarden:scan-before-install on it first, or approve if it is already checked.The hook is one shell script, hooks/ask-before-install.sh in the spellwarden-install-guard plugin, run with sh. It reads the tool call that Claude Code passes to it and runs nothing from it. When the call installs agent content or edits a .mcp.json file, it prints one fixed answer that asks you to confirm. Any other call gets no answer, so Claude Code goes on as usual. Claude Code gives the hook five seconds, and the hook is set to let the tool call continue if it fails.
Installs you type yourself, such as /plugin install, are not tool calls, so the hook does not see them. Gemini CLI gets the skill and the commands, not the hook. To turn the hook off, disable the spellwarden-install-guard plugin.
What it runs, sends and fetches
- The scanner.
uvx spellwarden==1.28.0, orpipx run --spec spellwarden==1.28.0 spellwarden. The first run downloads thespellwardenpackage and its dependencies from PyPI (pypi.organdfiles.pythonhosted.org). Run on your machine, the scanner sends nothing anywhere: its usage ping runs only in CI. - The content you asked to check. For a repository, the agent runs
git clone --depth 1of the address you gave into a temporary directory and deletes it afterwards. - A probe, only if you agree. For a remote MCP server, an entry with a
url, the agent offers--probe, which connects to that server's address without credentials to read its tool list and sign-in metadata. - Never by default.
--analyze, which sends content to a model endpoint you name, and--upload, which sends results to a Spellwarden organisation. The agent uses them only when you ask for them by name.
The main plugin holds no script that runs: the skill and the commands are text files that the agent reads. The optional spellwarden-install-guard plugin holds one script, the hook.
No account needed
The plugin stores no data and has no account, and you need no Spellwarden account to use it. The hosted Spellwarden product, with its dashboard and organisation rules, is separate and is not needed here. Get started with Spellwarden describes it.
The scanner version it runs
Plugin 1.6.0, released on 28 November 2026, runs the scanner spellwarden==1.28.0. The version is pinned on purpose: every scan the plugin starts uses that exact release, whatever is newest on PyPI. A newer scanner release reaches the plugin only when a plugin release names it, so the plugin can run an older release than the newest one.
To run the newest scanner yourself, in a terminal or in CI, see Open-source scanner, CI wrappers and Infra Pack.
Support
Report a problem with the plugin in the plugin repository's issues. Report a security problem privately, by email to hello.invalid [at] spellwarden [dot] ai, not in a public issue, as the repository's security policy asks. Say what you found, where, and how to reproduce it.
A rule that reports harmless content, or misses something it should find, belongs to the scanner, not the plugin: Report a miss or a false alarm says how to report it.