Attack Surface Manual · 1378 Patterns · 116 Categories · Open Source

AI Agent Attack Surface Manual

AI agent attacks are not one thing. They show up as prompt injection, tool-handoff abuse, callback drift, memory poisoning, scope redefinition, outbound control, and dozens of other workflow failures. This manual groups those patterns by attack family so operators can understand the shape of the problem before it becomes unsafe action.

Sunglasses uses this page to explain a simple truth: the dangerous moment is often not the first prompt. It is the later workflow step where a tool result, callback, redirect, memory artifact, package endpoint, or state sync quietly gains authority over the next action.

1378
Detection patterns
116
Attack categories
10
Authored chapters
74
Additional categories

Why this page exists

Most attack catalogs tell you that patterns exist. This page is here to show how those patterns cluster into the real trust failures teams hit when they deploy AI agents. A flat list can help a machine. Operators need more. They need to know what kind of attack they are looking at, why it matters specifically for agents, and what it looks like when a normal workflow quietly starts behaving like a compromised one.

How to use this manual

Open the chapter that matches the attack family you are investigating. Each chapter is its own page with authored prose, the surfaces it shows up on, and every matching Sunglasses detection pattern with a scoped search. Start with the family, then drill into the specific variants.

Attack Family Chapters

10 authored chapters grouping 1378 patterns by attack family. Each chapter is its own page.


Additional Indexed Categories

74 categories not yet assigned to a chapter. Compact index only — these categories have no dedicated page.

Model Routing Confusionmodel_routing_confusion28
Sandbox Escapesandbox_escape19
Structured Metadata Poisoningstructured_metadata_poisoning18
Command Injectioncommand_injection16
Api Descriptor Poisoningapi_descriptor_poisoning14
Build Metadata Poisoningbuild_metadata_poisoning10
Cicd Metadata Poisoningcicd_metadata_poisoning10
Delegation Bridge State Launderingdelegation_bridge_state_laundering10
Path Traversalpath_traversal10
Token Smugglingtoken_smuggling9
Retrieval Provenance Decay Authority Launderingretrieval_provenance_decay_authority_laundering8
Supply Chain Attestation Poisoningsupply_chain_attestation_poisoning8
Repo Metadata Poisoningrepo_metadata_poisoning6
Representation Parser Differentialrepresentation_parser_differential6
Agent Persona Driftagent_persona_drift5
Memory State Replaymemory_state_replay5
Code Switchingcode_switching4
Identity Federationidentity_federation4
Invisible Unicodeinvisible_unicode4
Delegated Approval Rebindingdelegated_approval_rebinding3
Error Message Leakageerror_message_leakage3
Multi Stage Encodingmulti_stage_encoding3
Rtl Obfuscationrtl_obfuscation3
Unicode Evasionunicode_evasion3
Agent Protocol Stateagent_protocol_state2
Cloud Auth Tool Outputcloud_auth_tool_output2
Deserializationdeserialization2
Encoded Payloadencoded_payload2
Encoding Evasionencoding_evasion2
Encoding Smugglingencoding_smuggling2
Semantic Cache Authority Launderingsemantic_cache_authority_laundering2
A2A Capability Escalationa2a_capability_escalation1
A2A Card Metadata Injectiona2a_card_metadata_injection1
Attestation Lineage Poisoningattestation_lineage_poisoning1
Audit Log Tool Outputaudit_log_tool_output1
Billing Tool Output Poisoningbilling_tool_output_poisoning1
Browser Retrieval Metadatabrowser_retrieval_metadata1
Browser Runtime Cachebrowser_runtime_cache1
Browser Runtime Statebrowser_runtime_state1
Browser Tool Output Injectionbrowser_tool_output_injection1
Browser Tool Output Poisoningbrowser_tool_output_poisoning1
Ci Diagnostic Poisoningci_diagnostic_poisoning1
Cloudflare Access Audit Log Tool Outputcloudflare_access_audit_log_tool_output1
Code Injectioncode_injection1
Compaction Artifact Spoofingcompaction_artifact_spoofing1
Configuration Management Preview Outputconfiguration_management_preview_output1
Delegation Boundary Poisoningdelegation_boundary_poisoning1
Dependency Automation Metadatadependency_automation_metadata1
Deployment Template Poisoningdeployment_template_poisoning1
Duplicate Key Shadowingduplicate_key_shadowing1
Long Context Exploitation Policy Pivotlong_context_exploitation_policy_pivot1
Mcp Sampling Hijackmcp_sampling_hijack1
Mcp Tool Injectionmcp_tool_injection1
Migration Tool Output Poisoningmigration_tool_output_poisoning1
Mlops Metadata Poisoningmlops_metadata_poisoning1
Observability Tool Output Poisoningobservability_tool_output_poisoning1
Oidc Credential Endpoint Substitutionoidc_credential_endpoint_substitution1
Path-Traversalpath-traversal1
Rag Metadata Field Injectionrag_metadata_field_injection1
Runtime Config Metadata Poisoningruntime_config_metadata_poisoning1
Sampling Parameter Injectionsampling_parameter_injection1
Speculative Decode Hijackspeculative_decode_hijack1
Sql-Injectionsql-injection1
Template Format Injectiontemplate_format_injection1
Template Metadata Poisoningtemplate_metadata_poisoning1
Terminal Output Encoding Smugglingterminal_output_encoding_smuggling1
Tool Cache Poisoningtool_cache_poisoning1
Tool Output Injectiontool_output_injection1
Tool Output Provenance Swaptool_output_provenance_swap1
Tool Output Receipt Poisoningtool_output_receipt_poisoning1
Tool Response Spoofingtool_response_spoofing1
Tool Schema Default Fallbacktool_schema_default_fallback1
Vector Metadata Instruction Smugglingvector_metadata_instruction_smuggling1
Workflow Orchestrator Tool Outputworkflow_orchestrator_tool_output1

JSON Data Endpoint

The full pattern database is available as a machine-readable JSON array. Every pattern exposes its id, name, category, severity, channel, keywords, and description. Regenerated on every version ship.

Endpoint: /patterns.json

GET https://sunglasses.dev/patterns.json // Response shape { "meta": { "total": 1378, "categories": 116, "generated": "2026-08-23", "source": "https://github.com/sunglasses-dev/sunglasses", "endpoint": "https://sunglasses.dev/patterns.json" }, "patterns": [ ... ] // 1378 objects, each with id/name/category/severity/channel/keywords/description }
Download patterns.json

Sunglasses is MIT-licensed. The pattern database is open for inspection, extension, and redistribution. View on GitHub


Frequently Asked

What attacks actually work against AI agents today?

The attacks that work best against AI agents are usually the ones that cross a trust boundary quietly, such as prompt injection, poisoned retrieval, tool-metadata abuse, forged workflow receipts, unsafe callbacks, and outbound actions that inherit more authority than they should.

Is prompt injection still the main AI agent risk?

Prompt injection is still one of the core AI agent risks, but it matters most as the starting layer beneath larger workflow failures like tool abuse, retrieval poisoning, callback drift, exfiltration, and unsafe publish paths.

What is the difference between prompt injection and retrieval poisoning?

Prompt injection is the broader instruction-channel attack, while retrieval poisoning is the case where hostile or strategically ranked external content gets pulled into the agent context and then influences reasoning, citations, or downstream action.

Why are authentication and guardrails not enough for agent security?

Authentication and guardrails are necessary but not sufficient because many AI agent failures happen after access is granted, when tool outputs, callbacks, workflow artifacts, or outbound destinations quietly reshape the next action.

What is MCP security really about?

MCP security is not only about who can call a tool server; it is also about whether tool descriptions, schemas, handoff metadata, outputs, and follow-on actions are being trusted more than they deserve.

What should security teams test first in an AI agent workflow?

Security teams should first test the surfaces where context becomes action: retrieved content, tool metadata, tool outputs, callbacks, handoffs, approvals, outbound destinations, and any memory or state that gets reused later.

What should vendors measure after blocking unsafe prompts?

After blocking unsafe prompts, vendors should measure whether the agent still makes risky tool calls, follows unsafe destinations, accepts forged workflow signals, leaks sensitive data, or widens authority through later workflow steps.


Related Resources

Generated 2026-08-23 from patterns.py · 1378 patterns · 116 categories