Home
GLOSSARY
Prompt Injection

Prompt Injection

IN ONE LINE

Prompt injection is an attack where hidden or malicious instructions in user input or external content trick an AI system into ignoring its rules or leaking data.

What is Prompt Injection?

In a prompt injection, an attacker puts instructions where the model will read them, directly in a chat message or indirectly inside a web page, document or email the AI processes. The model may follow those instructions instead of the developer's.

Why it matters

As AI features gain access to data and tools, prompt injection can lead to data leaks, unauthorised actions or misleading answers. It is listed first in the OWASP Top 10 for LLM applications.

How it works

Defences are layered: treating all external content as untrusted, limiting what data and tools the model can reach, separating instructions from data, validating outputs, requiring approval for sensitive actions, and monitoring for unusual behaviour.

Common mistakes

  • Assuming a strong system prompt is enough protection.
  • Letting the AI read untrusted content and call powerful tools in the same step.
  • Returning raw model output into other systems without validation.
  • Never testing the app with injection attempts.

How Dev Monks approaches it

Dev Monks checks AI apps for prompt injection risks as part of our AI code security audit, including tool permissions, data exposure and output handling, and recommends practical fixes.

FAQs

Can prompt injection be fully prevented?

Not completely today, so the goal is to limit what a successful injection can do.

Does prompt injection affect internal tools?

Yes, especially when they read emails, documents or web pages from outside.

Related terms

Need help with this? See our AI Code Security Audit service.