# Prompt injection

> Plain-text version for machine reading (LLMs). Original page: https://damian.dearce.com.uy/en/glossary/prompt-injection/

Manipulating an AI system through crafted inputs so it follows malicious or unintended instructions.

**Why it matters:** It is a core risk when AI systems can access internal data or tools.

## How it works

In a prompt injection, the attacker hides instructions inside text the model will read: a message, a document, a web page or an email. If the AI system can access data or tools, those instructions can make it leak information or take actions nobody authorized.

## Key points

- Direct: the user writes instructions to bypass the system's rules.
- Indirect: the instructions are hidden in external content the AI processes.
- The risk grows when the AI can read internal data or use tools.
- It is mitigated with least privilege, human approval for sensitive actions and specific testing.

## An example

An assistant that summarizes emails receives a message with hidden text asking it to forward the latest invoices to an external address; if the assistant can send email without confirmation, the attack works.

## Frequently asked questions

### Can it be eliminated completely?

There is no definitive fix today, so systems are designed assuming it can happen and limiting what the AI can do unsupervised.

### How do you test whether a system is vulnerable?

With AI-specific security testing: direct and indirect malicious inputs against the real system, with its data and tools.

## Related services

- [AI security and governance](https://damian.dearce.com.uy/en/services/seguridad-gobernanza-ia/)
- [Audit, risk and compliance](https://damian.dearce.com.uy/en/services/auditoria-riesgos-cumplimiento/)

## Related concepts

- [AI governance](https://damian.dearce.com.uy/en/glossary/ai-governance/)
- [DLP](https://damian.dearce.com.uy/en/glossary/dlp/)
- [Pentesting](https://damian.dearce.com.uy/en/glossary/pentesting/)

## Related regulation in Uruguay

- [Data protection (Law 18,331)](https://damian.dearce.com.uy/en/compliance/proteccion-de-datos-ley-18331/)

## Contact

- WhatsApp: +598 99 231 327 (https://wa.me/59899231327)
- Email: damian.de.arce@gmail.com
- LinkedIn: https://www.linkedin.com/in/damiandearce/
