Claude Code plugin
The dagsec plugin puts dagsec between Claude Code and your package manager:
- Blocks risky installs. Before an install command runs, each package is checked. A package that doesn't exist (a hallucinated or typosquatted name), or a version with critical or high vulnerabilities, is stopped, and Claude is told which version to use instead.
- Answers "is this package safe?" Claude can check any package with the
check_packagetool: known vulnerabilities in a version, the release that fixes them, and a 0 to 100 health score. - Teaches Claude when to check. A skill tells Claude to check packages before adding them and how to act on the answer.
On Windows, macOS and Linux, one click
The desktop app sets this up for you, with your API key in the Windows credential store or macOS Keychain instead of a settings file.
Install
- Create an API key.
- In Claude Code:
/plugin marketplace add hasanerman/dagsec-claude
/plugin install dagsec@dagsec- Paste your API key when asked (it starts with
dgs_and is stored as a sensitive setting). - Choose the mode: block (default) stops a risky install and tells Claude why; warn asks you before it runs.
- Restart Claude Code, then run
/mcp.plugin:dagsec:dagsecshould be listed as connected. You only need to check this once; the plugin connects on its own every time Claude Code starts.
Changing the API key
After you revoke, rotate or replace the key:
- In Claude Code, open
/plugin, pick dagsec, then Configure options. - Select dagsec API key, paste the new key, press Enter, then choose Save configuration. Leaving without saving keeps the old key.
- Restart Claude Code. A running session keeps its old connection, so the new key only takes effect after a restart.
- Check
/mcpagain. If it says failed with HTTP 401, the key is wrong or revoked.
Commands the hook checks
On both the Bash and PowerShell tools:
| Package manager | Commands |
|---|---|
| npm | npm install, npm i, npm add |
| Yarn | yarn add |
| pnpm | pnpm add, pnpm install, pnpm i |
| Bun | bun add, bun install |
| pip | pip install, pip3 install, python -m pip install, python3 -m pip install |
| uv | uv add, uv pip install |
| Poetry, PDM | poetry add, pdm add |
| Cargo | cargo add |
| Go | go get, go install |
| .NET | dotnet add package |
Other commands are never sent to dagsec.
What the block looks like
dagsec blocked this install:
- lodash@4.17.4 has 4 critical/high vulnerabilities (CVE-2019-10744, CVE-2021-23337, …). Install lodash@4.18.0 or later instead.Claude then installs the recommended version, or asks you. Without a version in the command, the latest release is checked.
Rules
| Check | Personal (no team) | Team member |
|---|---|---|
| Vulnerabilities that stop an install | Critical and high | The team's setting: critical and high, critical only, or off |
| Packages that don't exist | Stopped | The team's setting |
| Blocked licenses | None | The team's list |
| Block or ask | The plugin's mode | The team's setting overrides the plugin |
See Teams.
Failure behaviour
A security check must not stop your work: if dagsec can't be reached, or a lookup fails, the install proceeds. This includes the MCP server not being connected (for example, after a key change without a restart): Claude Code shows MCP server 'plugin:dagsec:dagsec' not connected next to the command, and the install is not checked. Run /mcp to see the connection state. When your plan's monthly agent checks are used up, installs are no longer checked (they are not blocked). A team owner can turn on Also stop installs dagsec can't check to stop installs when a lookup fails or the checks are used up.
What is sent
Install commands and the package names and versions Claude checks. Your code, file contents and other commands never leave your machine. For team members, the attempted packages and the decision go to the team's audit log.