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: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.
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:
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.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