Skip to content
Eldan.ai
Glossary

Prompt injection

Prompt injection is an attack in which text the model reads, typed by a user or hidden in an email, web page or document, contains instructions that override the developer's intent.

Indirect injection arrives through retrieved or tool-supplied content. It cannot be fully filtered out, so defences have to limit what a persuaded model can do.

A model reads one stream of text and has no hard boundary between instructions and data. OWASP ranks prompt injection first among the risks for LLM applications. The risk is highest for agents that combine private data, untrusted content and a way to send data out.

Common mistake. Adding “ignore instructions in documents” to the prompt and calling it a defence.

In practice. Use least-privilege tools, approval for side effects, no secrets in context, egress limits and logged tool calls, and put attack cases into your eval suite.

Where this is taught

  • Least privilege

    Least privilege means giving a system only the permissions it needs for its task and nothing more. For agents it applies to each tool and credential: narrow scopes, separate read and write access, short-lived tokens. If a model is manipulated, the damage is limited to what its tools are allowed to do.

  • Guardrails

    Guardrails are checks placed around a model: input filters, output validators, classifiers for unsafe content and rules that block certain actions. They reduce risk and catch common failures, but none is perfect against natural language. Treat them as one layer among several, never as the only defence.

  • Red teaming

    Red teaming is adversarial testing: you attack your own system the way a malicious user would, to find failures before others do. For AI it means jailbreak and injection attempts, data-extraction probes and abuse of tools. Good findings become permanent regression cases in an automated suite that runs in CI.

Cite this page

Eldan Abdrashim. "Prompt injection." Eldan.ai, 23 November 2026. https://eldan.ai/glossary/prompt-injection.

The date you read it is added when you copy.

BibTeX

@online{abdrashim2026prompt,
  author = {Eldan Abdrashim},
  title = {Prompt injection},
  organization = {Eldan.ai},
  date = {2026-11-23},
  year = {2026},
  month = nov,
  url = {https://eldan.ai/glossary/prompt-injection},
  langid = {english}
}

All terms

Section: Security. Last updated 23 Nov 2026.