All shelves / Mods / Safety
guardrails-md
By berget-ai
guardrails-md is a Claude Code safety mod by berget-ai.
Sends each Bash command to a Berget AI scoring model and blocks it when the score says it destroys data, leaks a secret, or breaks your GUARDRAILS.md.
DrawsHolds a command
Install
The marketplace name is guardrails-md.
/plugin install guardrails-md --marketplace berget-ai/guardrails-mdIt runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.
- Version
- 0.7.0
- License
- MIT
- Repo stars
- 9
- Last change
- 2026-10-09
What it can reach
- Draws in the session
- Holds a command
- Reaches the network or an outside service
Checked on Claude Code 2.1.291. Hooks are early access. Answer y to add the marketplace, then pick a scope. Claude Code has no Berget seat token. Set BERGET_API_KEY, or TYPESAFE_API_KEY, and restart. Keys come from berget.ai. The README says the free tier includes 5 euro of credit and a gate call is small. With no key the gate stays inactive and a toast warns you at session start. With a key, every Bash command is scored before it runs, including git status and ls. The command text goes to https://api.berget.ai by default, model berget/bev. Set BERGET_BASE_URL to send it to your own System One endpoint instead. The README says to do that if you want the commands kept in-house, and that Berget has a zero data retention policy and does not store the command. Up to three existing files named by the command are read and judged with it, 4 kB each. A score above the line blocks the command and tells the agent why. The line defaults to 0.7. Destructive and credential scores are not waived by a line in GUARDRAILS.md. A policy exception has to name the command. The README says the model scores a command in about 100 ms, that berget/bev is around 96 percent on its held-out sets, and that it will sometimes block a safe command or let a risky one through. Adversarial commands in that table sit at 74 percent. The README says this is one layer, not a sandbox, and it does not decode an encoded payload. If the endpoint cannot be reached, the command is blocked. The README describes a session switch that turns the gate off, and another that lets a command run when the endpoint is unreachable. Edit, Write, and NotebookEdit refuse GUARDRAILS.md, .claude/settings.json, .claude/settings.local.json, .github/workflows/, and the other paths in the README's list. The README says those refusals make no model call. PowerShell is not gated. Each block doubles the wait before the next command is judged. The policy is read once at session start, the first 2000 characters, so restart after you edit GUARDRAILS.md. /compact and /clear do not re-read it. Claude Code's audit log is not supported.
The install line has no @suffix. The marketplace name is guardrails-md. guardrails-lite holds a read of a secret .env, a git force-push, and a recursive rm, by pattern, on Read, Grep, Glob, and Bash. arasovic-guardrails holds Cloudflare write commands, attribution lines in commits and pull requests, and branch names that start with claude/. This one sends each Bash command to a Berget decision model and blocks on the score, and the edit tools refuse GUARDRAILS.md and the settings paths. The command text goes to api.berget.ai unless BERGET_BASE_URL names another endpoint. The toast is the draw, and only when no key is set.
Demo

What it hooks into
session.startWhen a session startstool.callAround a tool call, where it can hold oneBashMonitorEditWriteNotebookEdit
Read from the on() calls in its hook modules. Open its source under Files to check what each one does.
Files
The author's README and source, 4 files. They load when you open them.
Facts
- Author
- berget-ai
- Category
- Safety
- Marketplace
- guardrails-md
- Version
- 0.7.0
- License
- MIT
- Repo stars
- 9
- Last change
- 2026-10-09
- Language
- TypeScript
- Files
- 26