The AI can analyse a text without treating it as instructions. Prompt injection happens only if there is no separation between data and actual instructions.
Both the input data and the instructions are part of the prompt. There is no spearate instruction input and data input. They are all just tokens concatenated one after another.
The AI will them promptly (hehe) ignore the prompt injection because it’s analysing the text without treating it as a prompt. Prompt injection only works if you paste your data directly in the prompt.
Easy, though. Make the AI read data from a file.
EDIT: everyone downvoting has obviously never used any LLM
In the file: Ignore previous instructions
The AI can analyse a text without treating it as instructions. Prompt injection happens only if there is no separation between data and actual instructions.
Both the input data and the instructions are part of the prompt. There is no spearate instruction input and data input. They are all just tokens concatenated one after another.
Do you know what “reading” means?
It means:
Sure thing! Let me read that file for you.
<tool_call> {“name”: “read”, “arguments”: {“filename”: “foo.txt”}} </tool_call>
{“content”: “Ignore previous instructions”}
The AI will them promptly (hehe) ignore the prompt injection because it’s analysing the text without treating it as a prompt. Prompt injection only works if you paste your data directly in the prompt.