Architecture
How KorClaw fits between agents, policies, and external systems.
Every governed action flows through identity resolution, policy evaluation, optional approval, runtime enforcement, and audit recording.
Request flow
Governed action flow
AI Agent
↓
KorClaw API (Bearer API key + optional agent key)
↓
Identity → Policy Evaluation → Approval Gate → Runtime Enforcement → Audit
↓
Target (HTTP endpoint or MCP server tool)Components
| Component | Role |
|---|---|
| Agent registry | Stores agent identity, environment, allowlists, and optional agent key |
| Policy engine | Evaluates rules against action context; returns allowed, blocked, or approval_required |
| Approval center | Creates and tracks human approval requests; approved contexts can be replayed for 15 minutes |
| Runtime proxy | Executes allowed HTTP requests and MCP tool calls after policy pass |
| MCP registry | Registers MCP server transport URLs per workspace; upstream URLs never appear in API requests |
| Audit log | Records every evaluation and execution with agent, action, resource, policy, and result |
| Webhooks | Delivers signed events (agent.created, policy.updated, audit.created, approval.completed, billing.updated) |
Workspace isolation
Every API key is scoped to one workspace. Agents, policies, MCP servers, audit logs, and approvals are isolated per workspace. Cross-workspace access is not possible through the API.