← See all resources
Prompt Injection
🤖Attack Types • AI & Emerging

Prompt Injection

How attackers manipulate prompts to alter the behavior of AI-based systems.

Tags

AI SecurityLLMPrompt InjectionAutomation
Download infographic

File: SecPro-ataque-prompt-injection.gif

What is prompt injection?

Prompt injection means slipping instructions into the text a language model processes so it ignores what its developer told it and obeys the attacker instead. It is the conceptual equivalent of SQL injection, with one uncomfortable difference: in SQL you can separate data from instructions using parameterized queries, whereas a model receives everything as a single stream of text and cannot reliably tell which part is a command and which is data.

Direct and indirect — the dangerous one is the second

In direct injection the user types the malicious instruction into the chat themselves. In indirect injection, the variant that makes this a serious problem, the poisoned text sits in a resource the model will read later: a web page it summarizes, an email it triages, a document it analyzes or a comment in a repository. The victim does nothing suspicious; their agent merely has to read attacker-prepared content.

How to mitigate it?

Nothing eliminates it, so you work in layers: treat all external input as untrusted, limit the model's tools and permissions to the strict minimum, require human confirmation before irreversible actions, separate data and instruction contexts where the architecture allows, and validate outputs before acting on them. The practical principle is to design assuming the model will be fooled at some point.

More from Attack Types • AI & Emerging

Explore more infographics

View full catalog

Need help with your cybersecurity? 💬