Skip to Content
AgentShield
Fundamentals

Trust Boundaries

Where AgentShield draws its trust boundaries, which inputs are treated as claims, and which components are allowed to make which decisions.

A trust boundary is a line across which data must be verified before it is believed. AgentShield is built around a small number of explicit boundaries. Understanding them tells you what a compromised component can and cannot do.

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

Boundary 1: agent runtime → gateway

The agent process is untrusted. It runs a model that reads attacker-controllable content, so anything it sends is treated as a request, never as a fact.

Input from the agentHow the gateway treats it
Signature headersVerified against the registered public key
agent_id in the bodyMust equal the authenticated agent, or deny
organization_id in the bodyA claim. Compared with the stored organization, or deny
operation and resourceThe subject of policy evaluation, never a grant
argumentsHashed and redacted. Never stored raw. Must hash the same at execute
approval_id at executeLooked up and checked against the decision, payload hash, expiry, and decider
"This was already approved" in any formIgnored. Only a stored, approved, unexpired row counts

The gateway also refuses a human bearer token on its runtime routes, so a stolen session cannot be used to act as an agent.

Boundary 2: operator → control plane

Humans authenticate with a bearer session created by POST /api/v1/sessions. The control plane derives the organization from the session's membership. Like the gateway, it never accepts a client-supplied organization id as authority.

The control plane rejects any request to /api/ carrying X-AgentShield-Signature or X-AgentShield-Agent-Id, so an agent credential can never reach approval or management routes.

The dashboard adds its own layer: it holds the session in an HttpOnly, SameSite=Strict cookie, forwards only /api/v1/... paths, and refuses cross-origin writes. See Dashboard.

Boundary 3: gateway → external tools

Adapters are the only code that touches external systems. The http.request adapter treats both the destination and the response as untrusted:

  • Only hosts listed in the gateway's tools file are reachable, over HTTPS.
  • Resolved addresses on loopback, private, link-local, CGNAT, and other internal ranges are refused at connect time.
  • Redirects are returned, not followed.
  • Credentials are injected by the gateway; the agent cannot set Authorization, cookies, or Host.
  • Responses are size-capped, and Set-Cookie is dropped.

See SSRF protection.

Boundary 4: content → model

Tool results are data that someone else wrote. AgentShield cannot stop a model from reading them, but it can tell the model and the operator when the content looks like an instruction. The intelligence engine flags likely prompt injection, and the SDKs attach a warning that tells the model to treat the content as data.

This boundary is advisory. A finding never changes the authorization outcome.

Boundary 5: services → database

PostgreSQL is the source of truth for every decision. Two controls limit what the services themselves can do:

  • Row level security. In production, services connect as agentshield_app and set app.organization_id per transaction. Tenant tables are filtered by that setting.
  • Append-only triggers. Updates and deletes of security_events, audit_chain, policy_versions, and authorization_decisions are rejected.

The schema owner bypasses RLS and can disable triggers. That is why production refuses to start with an owner connection, and why audit head exports exist. See Auditability.

Who may decide what

DecisionMade byNever made by
Is this request authentic?Gateway, from the signatureRequest body fields
Is this action allowed?Policy engine, from stored policy versionsModel output, content analysis, the agent
May this held action run?A human owner, admin, or approverThe agent, or a user whose id equals the agent id
Did the tool run?Gateway execution recordAgent logs
Is this content suspicious?Intelligence engine (advice)— it decides nothing else

Was this page helpful?

On this page