Skip to Content
AgentShield
Security

Authentication and Authorization

A security analysis of how AgentShield separates identity from authority for agents and humans, and the attacks each design choice closes.

This page looks at authentication and authorization from an attacker's point of view. For the mechanics, see Authentication and Authorization.

Two principals, two planes

AgentsHumans
PlaneGateway (/api/v1/runtime/*)Control plane (/api/v1/*)
CredentialEd25519 key, per-request signatureBearer session, 12 hours
Stored server-sidePublic key and fingerprintSHA-256 of the token; Argon2id password
Cross-plane useRefused by the control planeRefused by the gateway

Keeping the planes separate means compromising one credential type never grants the other plane's capabilities. A leaked agent seed cannot approve anything. A leaked admin session cannot sign tool calls.

Attacks on agent authentication

AttackWhy it fails
Forge a request for another agentRequires that agent's private key
Modify arguments of a captured requestThe signature covers the SHA-256 of the raw body
Replay a captured requestNonce reused within 130 s is rejected; older timestamps are outside the 60 s window
Enumerate agent idsUnknown ids and bad signatures return the same 401 authentication failed
Use a suspended or revoked agentAuthenticated, then denied and recorded with the status as reason
Present a human session to the gateway401 before any other processing

Attacks on human authentication

AttackMitigation
Steal a session token from the databaseOnly SHA-256 hashes are stored
Brute-force passwords offlineArgon2id hashes; 12-character minimum
Use a session after sign-out or disableSessions are revoked server-side on sign-out, password change, and disable
Abuse a temporary passwordIts session can only read itself, sign out, and change the password
Steal an invitation link from logsToken in the URL fragment, never sent to servers; SHA-256 stored; single use; 72-hour expiry
Probe invitation tokensEvery unknown, used, or expired token gets the same 404
CSRF against the consoleSameSite=Strict cookie; writes require a same-origin Origin or Sec-Fetch-Site: same-origin
Steal the bearer token in the browserThe dashboard never exposes it to client JavaScript; it lives in an HttpOnly cookie

Authorization: claims versus authority

The most important authorization rule in AgentShield is that nothing in an agent's request body grants anything:

{
  "agent_id": "…",                 // must equal the signer, else deny
  "organization_id": "…",          // claim, compared with the stored agent, else deny
  "operation": "payment.refund",   // the subject of evaluation, not a permission
  "arguments": { "approved": true } // just data; ignored by authorization
}

Authority comes only from:

  1. the key that verified the signature,
  2. the agent and organization rows loaded for that key, and
  3. the active policy versions for that organization and agent.

Authorization precedence as a security property

ADR 0004 fixes precedence as deny → approval → allow → default deny across both documents. This matters because:

  • An organization-wide deny cannot be overridden by a permissive agent policy, so a mistake in one agent's policy is contained.
  • An attacker with write access to only an agent policy cannot hide a grant for a globally denied action.
  • Document order is not a security property. Reordering a list never changes a decision.

Role separation for humans

RoleIntended use
ownerFull administration, including granting the owner role
adminAdministration except the owner role
operatorRegistering agents and watching activity
auditorRead-only access to audit, incidents, alerts, and evidence
approverDeciding held actions only

Nobody can change their own role or status. Only an owner can grant or change the owner role, and each organization keeps at least one active owner. The member rules are a pure function with unit tests, and owner rows are locked while they are checked.

Failure semantics

Every authorization error is a deny or an error response, never an allow:

FailureResult
Policy load errorRecorded deny: policy load failed
Invalid stored documentRecorded deny: policy evaluation failed
Database write error500 internal_error; transaction rolled back; nothing executes
Unknown outcome value from storageRejected by ParseOutcome; treated as an error

Was this page helpful?

On this page