What is Prompt injection?
Prompt injection is a vulnerability in which crafted input changes the behavior or output of a large language model in ways its developers did not intend.
Also written: prompt injection attack, indirect prompt injection, direct prompt injection
Explained
Prompt injection happens when text that a language model reads alters what the model does. The text does not have to be visible to a person, as long as the model parses it. It is listed as LLM01 in OWASP's 2025 list of risks for LLM applications.
The OWASP page separates two forms. In a direct injection, the user's own prompt changes the model's behavior, either deliberately or by accident. In an indirect injection, the model takes in outside content such as a web page or a file, and that content carries instructions that change its behavior. OWASP treats indirect injection as a separate form from direct injection, since the model accepts input from external sources such as websites or files.
The listed consequences include disclosure of sensitive information, exposure of system prompt details, unauthorized use of functions the model can reach, and commands run in connected systems. The suggested mitigations include constraining model behavior in the system prompt, validating output formats with ordinary code, filtering inputs and outputs, giving the model least-privilege access, requiring human approval for high-risk actions, labeling untrusted external content, and running adversarial tests.
OWASP states a clear limit. Because generative models are stochastic, it is unclear whether any fool-proof prevention exists, and the measures above reduce impact rather than remove the problem. OWASP describes jailbreaking as a form of prompt injection in which the attacker's input makes the model disregard its safety protocols.
Primary source
LLM01:2025 Prompt Injection - OWASP Gen AI Security Project (genai.owasp.org), read Oct 26, 2026
This entry paraphrases the page above. Sources change; check it for the current wording.
Listings that use this
The 5 top-ranked listings tagged for Prompt injection. Rank weighs adoption, freshness, documentation and publisher identity; how we rank and grade. Money never changes the order.
- 0.878score
ai-coding-agent-guardrails
devops-skills
Secure AI coding agents (Claude Code, Cursor, Codex, Copilot) with permission boundaries, secret protection, code review gates, and safe sandbox…
SkillAFreshness: A★ 48.4KClaude Code +9 - 0.875score
ai-agent-security
devops-skills
Secure AI agents against prompt injection, tool abuse, and data exfiltration with defense-in-depth controls.
SkillAFreshness: A★ 48.4KClaude Code +9 - 0.855score
aig-scanner
TencentOfficial
A.I.G Scanner — AI security scanning for infrastructure, AI tools / skills, AI Agents, and LLM jailbreak evaluation via Tencent Zhuque Lab AI-Infra-Guard.
SkillAFreshness: A★ 7.1KClaude Code +9 - 0.849score
indirect-injection-detection
TencentOfficial
Detect indirect prompt injection (goal hijack).
SkillAFreshness: A★ 7.1KClaude Code +9 - 0.848score
git-guardrails-claude-code
vinvcn
设置 Claude Code hooks,在危险 git commands(push、reset --hard、clean、branch -D 等)执行前阻止它们。适用于用户想防止破坏性 git 操作、添加 git safety hooks,或在 Claude Code 中阻止 git push/reset 时。
SkillAFreshness: A★ 5.2KClaude Code +9
Related
Cite this page
What is Prompt injection?. Agent Mart. https://agentmart.dev/glossary/prompt-injection (last updated 2026-10-26)
Written Oct 26, 2026, updated Oct 26, 2026. All glossary terms