Skip to Content
AgentShield
Security

Security Architecture

How security controls are layered across processes, data stores, containers, and the network, and how each layer fails.

AgentShield's security architecture is a set of independent layers. Each layer assumes the others may fail and is designed to fail closed on its own.

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 adapter

Layer 1: Identity and transport

  • Agents sign each request with Ed25519 over the raw body. See Request integrity.
  • Humans use 12-hour bearer sessions stored as SHA-256 hashes, behind a dashboard that keeps the token in an HttpOnly, SameSite=Strict cookie.
  • Service to service: the gateway authenticates to the analyzer with a shared token (required in production) and requires HTTPS for a non-loopback analyzer. The relay requires tls:// NATS and TLS object storage for non-loopback endpoints in production.
  • Separation of credentials: agent signatures are refused on the control plane; bearer sessions are refused on the gateway.

Layer 2: Authorization

  • A deterministic evaluator linked into the gateway: deny precedence, default deny, exact resource rules.
  • Body claims about organization, identity, or approval are never authority.
  • Role guards on every control plane route; the organization comes from the session's membership.

Layer 3: Execution control

  • Only registered adapters run, by tool name and operation.
  • Arguments are bound by canonical hash; the adapter validates before anything is claimed.
  • Execution is claimed in the database before dispatch and never repeated.
  • Deadlines, response caps, and circuit breakers bound each run.

Layer 4: Egress control

  • Host allow-list in the gateway's tools file.
  • Address checks on the resolved IP immediately before connecting.
  • No redirects, no proxies, injected credentials, filtered response headers.
  • On Kubernetes, the gateway's egress policy excludes private and link-local ranges as a second, independent check.

Layer 5: Data protection

ControlImplementation
RedactionCredential-like keys replaced with [REDACTED] before storage or logging
No raw argumentsOnly redacted canonical JSON and its hash
Hashed secretsArgon2id passwords; SHA-256 session and invitation tokens
No private keysNo column for agent private key material
Tenant isolationComposite foreign keys; RLS with app.organization_id for agentshield_app
Append-onlyTriggers on events, chain, policy versions, decisions

Layer 6: Detection and evidence

  • Behavioral incidents for oversized arguments and deny bursts.
  • Advisory content analysis for prompt injection and secrets.
  • Hash-chained audit events, exported heads, and hash-verified evidence bundles.

Layer 7: Platform hardening

EnvironmentControls
ContainersNon-root users, read-only root filesystems, no-new-privileges, all capabilities dropped, digest-pinned bases, distroless Go images
ComposeEvery published port bound to 127.0.0.1; metrics ports not published
KubernetesRestricted Pod Security Standard; no service account tokens; default-deny NetworkPolicy in both directions; analyzer isolated to the gateway
Supply chainRelease images signed with cosign keyless signing bound to the release workflow; SBOM and provenance attached; third-party actions pinned to commits

HTTP hardening

Both the gateway and the control plane set X-Content-Type-Options: nosniff, X-Frame-Options: DENY, Referrer-Policy: no-referrer, and Cache-Control: no-store on every response. Error messages never include stack traces, SQL, or secret values. The gateway sets read, write, and header timeouts and a 1 MiB header limit.

Failure modes

FailureBehavior
PostgreSQL unavailableGateway and control plane readiness 503; no decisions; no allow
Redis unavailableGateway readiness 503; authentication and budgets fail with 500
Policy document invalidDeny with policy evaluation failed
Analyzer unavailableanalysis: unavailable; the call completes
Relay stoppedOutbox grows; readiness reports backlog; no events lost
Adapter failingCircuit opens after five failures; executions fail closed
Crash during executionExecution stays claimed; retry refused

Was this page helpful?

On this page