Skip to Content
AgentShield

Architecture Overview

A guided tour of AgentShield's processes, data stores, request paths, and the boundary between synchronous enforcement and asynchronous processing.

AgentShield separates a low-latency enforcement path from a slower management path, because they fail and change for different reasons. A dashboard deploy must never affect authorization, and policy evaluation must never wait on a network hop.

AgentShield system architectureAgents call the gateway through an SDK. The gateway verifies the signature, evaluates policy, and runs registered adapters against external tools. Operators use the dashboard, which calls the control plane. Committed events reach NATS JetStream and MinIO through the event relay.Untrusted: agent runtimeAgentShield trust boundaryExternalAgent processLLM + frameworkIntegrationLangGraph · LangChainSDK clientPython · TypeScriptEd25519 seed stays hereOperatorbrowserRuntime gateway (Go)identity · verifynonce · budgetspolicy · evaluateadapters · executesigns every requestIntelligence engineadvisory content analysisRedisnonces · limitsPostgreSQLsource of truthControl plane (NestJS)agents · policies · approvalsDashboard (Next.js)operations consoleEvent relay (Go)outbox → streamoutboxNATSJetStreamMinIOevidenceverified evidence readsHTTP APIsallow-listed hostsSubscribersyour consumershttp.request adaptersynchronous request pathasynchronous, after commit
Every component shown runs in the repository today. The agent runtime is outside the trust boundary.

Three paths

1. The enforcement path (synchronous)

Agent → SDK → gateway → PostgreSQL and Redis → adapter → external tool.

This is the path every tool call takes. The gateway links the policy engine and the identity library as Go packages, so evaluation never depends on another service being up. If PostgreSQL or Redis is unavailable, the gateway fails closed.

2. The management path (synchronous)

Operator → dashboard → control plane → PostgreSQL.

People sign in, register agents, edit policies, approve held calls, triage alerts, and read the audit chain. The dashboard never holds agent keys and never calls the gateway's enforcement routes.

3. The event path (asynchronous)

PostgreSQL event_outbox → event relay → NATS JetStream, MinIO.

Security events are written inside the transaction that made the change. A trigger queues each one in an outbox, and the relay publishes it after commit. Nothing on this path can slow down or alter a decision.

Ownership of data

Each table has one writer. Services share OpenAPI contracts and the signature specification, not an ORM or a database module.

WriterOwns
Control planeUsers, organizations, memberships, sessions, agents, credentials, policy documents, approval decisions, alert status
GatewayTool invocations, authorization decisions, executions, approval requests, incidents, alerts
Event relayOutbox acknowledgements, evidence object records, reliability metrics
PostgreSQL triggersAudit chain links and heads, outbox rows

infrastructure/docker/postgres/migrations/ is the schema source of truth. No application creates or alters tables at runtime.

Where to go next

Was this page helpful?

On this page