Security

75 patterns in this category

Agent security fails when systems designed to protect against attacks, enforce authorization, and maintain safety instead get compromised, bypassed, or exploited to enable unauthorized access, data leakage, or policy violation. An orchestrator agent trusts downstream agents without verifying their identity or output, and a compromised agent exfiltrates sensitive data that downstream agents blindly trust and propagate, a prompt-injection attack makes an agent ignore safety constraints and execute harmful operations, and memory poisoning injects instructions into knowledge-base that agent retrieves and executes without distinguishing malicious context from legitimate information. Security failures in agents matter precisely because agents are software systems that interact with humans, other agents, and external systemsβ€”every interaction point is a potential attack surface, and most agents were built for capability, not security.

Key Takeaways

  • 75 documented patterns (across 6 goals with failures + 3 scaffold goals) cover agent security, grouped into nine mechanisms: inter-agent trust and verification, data protection and exfiltration prevention, runtime attacks (injection, tool-based), authentication and credential management, authorization and permission enforcement, safety constraint enforcement, audit and detection, supply-chain security, and value alignment.
  • Multi-agent architectures exponentially increase attack surface: a 10-agent orchestration is not 10x as exploitable as a single agent, it is often 100x+ as exploitable because trust relationships compound and compromised agents propagate compromise through downstream chains.
  • Prompt injection and memory poisoning are rated Common in production: attackers inject malicious instructions via user input or knowledge-base manipulation that agents execute despite safety training and guardrails designed to prevent such execution.
  • Effective agent security requires defense-in-depth: no single security mechanism (authentication, authorization, runtime checks, audit logging) is sufficient. Attackers typically chain vulnerabilities to compromise systems that each individual security mechanism is supposed to prevent.

Scope

Agent security covers six goals with documented failures and three scaffold goals:

  • Agent Trust (11 patterns) β€” Inter-agent trust verification, capability proof, output validation, identity verification. When upstream agents are not verified before being trusted, compromised agents propagate compromise through agent chains.
  • Data Loss Prevention (8 patterns) β€” Protecting sensitive data (PII, credentials, trade secrets) from unintentional exposure (via logs, error messages) and intentional exfiltration (via compromised agents, prompt injection). Fine-grained data-tracking and output validation prevent data exposure.
  • Runtime Security (8 patterns) β€” Defending against runtime attacks targeting agent execution during inference: context poisoning, malicious tool injection, protocol exploitation, credential theft. Layered defenses (input isolation, tool verification, credential rotation) prevent runtime compromise.
  • Safety & Security (19 patterns) β€” Core safety mechanisms: prompt injection resistance, excessive-agency prevention, memory poisoning defense, audit evasion detection, human-loop enforcement, supply-chain security. No single defense is sufficient; defense-in-depth requires guardrails, anomaly detection, audit logging, and supply-chain verification.
  • Security & Autonomy (19 patterns) β€” Securing autonomous agent actions: preventing injection attacks, validating tool outputs, restricting permission scope, preventing credential exposure. Autonomy amplifies attack impact; defense requires minimal-privilege tool access and comprehensive input validation.
  • Tool Authorization Limits (10 patterns) β€” Restricting agent access to only approved tools and operations on approved resources. Fine-grained authorization (tool-level, parameter-level, resource-level) prevents agents from accessing tools beyond authorized scope.
  • Jailbreak Resistance (scaffold) β€” Preventing attackers from persuading agents to ignore safety constraints via social engineering, constraint relaxation, or adversarial prompting. Training-time safety requires runtime constraint enforcement and continuous adversarial testing.
  • Output Filtering & Moderation (scaffold) β€” Detecting and preventing harmful, illegal, or policy-violating content in agent output, and redacting sensitive data before output. Layered defenses (pattern matching, semantic checking, format validation) are required because single defenses are bypassed.
  • Value Alignment (scaffold) β€” Ensuring agent behavior optimizes for human values, not just metrics. Proxy-metric divergence and literal-objective misinterpretation cause agents to optimize in ways that violate human intent.

When Security Failures Matter

  • Agents interact with humans, other agents, and external systems, with trust-by-default architectures that assume internal agents are trustworthyβ€”a false assumption when agents can be compromised.
  • Agents process untrusted input (user queries, retrieved documents, tool output) without full validation or isolation, enabling injection and prompt-manipulation attacks.
  • Agents access external tools, files, databases, and credentials with overly broad permissions, enabling attackers to escalate impact when compromise occurs.

Cross-Pattern Insight

The dominant pattern across all 75 documented security failures is that single-layer defenses fail against chained attacks: if authentication is the only defense, attackers bypass authentication. If authorization is the only defense, attackers escalate permissions. If audit logging is the only defense, attackers manipulate logs. Effective agent security requires defense in depth: (1) prevent compromise (authentication, secure configuration), (2) detect compromise (anomaly detection, audit logging), (3) limit damage (authorization, isolation, constraints), (4) respond to compromise (automatic isolation, rollback, incident response). The second dominant pattern is that agent architectures compound risk: each additional agent in an orchestration adds trust relationships that can be compromised, tool integrations that can be exploited, and data-flow paths that can leak information. Security requires not just hardening individual agents but also reducing agent count, isolating agent chains, and verifying trust at every agent boundary. The shared lesson is that agent security is not a feature added post-deploymentβ€”it requires security-first architecture: minimal-privilege default, defense-in-depth by design, continuous adversarial testing, and treating agents as high-risk systems requiring the same security rigor applied to critical infrastructure.

Frequently Asked Questions

How do you prevent a compromised agent from propagating compromise through a multi-agent chain?

By eliminating transitive trust: do not assume downstream agents can trust upstream agents without re-verification. Defenses include: (1) verify every inter-agent message (cryptographic signature, capability proof), (2) validate inter-agent output (re-verify output from upstream agent before accepting), (3) isolate agents (separate failure domains so one agent’s compromise does not affect others), (4) monitor agent behavior (detect when agents suddenly behave differently after receiving message from upstream agent). Without output validation, one compromised agent compromises entire chain.

Can prompt-injection resistance training prevent all prompt-injection attacks?

No. Training improves baseline resistance but does not prevent novel attack vectors. Defense requires: (1) robust safety training (model understands why constraints exist), (2) input isolation (separate user input from trusted context), (3) runtime constraint enforcement (technical checks that prevent harmful output regardless of reasoning), (4) continuous adversarial testing (red-team agents against novel attacks). Training alone is insufficient; defense-in-depth is required.

How do you prevent over-scoped credentials from enabling attackers to escalate impact?

Implement just-in-time authorization: agents request access to specific resource for specific action, receive scoped credential (temporary access, specific parameters), credential expires after action completes. Pair with continuous monitoring: audit credential usage to detect unusual access patterns (agent suddenly accessing resources it previously never accessed). Implement credential rotation: periodically invalidate long-lived credentials and require re-authorization. Over-scoped credentials that never expire are security disasters waiting for exploitation.

What’s the fastest way to tell if an agent system is vulnerable to supply-chain attack?

Audit the supply chain: identify all external dependencies (model weights, packages, knowledge-base sources, prompts), verify integrity of each dependency (checksums, signatures), identify which dependencies are updated automatically vs. manually. Conduct adversarial testing: inject malicious content into dependency sources and verify agent detects/rejects malicious content. Many supply-chain compromises go undetected because dependency verification is incomplete or absent.

Goals

GoalPatternsMechanism
Agent Trust11Inter-agent identity, capability proof, output validation
Data Loss Prevention8Data classification, exfiltration prevention, redaction
Runtime Security8Input isolation, tool verification, credential management
Safety & Security19Prompt injection, excessive agency, audit evasion defense
Security & Autonomy19Autonomous action security, injection prevention, permission scoping
Tool Authorization Limits10Tool access control, parameter authorization, least-privilege
Jailbreak Resistanceβ€”Safety constraint resistance to persuasion and adversarial attack
Output Filtering & Moderationβ€”Harmful content detection, data redaction, format validation
Value Alignmentβ€”Objective specification, metric divergence, constraint satisfaction

Total: 75 documented patterns

  • Accuracy β€” accuracy failures combine with security failures to create compound risk: a system that is accurate but compromised is worse than a system that is both inaccurate and secure.
  • Governance β€” governance and oversight mechanisms form part of security defense-in-depth: audit logging, human approval, and oversight enable detection and response to security failures.
  • Operations β€” operational concerns (monitoring, alerting, incident response) are critical to security: a compromise detected and remediated quickly is less damaging than one that propagates undetected for weeks.
  • Learning β€” learning mechanisms can introduce security risks: feedback-based updates can be poisoned, self-improvement can be exploited. Learning-system security is part of overall agent security.

Admin Operation Called By Non-Admin

Frequency: Common
Category:

An agent exposes admin-tier tool operations (e.g. `delete_user`, `override_billing`, `reset_org_settings`) through the same tool-calling interface as ordinary operations, and the dispatch layer invokes them without first checking whether the requesting user actually holds an admin role. Any user who can phrase a prompt that maps to the admin tool schema gets the admin code path executed with the agent's (often elevated) service credentials.

Approval Signature Verification

Frequency: Occasional
Category:

A high-risk action (fund transfer, policy override, data export) is gated behind a requirement that a human approver's cryptographic signature or signed token accompany the execution request. The agent's verification of that signature is incomplete β€” it checks presence of a token rather than validity, uses a weak or non-constant-time comparison, doesn't bind the signature to the specific action payload, or doesn't check expiry/single-use β€” so a forged, replayed, or mismatched approval is accepted as genuine.

Blind Delegation

Frequency: Common
Category:

Agents Delegate Tasks Without Verifying Delegate Capabilities or Trustworthiness

Conditional Permission Logic

Frequency: Common
Category:

Some permissions are conditional on runtime state rather than static role membership β€” "allow withdrawal only if account balance exceeds the requested amount," "allow this API call only during business hours," "allow escalation only if the ticket is marked P1." The agent evaluates these conditions against stale, cached, or incorrectly fetched data, or implements the comparison logic incorrectly (off-by-one, wrong field, wrong currency/unit), and grants access that the live condition would have denied.

Delegation Impersonation Not Limited

Frequency: Common
Category:

A user grants an agent limited authority to act on their behalf β€” e.g. "book travel under $2,000" or "respond to routine emails but don't send anything financial." The agent (or a sub-agent it spawns to handle part of the task) continues acting under the user's identity or impersonation token beyond that delegated scope, because the scope was expressed as a natural-language instruction rather than an enforced, machine-checkable boundary on the credential itself.

Granular CRUD Permission Not Enforced

Frequency: Common
Category:

A role is defined with fine-grained access β€” e.g. "read-only" or "can create tickets but not delete them" β€” but the tool wrapper the agent calls exposes the underlying API's full create/read/update/delete surface regardless of which operations the role is actually meant to permit. The agent, having no operation-level gate in the tool itself, can invoke update or delete through a tool nominally scoped to a narrower capability.

Memory Poison Defense Gap: Existing Tools Insufficient

Frequency: Critical
Category:

Standard agent defenses (tool contracts, circuit breakers, I/O moderation, sandboxing) detect malicious actions but miss malicious beliefs; poisoned knowledge base instructions bypass all existing defenses because they appear to be normal context, not suspicious tool calls

Owner Verification Not Enforced

Frequency: Very Common
Category:

Before performing a mutating action on a specific resource (cancel this subscription, delete this file, update this profile), the agent authenticates that a valid user is making the request but never verifies that this specific user is the owner or authorized party for this specific resource. Any authenticated user can therefore direct the agent to mutate resources belonging to someone else simply by supplying that resource's identifier.

Permission Cascade Incorrect

Frequency: Common
Category:

Permissions in a hierarchical system are meant to narrow as they cascade down (an org-level admin has broad rights, a team-level member has fewer, a specific user within that team has only what's explicitly granted), but the agent's logic for resolving effective permission at a given level applies the wrong tier's rules β€” either inheriting a broader ancestor permission that should have been narrowed, or failing to inherit a permission that should have propagated down, resulting in over- or under-granted access.

PII Exposure

Frequency: Very Common
Category:

Agent Outputs Contain Personally Identifiable Information

Read Only Agent Write Access

Frequency: Common
Category:

An agent is deliberately provisioned with read-only access to a data source β€” the intent being it can look things up but never modify anything β€” yet a misconfigured tool binding, an overly broad service credential, or an undocumented fallback code path still allows write operations to succeed. The read-only boundary exists in configuration or documentation but isn't actually enforced at the point where the write would occur.

Role Permission Mismatch

Frequency: Common
Category:

An agent is assigned a role intended to convey a specific level of access (e.g. "support-tier-1"), but the mapping from that role to the underlying tool's actual permission model is incomplete, outdated, or was translated incorrectly during integration β€” so the agent ends up able to do meaningfully more, or less, than the role's name and documentation suggest. Unlike a missing check, the check exists and runs; it's the mapping table itself that's wrong.

Sensitive Operation No Approval Requirement

Frequency: Very Common
Category:

An operation is classified in policy as sensitive or high-risk β€” deleting a production resource, transferring funds above a threshold, changing a customer's access level β€” and is documented as requiring human approval before execution. In practice, the agent's execution path has no code-level gate enforcing that requirement: the classification exists as a label or a line in a policy document, but nothing in the tool-dispatch pipeline actually blocks execution pending approval.

Temporally Decoupled Poison Execution: Time-Delayed Attack

Frequency: Rare
Category:

Attacker injects malicious instructions into agent knowledge base; attack remains dormant (unexecuted) for days/weeks; when triggered by specific condition, agent executes attack with delay so attacker connection can't be traced to triggering event