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.
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.
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 |
Other commands are never sent to dagsec.
What the block looks like
dagsec blocked this install:
- [email protected] has 4 critical/high vulnerabilities (CVE-2019-10744, CVE-2021-23337, …). Install [email protected] 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. When your plan's monthly agent checks are used up, installs are no longer checked (they are not blocked).
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.