Framework guides
How to route Claude Code permission requests into Contro1
Use the PermissionRequest hook to send risky Claude Code actions into Contro1 before allowing write, edit, or shell execution.
Claude Code is a useful example of runtime control because approvals happen at the exact tool boundary where risk becomes real.
Use the integration skill
Copy this skill link into your code agent to add Claude Managed Agents and Contro1 to your system.
Key takeaways
- PermissionRequest hooks intercept risky tools (Write, Edit, Bash) and route approval through Contro1.
- For managed agents, session_event_bridge.py turns requires_action events into Contro1 requests.
- Dead-letter exhausted retries instead of dropping them silently.
- The agent's system prompt still matters: tell it which categories of actions are ALWAYS gated.
When to reach for Contro1 with Claude Code
Claude Code is interesting because approvals happen where they matter most - at the tool boundary, right before the action touches your filesystem, shell, or code. That's "runtime control" as opposed to prompt-level guardrails.
You have two integration paths. The CLI tool uses PermissionRequest hooks. Managed Agents use the session event stream (requires_action) - we ship a ready-made bridge for that case.
Installation
Basic integration (CLI)
Basic integration (Managed Agents)
Case continuity
For Claude Code CLI, set CENTCOM_CORRELATION_ID to a stable session or project identifier so every tool approval in the same coding session appears in one case timeline. For managed agents, use session_id as correlation_id.
The request id stays tied to a single PermissionRequest or requires_action event; correlation_id ties the surrounding timeline together.
Logging autonomous actions
Use logAction for Claude Code actions that the hook auto-allows, such as read-only commands or safe inspections. This keeps a durable audit trail without interrupting the developer.
When the log describes a follow-up after a human answer, include in_reply_to with the Contro1 request id.
Gate the tool before it executes
The tool function itself is the right place to require approval for irreversible actions. The first line of a destructive tool calls Contro1 and blocks until an operator decides. Nothing runs until the human says yes - no prompt engineering needed.
For the Claude Code CLI, the PermissionRequest hook shown above is already the tool gate - it fires before every Write, Edit, and Bash command and blocks until Contro1 resolves. No extra code needed.
For tools in a Managed Agents server, add the approval call as the first line of any destructive function:
Pause the agent on system error - orchestrator level
The managed-agents session stream occasionally emits error events. Treat them like requires_action: map them to a Contro1 request so an on-call developer decides whether to cancel the session, restart it, or continue with a workaround.
Escalate tool errors to a human
If you ship your own tool implementations that Claude can call, wrap each tool so provider errors escalate to a human before returning to the model. This prevents the model from "trying to fix" an infrastructure problem it cannot fix.
Prompt engineering: force the agent to pause
Even with PermissionRequest hooks, you want Claude itself to know the rules. This block is designed for the model's system message - it frames approval as policy, not friction.
See our GitHub integration repo
Our managed-agents connector is the most battle-tested bridge in this doc set - it handles retries, dead-letter queues, and signature verification end to end.
centcom-claude-managed-agents on GitHub · session_event_bridge.py - production bridge · claude-managed-agents-connector.md - architectural guide
Frequently asked questions
Should I gate every Claude Code action?
No. Gate the actions that can change code, systems, or data in ways that matter to your organization. Read-only tools, searches, and plan-only steps should never be gated.
What is the difference between PermissionRequest hooks and the managed-agents bridge?
PermissionRequest is for the Claude Code CLI installed on a developer's machine. The managed-agents bridge is for cloud-hosted Anthropic agents consuming tools via the session event stream. Same approval semantics, different transport.
How does the managed-agents bridge handle retries?
Up to 4 attempts with exponential backoff on continuation failures. Exhausted failures move to a dead_letters table for manual replay rather than being dropped silently.
Can different matchers route to different approvers?
Yes. Multiple PermissionRequest hook blocks can specify different matchers and different commands, and each command can create Contro1 requests with different required_role values.
How do I audit every gated action later?
Every Contro1 request is stored with its question, context, operator, decision, and correlation metadata. You can export or stream them to your SIEM for long-term audit.