AI Visual Prompt Injection — Text Hidden in an Image
ReceiptLens reads receipt images and writes a summary for the human approver. A vision model reads every pixel — including text a human can't see, like 1-pixel white text on a white receipt. Hide an instruction in the image and the model obeys it while the approver sees an ordinary receipt.
What is visual prompt injection?
Vision models read text inside images. They read all of it, including text that is tiny, faint, placed in a corner or coloured almost like the background.
Visual prompt injection puts instructions in an image as that kind of text. The person looking at the picture sees a receipt or a photo. The model sees the receipt and a message addressed to it.
A real case
Trail of Bits built images that look harmless at full size but show hidden text after the downscaling step many AI pipelines apply. Against Gemini CLI with a Zapier connection, such an image led to calendar data being sent to an outside address.
The lab is about the same gap: the vision model reads text in the image that the human approver does not notice.
Source: The Register
How to fix it
- Treat text found in images as untrusted content.
- Show the reviewer the text the model extracted, as well as the picture.
- Keep the vision step away from tools and decisions, and use it only to extract fields.
- Validate extracted values against expected formats and ranges.
Questions people ask
Can an image really carry a prompt?
Yes. Any text a vision model can read is input to it, whether or not a person can see it.
Is this the same as steganography?
Not quite. The text is usually there in plain pixels, only hard for a human to notice.
How do I test for it?
Add low-contrast or very small text to a test image and see whether the model's output changes.
Read the full Prompt Injection guide · All free labs · AI red team certification