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.
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.
| Writer | Owns |
|---|---|
| Control plane | Users, organizations, memberships, sessions, agents, credentials, policy documents, approval decisions, alert status |
| Gateway | Tool invocations, authorization decisions, executions, approval requests, incidents, alerts |
| Event relay | Outbox acknowledgements, evidence object records, reliability metrics |
| PostgreSQL triggers | Audit 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
System architecture
The detailed reference for every component.
Tool execution lifecycle
Authorize, claim, run, complete, analyze.
Event processing
Transactional outbox, JetStream, and evidence.
Deployment architecture
Containers, Kubernetes, and network policy.
Was this page helpful?