Install
MCP alone vs. MCP + hooks
Connecting the MCP server by hand (the Cybe MCP flow) gives your agent a passive security backend: it can list findings, drill into a vulnerability, drive the status lifecycle and pull business-logic context — when you ask it to. VibeDefend adds the active layer on top. The hooks fire on the agent’s own lifecycle events, so security shows up without anyone prompting for it:| Moment | What VibeDefend does | Why it matters |
|---|---|---|
Before an edit (Edit / Write / MultiEdit) | Injects the business + security rules relevant to this change into the agent’s context. | The agent writes secure, on-policy code from the first line instead of being corrected afterwards. |
| On any tool call | Action Guards evaluate the call against your guard policy and hard-block on deny. | A rm -rf, a write to a protected path, or a fetch to a blocked host is stopped before it runs — not flagged after. |
| At session start | Loads the CybeDefend doctrine and opens the proposals inbox (Accept / Reject picker). | The agent starts every session knowing your rules, and you clear pending rule proposals up front. |
At session end (Stop) | Runs a gap analysis once the session crosses the edit threshold. | Surfaces the business rules you relied on but never wrote down, and proposes them for review. |
On long sessions (PreCompact) | Same gap analysis, fired before the context window is compacted. | Long sessions don’t lose their rule-gap review just because the transcript got summarised. |
| Per prompt (Claude Code) | A lightweight doctrine backstop on every user prompt. | Keeps the CybeDefend flow intact even when another skill auto-activates and would otherwise take over the turn. |
Supported agents
VibeDefend auto-detects and wires whichever of these you have installed. Unchecked agents stay untouched — re-runvibedefend install any time to toggle one on or off.
| Capability | Claude Code | Cursor | OpenAI Codex | Windsurf | VS Code Copilot |
|---|---|---|---|---|---|
| MCP server install | ✅ | ✅ | ✅ | ✅ | ✅ |
| Business + Security Rules (injected pre-edit) | ✅ | ✅ | ✅ | ⚠️ writes only | ✅ |
| Action Guards (hard block on deny) | ✅ all tools | ✅ all tools | ✅ all tools | ⚠️ writes + MCP fallback¹ | ❌ not yet wired |
| Session Start (loads doctrine + proposals inbox) | ✅ | ✅ | ✅ | ⚠️ proxied² | ✅ |
| Session Review (end-of-session gap analysis) | ✅ | ✅ | ✅ | ✅ | ✅ |
| PreCompact (long-session gap analysis) | ✅ | ✅ | ❌ no event | ❌ no event | ✅ |
| Doctrine backstop (per-prompt reminder) | ✅ | ❌ | ✱ via MCP³ | ❌ | ❌ |
| Min version | latest | ≥ 1.7 | latest | latest | ≥ 1.110 |
pre_write_code hook hard-blocks on file writes only. For non-write tool calls (Read / Bash / WebFetch) the installer drops a snippet into .windsurfrules instructing the agent to call cybe_guards_check via MCP before sensitive actions — soft enforcement that relies on the model following its rules file.
² Windsurf has no native SessionStart event. VibeDefend wires pre_user_prompt, which fires on every turn. The hook is idempotent and cheap (one GET to the proposals endpoint, returns “0 pending” once the inbox is empty), so the per-turn cost is negligible.
³ Codex follows the doctrine via the MCP server’s Server.instructions field on each session, which removes the need for a per-prompt reminder hook.
The install flow, step by step
vibedefend install walks you through four prompts and then signs you in.
Pick a region
cybedefend pointing at that region’s endpoint and wires the hooks to call the matching Gateway — you never type a URL. The two regions are independent CybeDefend tenants; sign in to the one that hosts your account (eu.cybedefend.com vs us.cybedefend.com).Pick which agents to wire
Tune the hook config
- Enable the session-end gap analysis? — default on. Without it, the gap analysis never runs.
- Edits threshold to trigger it? — default 3. Typos and one-line fixes won’t fire it; a real feature will. Lower to
1to fire on any session that had an edit, raise it if your team does frequent tiny commits in long sessions. - Enable automatic background updates? — default on. Hooks self-refresh so you never re-run install (see Keeping VibeDefend current).
- Enable auto-propose mode? — default off (not recommended). Off means rule proposals need an explicit chat-side “yes”. On means the agent drafts and pushes proposals without asking first — you still review them at the next session start.
Sign in
Link a project
After install, drop one tiny file at the root of each repo you want monitored — a.cybedefend/config.json with your project UUID:
CYBEDEFEND_PROJECT_ID environment variable.
Commands
vibedefend doctor takes --check for a dry-run (report only, change nothing) and --yes to apply every fix without the confirmation prompt. vibedefend login takes --force to re-authenticate even when credentials are already stored.
Keeping VibeDefend current
At install you’re asked “Enable automatic background updates? (recommended)”. Leave it on and you never update by hand: the SessionStart hook checks npm at most once a day and, when a newer version is published, upgrades@cybedefend/vibedefend in the background — the next session picks it up via the self-resolving runner shim. Opt out (or pin a version, or run in a locked-down environment) and you instead get a one-line nudge.
To update manually at any time:
vibedefend update --self upgrades only the binary, without touching hooks.)
Tunables
The gap-analysis threshold and auto-propose mode are chosen at install and stored in your VibeDefend config. To change them, re-runvibedefend install and answer the hook-config prompts again:
| Setting | What it controls |
|---|---|
| Review threshold | Edits before the session-end gap analysis fires (default 3; 1 fires on any session that had an edit). |
| Auto-propose | Whether the agent proposes rules without asking first (default off). |
| Variable | Effect |
|---|---|
CYBEDEFEND_PROJECT_ID | Override the project UUID from .cybedefend/config.json. |
Codex setup gotcha
Codex 0.131+ requires you to approve each hook from the/hooks panel inside Codex before it fires. After running vibedefend install, open Codex, run /hooks, and trust the cybedefend entries — until you do, the panel shows Installed N / Active 0 and the hooks stay dormant.
VibeDefend or the manual MCP setup?
Both connect your agent to the same CybeDefend tenant. The difference is how much of the platform comes along.| VibeDefend | Manual MCP setup | |
|---|---|---|
| Setup | One command, all detected agents at once | Edit each client’s config file by hand |
| MCP tools (read findings, triage, context) | ✅ | ✅ |
| Rules injected before each edit | ✅ | — |
| Action Guards (hard block) | ✅ | — |
| Session-end gap analysis | ✅ | — |
| Best for | Day-to-day coding where you want security in the loop automatically | Any MCP client VibeDefend doesn’t auto-wire (Continue, Cline, Zed, Claude Desktop…), or when you only want the read/triage tools |
Troubleshooting
Codex shows `Installed N / Active 0`
Codex shows `Installed N / Active 0`
/hooks, and trust the cybedefend entries.Hooks don't seem to run after install
Hooks don't seem to run after install
vibedefend status for a read-only report of region, wired agents and a live API check, then vibedefend doctor to diagnose and repair what’s fixable (vibedefend doctor --check reports without changing anything). Confirm the repo has a .cybedefend/config.json with a valid projectId — without a linked project the rule-fetch and gap-analysis hooks have nothing to call.It asked me to sign in even though Codex was already connected
It asked me to sign in even though Codex was already connected
aud: cybedefend-mcp) has limited Permify rights and can’t call the Gateway endpoints the runtime hooks use, which need a user token (aud: cybedefend-api). They aren’t interchangeable. One Logto sign-in (instant if your browser already has a dashboard session) issues the right token; the refresh token then persists for 14 days.I pin versions / run in a locked-down environment
I pin versions / run in a locked-down environment
vibedefend update.I'm on Windows
I'm on Windows