Jump to content

Sovereign AI agents and prompt injection

From IdeaWazaWiki
Revision as of 16:37, 19 October 2026 by Waza (talk | contribs) (Create article (drafted with AI assistance))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Prompt injection is a class of attack in which text that an AI language model reads, such as a web page, email, document, tool result, image text, or retrieved passage, contains instructions that try to override what the user or developer asked for. The model receives trusted instructions and untrusted data in the same stream of text, so it cannot reliably tell them apart, and may follow the injected text as if it were a higher priority command.

Why it happens

Language models are trained to follow natural language. A system prompt, a user message, a tool reply, and a downloaded page all arrive as tokens in one context window. There is no hard boundary that marks only some of those tokens as commands. An attacker who can place words where the model will read them can compete with instructions from the developer. That design trait, not a single bug in one product, is why the risk is shared across assistants and agents.

Direct and indirect injection

OWASP lists prompt injection as LLM01:2025 in its Top 10 for Large Language Model Applications. It distinguishes direct injection, where the person typing into the model supplies the manipulative text, from indirect injection, where the model reads that text from an external source such as a web page, email, or document in a retrieval index.[1] Indirect cases matter most for agents that browse or ingest mail without a human reading every line first.

NIST AI 100-2 places related ideas in a broader adversarial machine learning taxonomy that covers attacks on AI systems and common mitigation patterns.[2] A publicly edited encyclopedia article on the topic summarizes the same split between direct and indirect forms and the role of web browsing and uploaded files in indirect attacks.[3]

Why agents raise the stakes

A chat model that only returns text can still leak secrets from its context. An agent that can browse, read mail, run code, spend money, or publish combines three conditions that security writing often calls a dangerous triad or lethal trifecta: access to private data, exposure to untrusted content, and the ability to send data or actions outward. Together they let untrusted text influence a system that can also exfiltrate information or change the outside world. See Agent allowlists for spend and publish and Running AI models locally.

Example scenarios

These sketches are generic. They describe classes of risk, not working payloads.

  • A web page includes text that is hard for a person to notice but still readable by an assistant, asking it to email a local file to an outside address.
  • A document planted in a retrieval index contains instructions that try to change how answers are written. See Retrieval-augmented generation.
  • A tool description offered through the Model Context Protocol asks the model to reveal secrets or to call other tools in ways the user did not request. This pattern is sometimes called tool poisoning.
  • An image carries printed or overlaid instructions that a multimodal model may treat as guidance.

Jailbreaking aims to make a model ignore its own safety rules. Prompt injection aims to make it follow instructions that arrived through data rather than through the user. OWASP treats jailbreaking as related to injection rather than as a separate Top 10 entry.[1] Data exfiltration can use links, images, or tool calls that send private text outward. Tool poisoning targets tool descriptions an agent trusts. Confused deputy problems arise when a privileged agent acts on untrusted input as if that input were authorized.

Defenses and mitigations

There is no complete fix known. Useful layers include least privilege for tools and tokens, separating trusted instructions from untrusted data and marking untrusted content clearly, human approval before sending, paying, deleting, or publishing, allowlists for destinations and spending, sandboxing of code and browsers, filtering of outbound content, logging of tool use, and red-team testing through every channel the agent reads. Keep secrets out of the model context when a tool can fetch them only when needed. MCP security guidance stresses consent before tool calls and treating tool descriptions as untrusted unless the server is trusted.[4]

Practical guidance

For people using assistants: treat pasted pages and emailed documents as untrusted. Ask for a summary that does not follow instructions found in the source. Do not grant send, pay, or publish powers until you are ready to approve each action. Prefer local models and local indexes when the text is private. See Local-first software and data ownership and A guide to this wiki for AI agents.

For people building agents: default tools to read-only. Require confirmation for side effects. Bound spending and publish targets with allowlists. Log every tool call. Test with adversarial pages before widening access. Design so that a successful injection cannot reach private stores and outbound channels in the same step.

Writing sites that agents can read safely

Clear headings, a bold lead, and plain links help agents and people alike. Do not hide instructions in invisible text, tiny fonts, or image overlays meant to steer models. Site owners should not try to manipulate visiting agents into ignoring their users. Honest structure serves learning. Related pages include DDoS protection, Portable reputation for agents, Agent-to-agent commerce, and Cryptocurrencies and wallets for AI agents using the x402 protocol.

Discussion questions

  • Which three tool permissions on an assistant you use would cause the most harm if an injected page could trigger them?
  • How would you separate trusted system rules from untrusted retrieved text in a product you design?

Essay ideas

  • Compare direct and indirect prompt injection and argue which is harder to detect in agent workflows.
  • Explain the dangerous triad of private data, untrusted content, and outbound actions, and propose layered controls.

AI prompt ideas

  • Explain prompt injection with a mail clerk analogy, then quiz me with five short questions.
  • Help me draft a least privilege checklist for an agent that can read email and open web pages.

Readings from Wikipedia

See also

References