Guardrails for Claude Code, built from your own rules.
Your company's rules reach Claude Code before every edit. What it must never do is blocked before it runs.
npx -y @cybedefend/vibedefend@latest installClaude Code is writing
billing/refund.ts
export async function refund(req: Request) { const { id, amount } = await req.json(); const invoice = await db.invoices.find({ id, tenant: req.tenant, }); if (amount > 500) await approvals.second(invoice); return payments.refund(invoice, amount); }
Every query is scoped to the tenant.
rules/data-access.mdRefunds above €500 need a second approver.
Approved once by Sofia M.Checked before the commit: clean
Set up in four steps.
- Run one commandIn any terminal, on macOS, Linux or Windows. Node 18.17 or later.
- Choose your region, sign inEU or US. Your browser opens to sign in, no key to paste.
- Tick Claude CodeThe installer finds the agents on your machine and ticks them for you.
- Code as usualOpen Claude Code: VibeDefend runs alongside it.
What VibeDefend adds to Claude Code.
Rules served
Your business and security rules reach Claude Code before each edit.
Claude Code is writing
src/billing/cart-checkout.ts
const total = new Decimal128(cart.sum); const rows = await db.query( "SELECT * FROM carts WHERE id = $1", [id] );
Monetary amounts use Decimal128, never Number.
Mined from src/billing.ts:14Parameterise every query that mixes user input.
OWASP Top 10Served before the edit
Secret guard
Raw secret reads are refused; Claude Code gets the managed reference instead.
Claude Code
webhooks.ts
cat .env | grep STRIPEBlocked: raw secret read
Instead
process.env.STRIPE_WEBHOOK_SECRETnpm test -- webhooksTests pass
Logged for the team
Action guard
Destructive commands, schema drops and protected paths are stopped before they run.
Claude Code
rm -rf dist/Allowed: build output
rm -rf .cache/Allowed: cache
rm -rf ./storage/uploadsBlocked: protected path, user uploads
Logged for the team
Live findings
SAST, SCA, secrets, IaC and CI/CD findings, live in the session.
Claude Code
SAST
src/db/users.repo.ts:42SQL injection
SCA
package.jsonlodash 4.17.20, CVE-2021-23337
Secrets
config/prod.ymlAWS access key
IaC
infra/main.tfS3 bucket public-read
CI/CD
.github/workflows/deploy.ymlpull_request_target
In the agent's context, live
Your questions.
Does VibeDefend change my Claude Code configuration?
~/.claude/settings.json, ~/.claude.json. Your own hooks stay: re-running the installer only replaces VibeDefend's entries.What leaves my machine?
Which version of Claude Code do I need?
Do I need to link each repository?
vibedefend link once. It writes .cybedefend/config.json with the project ID.How do I remove it?
vibedefend uninstall: it removes every file VibeDefend installed. If you installed the package globally, then run npm uninstall -g @cybedefend/vibedefend.Does Claude Code have guardrails of its own?
Technical details for Claude Code
- MCP server
- Available
claude mcp add --scope user - Rules before each edit
- Available
PreToolUseEdit|Write|MultiEdit|BashAlso before shell commands that write files: redirections, heredocs, tee, sed -i. Read-only commands fetch nothing. - Dangerous actions blocked
- Available
PreToolUse - Rules loaded at start
- Available
SessionStart - End-of-session review
- Available
Stop - Review of long sessions
- Available
PreCompact - Reminder on every prompt
- Available
UserPromptSubmit
What it writes for Claude Code
~/.claude/settings.json~/.claude.json
And the hook runner in ~/.cybedefend/. Your own hooks stay: re-running the installer only replaces VibeDefend's entries.
The MCP server is added at user scope, so every repository sees it, not only the one you installed from.
Only Claude Code gets a short reminder on every prompt: without it, a skill that starts on its own could take over before your rules arrive.
Something off? vibedefend status gives a read-only report, and vibedefend doctor repairs what it can.