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.
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 agent | How the gateway treats it |
|---|---|
| Signature headers | Verified against the registered public key |
agent_id in the body | Must equal the authenticated agent, or deny |
organization_id in the body | A claim. Compared with the stored organization, or deny |
operation and resource | The subject of policy evaluation, never a grant |
arguments | Hashed and redacted. Never stored raw. Must hash the same at execute |
approval_id at execute | Looked up and checked against the decision, payload hash, expiry, and decider |
| "This was already approved" in any form | Ignored. 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, orHost. - Responses are size-capped, and
Set-Cookieis 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_appand setapp.organization_idper transaction. Tenant tables are filtered by that setting. - Append-only triggers. Updates and deletes of
security_events,audit_chain,policy_versions, andauthorization_decisionsare 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
| Decision | Made by | Never made by |
|---|---|---|
| Is this request authentic? | Gateway, from the signature | Request body fields |
| Is this action allowed? | Policy engine, from stored policy versions | Model output, content analysis, the agent |
| May this held action run? | A human owner, admin, or approver | The agent, or a user whose id equals the agent id |
| Did the tool run? | Gateway execution record | Agent logs |
| Is this content suspicious? | Intelligence engine (advice) | — it decides nothing else |
Was this page helpful?