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
| Threat | Coverage |
|---|---|
| Secret leakage | Prompts, file reads, MCP arguments, and shell commands can be checked before execution. |
| Dangerous execution | Command and tool gates can block risky actions before the agent runs them. |
| Data poisoning | File-write requests and supported output events can be checked or audited. |
Supported Agents
| Agent | Setup path | Blocking behavior |
|---|---|---|
| Windsurf / Devin | Local hook install | Blocks pre-hook events with exit code 2; audits supported post-hook events. |
| Cursor | Local hook install | Returns JSON {"permission": "deny"} for blocked input events. |
| Claude Code | Local hook install | Blocks PreToolUse events with exit code 2. |
| Microsoft Copilot Studio | Connector topics | Uses 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 | shInstall all supported local agent integrations:
curl -fsSL https://raw.githubusercontent.com/fireravenai/fireraven-agent-hooks/refs/heads/main/install.sh | sh -s -- --agent allInstall one specific local agent:
curl -fsSL https://raw.githubusercontent.com/fireravenai/fireraven-agent-hooks/refs/heads/main/install.sh | sh -s -- --agent cursorFor local development from a clone, use the fg helper:
./fg install --agent windsurf
./fg init
./fg doctorConfigure 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-000000000000Optional settings:
FIRERAVEN_API_URL=https://api.fireraven.ai
FIRERAVEN_EXECUTION_MODE=fast
FIRERAVEN_REQUEST_TIMEOUT_SEC=15
FIRERAVEN_FAIL_MODE=closedFIRERAVEN_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
Local agent setup
Configure Windsurf, Devin, Cursor, and Claude Code hooks.
Copilot Studio setup
Import connector topics for Microsoft Copilot Studio.
Agent Hooks GitHub repository
View installers, local agent adapters, and Copilot topic templates.
FireGuard project configuration
Configure policies, security guardrails, topics, and execution mode.
Input guardrails API
Inspect the API used by the hooks before agent actions run.