Skip to Content
AgentShield
Security

Threat Model

The assets AgentShield protects, the adversaries it considers, the threats it mitigates, and the assumptions it relies on.

This threat model describes the system as built in this repository. Each mitigation names the mechanism that implements it.

Assets

AssetWhy it matters
Side effects of tool callsRefunds, emails, record changes, outbound requests
Tool credentialsAPI tokens for systems behind adapters
Agent seedsAnyone holding one can sign as that agent
Policy documentsDefine what every agent may do
Approval decisionsRelease held actions
Audit trail and evidenceThe record of what happened, used for investigation and accountability
Tenant isolationOne organization's agents, data, and events must stay invisible to another

Adversaries

AdversaryCapability
Content attackerControls text an agent reads: web pages, tickets, API responses, retrieved memory. Cannot call AgentShield directly
Compromised agentControls the agent process, including its seed and the requests it signs
Network attackerObserves or modifies traffic between agent and gateway; may capture and replay requests
Malicious or careless insiderHas a control plane account with some role
Other tenantHas legitimate access to a different organization
Infrastructure attackerGains access to the database, object store, or host

Threats and mitigations

ThreatMitigationResidual risk
Injected content makes the agent call a dangerous toolPolicy decides from stored documents; default deny; deny precedence; approvals for sensitive actionsThe agent can still misuse allowed actions within its budget
Injected content makes the agent change a URL or argumentsFixed resources per tool; exact resource rules; arguments bound by hash at executeA tool without a fixed resource accepts any resource policy allows
Agent exfiltrates tool credentialsCredentials live in the gateway and are injected per host; agents cannot set Authorization, cookies, or HostData the tool returns is visible to the agent
Agent reaches internal services (SSRF)Host allow-list; post-DNS address checks; no redirects; proxy variables ignored; network policy repeats the checksAn allow-listed host is trusted to be what it claims
Stolen or captured request is replayedNonce reserved for 130 s; 60 s timestamp window; signature over the bodyA Redis data loss reopens replay within the 60 s window
Request modified in transitSignature over SHA-256 of the raw body—
Agent claims another organization or prior approvalBody claims ignored as authority; mismatches are denied—
Agent approves its own actionAgents cannot reach the control plane; approver id must differ from agent id; only the gateway creates approval rows—
Approval reused for a different callApproval bound to raw-body hash and decision; consumed once—
Retried execution repeats a side effectClaim before dispatch; failed or interrupted executions refusedAvailability: a retry needs a new authorization
Runaway agent loopsPer-agent request, tool, and token budgets; circuit breakerDamage within the budget window
Compromised agent seedRotate, suspend, or revoke; every call is attributed and auditedCalls made before detection succeed if policy allowed them
Insider edits policy to grant accessOwner/admin only; immutable versions; every decision records the version usedAuthorized admins can change policy
Insider quietly deletes audit recordsAppend-only triggers; hash chain; external head exportsA schema owner can disable triggers; detection relies on exported heads
Cross-tenant accessOrganization from authenticated principal; composite foreign keys; RLS for the app roleThe schema owner bypasses RLS
Evidence tamperingSHA-256 recorded in PostgreSQL; verified on every read; reads auditedDeletion is not prevented without object lock or versioning
Analyzer used to block serviceFindings are advisory; analysis fails open with a short timeout—
Metrics leak tenant activityNo tenant labels; fixed label sets; separate metrics portsPlatform totals are visible to the monitoring system

Assumptions

AgentShield's guarantees rely on these conditions. Violating one weakens the corresponding control.

  1. The gateway host is trusted. It holds tool credentials and database access.
  2. The database owner is trusted or external audit head exports are kept somewhere it cannot write.
  3. Production uses agentshield_app. The owner role bypasses row level security.
  4. Clocks are synchronized within the 60-second window.
  5. Redis is available and durable enough for the 130-second nonce window.
  6. TLS terminates in front of the gateway and control plane in any non-loopback deployment.
  7. Agent seeds are stored as secrets by agent operators.
  8. Metrics ports are reachable only from monitoring. They are unauthenticated by design.
  9. The network plugin enforces NetworkPolicy on Kubernetes.

Out of scope

  • Stopping prompt injection inside the model.
  • Proving content is safe.
  • Defending a compromised gateway host.
  • Tamper-proof logging against an adversary who controls the database and every external copy of the head.
  • Dependency and image vulnerability scanning in this repository's CI.

Was this page helpful?

On this page