FireGuard

FireGuard Agent Hooks

Protect AI coding agents with FireGuard checks before prompts, commands, tools, and file access run.

FireGuard Agent Hooks bring FireGuard guardrails into AI coding agents. They inspect user prompts, shell commands, MCP/tool calls, file reads, and file writes before the agent acts, so unsafe requests can be blocked at the hook layer.

Use Agent Hooks when you want FireGuard protection inside developer tools such as Windsurf, Devin, Cursor, Claude Code, or Microsoft Copilot Studio.

The Agent Hooks source and installers are available at github.com/fireravenai/fireraven-agent-hooks.

What They Protect

ThreatCoverage
Secret leakagePrompts, file reads, MCP arguments, and shell commands can be checked before execution.
Dangerous executionCommand and tool gates can block risky actions before the agent runs them.
Data poisoningFile-write requests and supported output events can be checked or audited.

Supported Agents

AgentSetup pathBlocking behavior
Windsurf / DevinLocal hook installBlocks pre-hook events with exit code 2; audits supported post-hook events.
CursorLocal hook installReturns JSON {"permission": "deny"} for blocked input events.
Claude CodeLocal hook installBlocks PreToolUse events with exit code 2.
Microsoft Copilot StudioConnector topicsUses topic flow conditions to block or continue the dialog.

Quick Install

Install the default local agent integration:

curl -fsSL https://raw.githubusercontent.com/fireravenai/fireraven-agent-hooks/refs/heads/main/install.sh | sh

Install all supported local agent integrations:

curl -fsSL https://raw.githubusercontent.com/fireravenai/fireraven-agent-hooks/refs/heads/main/install.sh | sh -s -- --agent all

Install one specific local agent:

curl -fsSL https://raw.githubusercontent.com/fireravenai/fireraven-agent-hooks/refs/heads/main/install.sh | sh -s -- --agent cursor

For local development from a clone, use the fg helper:

./fg install --agent windsurf
./fg init
./fg doctor

Configure Credentials

Each installed hooks directory gets a config.env file. Add a FireGuard API key and project ID:

FIRERAVEN_GUARDRAILS_API_KEY=fg_...
FIRERAVEN_PROJECT_ID=00000000-0000-0000-0000-000000000000

Optional settings:

FIRERAVEN_API_URL=https://api.fireraven.ai
FIRERAVEN_EXECUTION_MODE=fast
FIRERAVEN_REQUEST_TIMEOUT_SEC=15
FIRERAVEN_FAIL_MODE=closed

FIRERAVEN_FAIL_MODE=closed blocks when the hook cannot reach FireGuard. Use open only when developer velocity should take priority over enforcement during transient API failures.

Runtime Flow

Agent Hooks reuse the same FireGuard API that your application integrations use:

The hook creates or reuses a FireGuard conversation through conversation_copilot, runs input_guardrails before the agent action, and runs output_guardrails for supported output-audit events.

Next Steps

On this page