---
title: "Prompt injection"
url: https://www.daytona.com/definitions/p/prompt-injection
---

# Prompt injection

Prompt injection is an attack that hides instructions in content an AI model reads, so that the model follows them instead of its user.

Prompt injection is an attack on systems built on language models. The attacker places instructions inside data that the model will read, such as a web page, an email or a file. The model cannot reliably tell those instructions apart from the ones its user gave. It may then follow them, for example by leaking data or calling tools it should not.

The risk grows with what the model can do. A chatbot that only writes text can at worst give a wrong answer. An agent that can run code, send messages or move files can be turned against its user. No current method fully prevents prompt injection, so systems limit what a misled model can reach.

Running an agent's actions in a sandbox limits what an injected instruction can do. The sandbox holds only the files and credentials the task needs. Egress control keeps it from sending data to places the task does not use. Actions with real effects outside the sandbox, such as payments or deployments, can require a person to approve them.
