Windsurf
Windsurf connector wires Cascade hooks across pre_user_prompt, pre_read_code, pre_write_code, pre_run_command, and pre_mcp_tool_use.
The Windsurf connector wires DefenseClaw into Codeium's Cascade hooks so every prompt, code read, code write, command run, and MCP tool call is scored before it lands.
Setup
defenseclaw setup windsurfWindsurf setup is supported on macOS and Linux. The DefenseClaw connector is not certified on native Windows x64, so setup rejects it there.
setup windsurf is the dedicated Windsurf alias. It uses the shared guardrail
setup backend and wires hooks against ~/.codeium/windsurf/hooks.json.
DefenseClaw discovers existing MCP and rules surfaces but never auto-creates
workspace configuration. There is no proxy-enforcement path — blocking
happens hook-side via Cascade's pre_user_prompt, pre_read_code,
pre_write_code, pre_run_command, and pre_mcp_tool_use. Windsurf has no
native ask surface, so confirm verdicts use its non-pausing fallback with
raw_action preserved for audit.
What setup windsurf actually does
The table highlights convenience options rather than the complete alias
surface. The alias also accepts --mode, --rule-pack, --fail-mode,
approval, block-message, add/replace, workspace, and rule-pack-directory
options. See the quick-alias reference; use
full guardrail setup for scanner, detection-strategy,
and judge-provider configuration.
| Flag | Default | What it does |
|---|---|---|
--yes / -y | off | Skip the confirmation prompt. |
--restart / --no-restart | --restart | Bounce defenseclaw-gateway after applying changes so the new hooks wire in. |
--with-local-stack / --no-local-stack | --no-local-stack | Also run setup local-observability up; follow the command's printed gateway-restart step after it writes the export destination. |
The alias defaults Windsurf to observe mode and can join an existing hook-connector roster when you choose Add. To tune Windsurf after install, keep using defenseclaw setup guardrail --connector windsurf — see the variations below.
Common variations — pick the recipe that fits your phase
defenseclaw setup windsurfConfirms once, wires the hooks against ~/.codeium/windsurf/hooks.json, and restarts the gateway. Findings flow to mandatory SQLite event history and the TUI; configured v8 destinations receive only the buckets/signals their routes select. No traffic is intercepted and no requests are blocked. Pass --yes to skip the confirmation in CI.
defenseclaw setup windsurf --yes --with-local-stackSame as standard but also runs setup local-observability up so Prom/Loki/Tempo/Grafana come up locally for ad-hoc dashboards. That command writes the export destination after the alias has already restarted the gateway, so run its printed defenseclaw-gateway restart step before expecting exports. See Local observability.
export DEFENSECLAW_LLM_KEY='replace-with-your-key'
defenseclaw setup windsurf # base alias first
defenseclaw setup guardrail \
--connector windsurf \
--rule-pack strict \
--scanner-mode local \
--detection-strategy regex_judge \
--judge-model anthropic/claude-sonnet-4-20250514 \
--judge-api-key-env DEFENSECLAW_LLM_KEY \
--judge-hook-connectors windsurf \
--restartThe alias selects Windsurf; the follow-up setup guardrail --connector windsurf swaps in the strict rule pack, keeps scanning local, and turns the LLM judge on as a second-pass adjudicator on regex-flagged events. Configure the remote scanner separately through full guardrail setup, which validates its endpoint and API-key environment variable.
Windsurf has no proxy enforcement, but its pre-action hooks can enforce directly:
defenseclaw setup windsurf --mode actionWith mode=action, the five declared pre-hooks block when policy returns
block. A confirm verdict uses Windsurf's non-pausing fallback because the
agent has no native ask surface. Windsurf does not provide a fail-closed hook
transport surface, so --fail-mode closed cannot make an unavailable hook
block the agent.
Decision aids — should I turn this on?
Human-in-the-loop (HITL)
Per-connector ask matrix. Windsurf has no native ask; confirm uses an immediate fallback preserved in audit.
Full setup guardrail flag reference
The complete flag surface for `setup guardrail --connector windsurf`.
Defaults & rule packs
What permissive / default / strict actually ship, and which one matches your risk tolerance.
Interactive wizard
Animated terminal demo of the prompt-by-prompt setup flow — the safest path the first time.
Not sure what to pick? Run defenseclaw setup guardrail (no flags) — the interactive wizard walks you through every choice with safe defaults pre-selected and inline help. The Prompt → flag mapping table gives you the CI-shaped command for the same configuration.
Files DefenseClaw will modify
Hook capabilities
Block events
- pre_user_prompt
- pre_read_code
- pre_write_code
- pre_run_command
- pre_mcp_tool_use
Native ask events
None — confirm verdicts are downgraded with the raw action preserved.
Windsurf has no native human-approval surface. Confirm verdicts use an immediate fallback with raw_action preserved; operators can review them in the TUI or audit log, but cannot approve and resume them there.
Subprocess policy
none — Windsurf executes commands inside its own runtime; DefenseClaw observes via the pre_run_command hook rather than the openshell sandbox.
Disable
defenseclaw guardrail disable --connector windsurf --yesAntigravity
Antigravity (`agy`) connector registers all five 2.0 lifecycle hooks. PreInvocation and PreToolUse are ask-capable; PreInvocation, PreToolUse, and Stop are block-capable in the current contract.
ZeptoClaw
ZeptoClaw routes through DefenseClaw via api_base redirect plus response-scan. Full guardrail pipeline runs on every request.