Connectors

Connectors

Fourteen built-in connectors share one adapter interface while exposing connector-specific proxy, hook, policy, telemetry, and approval capabilities.

Connectors are the adapter layer between agent frameworks and DefenseClaw. They share one Go interface, but each connector advertises only the capabilities its agent actually exposes. Proxy routing, lifecycle hooks, custom policy callbacks, component discovery, CodeGuard, subprocess wrapping, native telemetry, and approval support therefore vary by connector.

Integration families

Proxy connectors

OpenClaw, ZeptoClaw. Model requests routed through the DefenseClaw proxy and their responses are inspected; OpenClaw classifies recognized provider/request shapes, while ZeptoClaw rewrites configured provider api_base values.

Hook connectors

Claude Code, Codex, Cursor, Windsurf, Gemini CLI, GitHub Copilot CLI, OpenHands, Antigravity, Hermes, OpenCode, Amp, OmniGent. DefenseClaw wires into the agent's native lifecycle hooks or policy API; the agent talks directly to its upstream.

Compatibility contracts

Versioned hook contracts, setup-time connector version checks, and the runtime hook_contract_lock.json.

One gateway, many hook connectors. A single DefenseClaw gateway can serve several hook connectors at once, each with its own guardrail posture under guardrail.connectors.<name> — pick Add (not Replace) when you run a second setup <connector>. Proxy connectors (OpenClaw, ZeptoClaw) bind a listener and own the traffic plane, so they can't be multi peers. See Multi-connector.

Pick yours

Capability summary

FamilyConnectorsData pathEnforcement boundary
ProxyOpenClaw, ZeptoClawDefenseClaw receives and forwards model trafficRequest/response policy in the proxy
HookClaude Code, Codex, Cursor, Windsurf, Gemini CLI, GitHub Copilot CLI, OpenHands, Antigravity, Hermes, OpenCodeAgent remains connected directly to its upstreamOnly the blocking events declared by that connector's selected hook contract
Custom policyOmniGentAgent remains connected directly to its upstreamSix in-process policy phases mapped to ALLOW, ASK, or DENY

Native ask is event-specific: Claude Code (PreToolUse), Cursor (beforeShellExecution, beforeMCPExecution), Copilot CLI (preToolUse), Antigravity (PreInvocation, PreToolUse), and OmniGent's three pre-action phases. Other confirmation verdicts use the connector's documented fallback. For exact version ranges, supported events, and script generations, see Connector Compatibility.

How a connector is structured

ConnectorSetup(ctx, opts)write hook scripts,back up agent files,register routes
ConnectorAuthenticate(r)verify gateway token
ConnectorRoute(r, body)extract upstream + model+ stream + headers
ConnectorTeardown(ctx, opts)restore agent files
ConnectorVerifyClean(opts)no residual artifacts
Every connector implements the same Go interface; individual methods may report that an agent does not support that capability.

The interface is defined in internal/gateway/connector/connector.go; each per-connector file (claudecode.go, codex.go, cursor.go via hook_only.go, ...) implements it.