ClaudeCodeMod

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.

In Claude Code
/plugin install guardrails-md --marketplace berget-ai/guardrails-md
Open the repo

It 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

The Claude Code section of the guardrails-md README on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • tool.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
Repo
berget-ai/guardrails-md
Version
0.7.0
License
MIT
Repo stars
9
Last change
2026-10-09
Language
TypeScript
Files
26

Other mods in Safety

pdpa-thaiBoom-VittHolds a commandRefuses a tool call that repeats a placeholder for Thai or other personal data it redacted before sending, and masks that data on screen.subagent-fenceerikdarlingdataHolds a commandRefuses a force-push, a push to a protected branch, a git command that skips hooks, and killing a process by name.launch-codesOneWave-AIHolds a commandHolds a dangerous shell command until you type a one-time code and press LAUNCH, and denies it otherwise.dogmaMarcel-BichHolds a commandRuns, asks about, or blocks git commands and deletes by your DOGMA-PERMISSIONS.md, always denies deleting a protected path, and draws the restricting rules.guard-packatretyak1985Holds a commandHolds file tools and shell moves that leave the project's roots, asks before a production deploy, and redacts secrets in a tool result before Claude reads it.supabase-guardSzotaszHolds a commandAsks before a Supabase write aimed at another project, or a destructive call, and stops the call when you refuse.secret-panebengousHolds a commandOpens a masked box beside the transcript when Claude needs a secret, gives Claude a placeholder, and puts the real value back only inside a Bash command.ultramodmertkayacsHolds a commandPacks ten mods: limits and context above the prompt, a guard with undo for rm -rf and git reset --hard, .env reads refused, and a receipt under each answer.envdavekissHolds a commandOpens a card when Claude needs a key, so you paste the value into a pane Claude can't read, and holds Claude's reads of .env files and commands that print them.model-allowlisterikdarlingdataHolds a commandRefuses a subagent spawn that pins a model id instead of a tier alias such as opus or sonnet, and holds spawns to model rules you write per agent type.ruflo-browserruvnetHolds a commandRefuses ruflo browser opens of file, javascript, data, or chrome URLs, credentialed or cloud-metadata hosts, unsafe Chrome flags, and cookie-reading scripts.ruflo-intelligenceruvnetHolds a commandRefuses a key, token, or password in what ruflo learns from, an email address in a public transfer, and a reset of ruflo's intelligence without confirm.
All 73 in Safety