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 add an agent: it wires the agents you tick and leaves the others as they are, so unticking an agent there doesn’t remove it. To remove VibeDefend, run vibedefend uninstall (see Commands), which removes it from every agent it wired, then vibedefend install again for the agents you keep.
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 and OpenCode follow the doctrine via the MCP server’s Server.instructions field on each session, which removes the need for a per-prompt reminder hook.
⁴ Antigravity does not open the MCP sign-in on its own — see Antigravity sign-in below.
⁵ Antigravity has no channel to inject context into the model from its PreToolUse hook, so rules fetched before a write are held and delivered at the agent’s next model call (its PreInvocation event) — one step later than on the other agents, but before the agent acts on what it just read.
⁶ agy --dangerously-skip-permissions runs no hook at all, on any event. On Windows, a home path with a space in it is not supported: Antigravity cannot quote the hook command it runs, so the installer refuses to wire a command that could not start.
⁷ OpenCode can’t hand the agent text before a tool runs, so the rules fetched for an edit arrive with the edit’s result: the agent reads them right after the write, before its next step. A call whose tool failed gets none, and the retry fetches them again. When the agent edits through a shell command (its bash tool, shell on V2), the rules are fetched the same way.
⁸ OpenCode has no confirmation prompt for a tool call. A guard either blocks the call, in which case the agent reads the reason as the tool’s error and the call doesn’t run, or lets it through. Guards run on every tool call, MCP tools and sub-agents included. On V1, OpenCode’s --pure option (or OPENCODE_PURE=1) runs it without external plugins, so in that mode no rule lands and no guard runs. V2 has no such option. VibeDefend’s MCP proxy isn’t placed in front of OpenCode’s other MCP servers, so your organization’s MCP inventory and blocks don’t reach them.
⁹ opencode run ends as soon as its answer is complete, before the end-of-session review can run. On V1 the review therefore needs a session that stays open after the answer. On V2 it still runs in the background once opencode run has exited, and opencode run prints none of it.
¹⁰ VibeDefend wires the OpenCode it finds (the opencode or opencode2 command, or the desktop app). It was tested with OpenCode 1.19 and checked against OpenCode 2.2.1. After vibedefend install and vibedefend update, restart V1, which loads its plugins when it starts, and run opencode service restart on V2, whose running service does not load a plugin written while it runs: after a first install, no guard is active until then. V2 does not use V1’s sign-in, and vibedefend install cannot tell whether V2 is signed in: it lists opencode service restart, then opencode mcp auth cybedefend, under Next steps on every install. See OpenCode.
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.
.cybedefend/ is a directory here, the deprecated .cybedefend exclusion file cannot exist beside it — a path is either a file or a directory. Declare your SAST exclusions in .cybeignore at the repo root, or in .cybedefend/ignore next to config.json.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. vibedefend uninstall asks you to confirm first (--yes skips the question); it also signs you out of VibeDefend and deletes the ~/.cybedefend/ folder, keeping your own regions.json.
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.
Antigravity sign-in
VibeDefend registers the CybeDefend MCP server in~/.gemini/config/mcp_config.json, the file Antigravity 2.0, the Antigravity IDE and the agy CLI share. But Antigravity does not open the sign-in on its own, and agy has no login command VibeDefend could run for you (as it runs codex mcp login for Codex). Until you sign in once, cybedefend shows Unauthorized next to an Authenticate button and every Cybe tool call fails. The installer prints these steps under Next steps:
- Antigravity 2.0: open Customizations in the sidebar (in the Antigravity IDE: Antigravity User Settings → Customizations), then the Installed tab. Under MCP Servers, click Authenticate next to
cybedefendand finish the sign-in in your browser. A Sign out button replaces Authenticate once you are signed in. agyCLI: run/mcp, selectcybedefend, choose Authenticate, then open the URL it prints.
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.OpenCode shows no rules and no guards after install
OpenCode shows no rules and no guards after install
opencode service restart: its background service keeps running after you quit OpenCode, and it does not load a plugin written while it runs. Then run vibedefend status to confirm it is wired.OpenCode says the CybeDefend server needs authentication
OpenCode says the CybeDefend server needs authentication
opencode mcp auth cybedefend once: your browser opens on the CybeDefend sign-in page. If OpenCode reports again that the server needs authentication, run the command again. vibedefend install runs it for you when the opencode command is V1 and isn’t signed in to CybeDefend yet. It never runs it on V2, which doesn’t use V1’s sign-in: after moving from V1, sign in again. If V2 answers MCP server not found right after an install, run opencode service restart, then the command again.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