Skip to content

Production Integration Patterns

Production deployments usually combine the Gateway, connectors, SDKs, revocation consumers, audit export, and policy automation. Keep the same authority model, then place enforcement where it best fits the system.

PatternUse whenPrimary guide
Gateway-routed HTTPYou can route traffic through Caracal before it reaches the upstream.Protect a Gateway-Routed HTTP API
In-process connectorThe resource server owns verification inside its framework.Protect an Express App, Protect a FastMCP App, Protect a Go net/http Service
MCP transportYou need framework-neutral MCP bearer verification.Protect an MCP Server
SDK transport injectionProvider SDK accepts custom fetch, transport, or HTTP client hooks.SDK guides
Batch or queue workerWork runs outside request/response but still needs scoped mandates.Run an Agent with caracal run
flowchart LR
  Agent["Agent runtime"] --> SDK["SDK"]
  SDK --> STS["STS"]
  STS --> OPA["Policy set"]
  SDK --> Gateway["Gateway"]
  Gateway --> API["HTTP upstream"]
  SDK --> Connector["In-process connector"]
  Connector --> MCP["MCP tools"]
  STS --> Audit["Audit ledger"]
  Gateway --> Audit
  Connector --> Audit
  Audit --> SIEM["SIEM / warehouse"]
  Control["Console / Admin API"] --> STS
  Control --> Gateway
AreaRequirement
ZonesSeparate production, staging, and customer trust boundaries.
KeysRotate zone signing keys and verify JWKS refresh behavior.
ProfilesGenerate runtime profiles through guided setup; keep secret files locked down.
RevocationUse shared revocation stores and stream consumers, not process-local memory.
PolicyValidate, simulate, version, activate, and audit policy-set changes.
AuditExport decisions and diagnostics to operational monitoring or SIEM.
Step-upRoute sensitive approvals through an external proof system or reviewer workflow.
  • For FastAPI or ASGI services, use the Python SDK context middleware for propagation and the MCP transport primitives for mandate verification.
  • For gRPC, carry Caracal headers or metadata through the gateway/client interceptor layer and verify mandates at the service edge.
  • For service mesh deployments, keep Caracal authority at the application layer; mesh identity does not replace resource scopes or policy decisions.
  • For provider SDKs, use the SDK transport() or language equivalent when the provider accepts a custom HTTP transport.

Run a successful request, a denied request, a revoked-session request, and a step-up request. Confirm each one has an audit trail and that operators can explain the final decision from the Console.