Image scaling attacks on AI: how they work
A clean-looking image can carry a prompt injection that only appears once an AI service shrinks it. How image scaling attacks work, and what stops them.
In August 2025, two researchers at Trail of Bits, Kikimora Morozova and Suha Sabi Hussain, published a demonstration in which they gave Google’s Gemini CLI an ordinary-looking image. The tool then emailed the user’s Google Calendar data to an address standing in for an attacker’s, without asking. Nothing in the image, viewed at full size, told it to. The instruction existed only in the smaller copy of the image that was made before the model looked at it.
That is an image scaling attack. AI services shrink large images before a model reads them, and shrinking throws most of the pixels away. An attacker who knows which pixels survive can write a message using only those. A person checking the upload sees one picture. The model receives another, with text in it, and a model that can call tools may act on that text. Trail of Bits demonstrated it on six AI products and interfaces and released a tool, Anamorpher, that builds the images.
This post explains the mechanism with a worked example, shows a harmless test image we built ourselves, reports what happened when we tried to break it, and ranks the defences by the evidence behind them. It is current as of 11 November 2026. We found no CVE, no vendor fix and no report of the technique being used against real victims, and we say below how far those searches reached.
The short answer
- What is it? A prompt injection that only appears after an image is downscaled. The full-size file looks clean because the hidden text is spread across the few pixels a resizing algorithm samples and cancelled out by the pixels around them.
- Is it a flaw in the AI model? No. The weakness is in the image pipeline in front of the model, and the damage depends on what the model is allowed to do afterwards. The model reads text that is in the image it was given.
- Who is exposed? Any system that shrinks images with a resizer that skips pixels, and then lets the model act on what it reads. Trail of Bits showed it on six Google and Genspark surfaces. We found no independent test of other vendors’ products, and none of the three large vendors’ documentation names the resizing algorithm it uses.
- Has it been used against real victims? Not that we could find. It has been demonstrated by researchers, as has every agent data-leak case we cite below.
- What stops it? Two things, at different layers. If you run the resizer, use one that averages every pixel, or do not downscale at all. In every case, make sure no tool that can send data out of your organisation runs on the strength of image content without a person approving it.
- What does not? Telling the model to ignore instructions in images, relying on a guard model, checking the full-size image by eye, and, in our test, recompressing the image as a JPEG.
What Trail of Bits showed
The demonstration that made the headlines used Gemini CLI, Google’s command-line coding agent, connected to a Zapier tool server through the Model Context Protocol (MCP). The researchers say they used the default configuration for that server, which set trust=True in Gemini CLI’s settings file, so that tool calls from it ran with no confirmation prompt. The user gives the CLI an image that looks harmless. The CLI shows no preview of what the model will receive. The downscaled image carries an instruction, the model follows it, and a Zapier action emails the user’s calendar data to the attacker.
The post lists five more surfaces where the hidden text reached the model: Vertex AI Studio with a Gemini back end, Gemini’s web interface, Gemini’s API through the llm command-line tool, Google Assistant on an Android phone, and Genspark. For Vertex AI Studio it makes a pointed observation: the front end shows the user the high-resolution image while the model gets the downscaled one.
Three things are worth knowing about what the post does not say.
- It names no algorithm for any product. It explains nearest neighbour, bilinear and bicubic downscaling in general, and its one worked figure is OpenCV’s bicubic. It does not say which resizer Gemini CLI, Vertex AI or Genspark uses.
- It gives no success rates, image sizes or prompt text. Anamorpher’s own README tells users to run each example five times and warns that not every payload works against every implementation.
- The CLI was not the part doing the resizing. Gemini CLI’s open source encodes the image file and sends it as it is. We found no resize step in it, so on our reading the downscale in that demo happened on Google’s side, where nobody outside Google can inspect it.
Google’s response came through The Register the same day. A spokesperson said the behaviour was “not a vulnerability in the default, secure configuration of Gemini CLI”, because the user has to choose to let tool calls run without confirmation. Google recommended giving the tool only files you trust and working in a sandbox, and said it would add a more explicit warning for anyone who turns that safeguard off.
The technique itself was not new. Xiao and colleagues described camouflage attacks on image scaling at USENIX Security in 2019, and Quiring and colleagues explained the root cause and tested defences in 2020. Both were about fooling image classifiers: a picture of a sheep that becomes a wolf when shrunk. What Trail of Bits added was the target. A model that reads text and holds tools turns a mislabelled picture into stolen data.
What has changed since
| When | What happened |
|---|---|
| 21 August 2025 | Trail of Bits publish the attack and release Anamorpher. Google gives its statement to The Register |
| 28 and 29 August 2025 | Gemini CLI changes the trust setting so that, where its folder-trust feature is switched on, it only applies in folders the user has marked as trusted (pull request 7358). The change does not mention this research |
| Late 2025 | The authors present the work at BSides Berlin and Black Hat Europe, according to Trail of Bits’ publications list |
| 15 September 2026 | MITRE ATLAS creates an entry for instructions hidden in images, audio and video: AML.T0129, Triggers in Multimodal Inputs |
| 11 November 2026, as checked | No CVE for the technique in keyword searches of the US National Vulnerability Database. No fix announced by any vendor that we could find. Anamorpher is still labelled beta, with no releases |
We also looked for the warning Google said it would add. We searched Gemini CLI’s commits, pull requests, documentation and changelog on 11 November 2026 and did not find one tied to switching off confirmation for an MCP server. That is an absence in what we searched, not proof that it does not exist.
Follow-up research is thin. The one preprint we found that builds on the work, Chameleon, gives different success rates in its abstract and its results table and tested 20 images against one model, so we do not rely on it.
How image scaling hides a prompt
Shrinking is sampling
Take an image 2,048 pixels wide and shrink it to 512. Each pixel in the small image has to stand for a block of 16 pixels in the large one, four across and four down. A careful resizer blends all 16. A fast one reads a few and ignores the rest.
The ignored pixels are the opening. Whatever they contain has no effect on the output, so they can be used to keep the full-size image looking normal, while the pixels that are read spell out something else. Signal processing has a name for the general problem, aliasing: fine detail that a coarser grid cannot represent turns up as a different pattern. Quiring et al. put the root cause in one phrase, “the interplay of downsampling and convolution”: the resizer applies a small fixed window, then keeps one result in every few.
Which pixels each resizer reads
How many pixels are read depends on the algorithm and, less obviously, on the library. The same name can mean different arithmetic.
| Resizer, shrinking by exactly 4:1 | Source pixels behind each output pixel | What that means |
|---|---|---|
| Nearest neighbour | 1 of the 16 | One pixel decides. Which one depends on the library |
| Bilinear, fixed window (OpenCV, TensorFlow by default) | The centre 4 of the 16, a quarter each | The other 12 are ignored |
| Bicubic, fixed window (figures for OpenCV) | All 16, but unevenly | The centre 4 carry 141% of the result and the outer 12 carry minus 41% |
Area averaging (OpenCV INTER_AREA) | All 16, equally | No small group can outvote the rest |
| Pillow bilinear, bicubic and Lanczos | A window that widens with the shrink factor | Every pixel contributes, with smooth weights |
The fixed-window resizers keep the same small window however much they shrink. Quiring et al. read the libraries’ source and found the window was 1, 2 and 4 pixels wide for nearest, bilinear and bicubic in OpenCV and TensorFlow, while Pillow’s grows in step with the ratio. So the bigger the reduction, the smaller the share of the image a fixed-window resizer looks at. At 8:1, bilinear reads 4 pixels in every 64.
The bicubic row needs one more sentence. Reading every pixel is not enough if the weights are lopsided, and at 4:1 they are: four pixels dominate, and the twelve around them count against the result. TensorFlow’s default bicubic, going by its source, has the same shape with slightly different weights.
A worked example: one output pixel
Here is the arithmetic for one pixel of our test image, on the usual scale where 0 is black and 255 is white.
OpenCV’s bicubic, at exactly 4:1, samples halfway between the second and third pixel of each run of four. That gives the four pixels in a run the weights -0.094, 0.594, 0.594 and -0.094. Across a block four wide and four deep, the centre four pixels carry 1.41 of the output between them and the outer twelve carry minus 0.41.
Suppose the chart is a flat 110 at this spot, and we want the model to see 174 there, which is light enough to read as text. We set the centre four pixels to 151 and the outer twelve to 96.
- What bicubic computes: 1.41 × 151, minus 0.41 × 96, which is about 174. The text appears.
- What an averaging resizer computes: four pixels at 151 and twelve at 96 average to about 110. The chart is unchanged.
The second line is why the trick is hard to spot. Any viewer that blends neighbouring pixels when it fits a large image to a window shows the plain chart, and the eye does much the same once detail is too fine to make out. When we displayed our test image on a web page in Chromium 152, the engine behind Chrome and Edge, at a quarter and at a third of its size, we could see the chart and nothing else. That is a judgement by eye from a screenshot, not a measurement. The full-size file and the model’s copy disagree, and the person looking at the first has no reason to suspect the second.
Our test image
We built one to check that we understood this, using nothing but the arithmetic above. It is a 2,048 by 1,536 pixel bar chart, drawn by a script, with a sentence hidden in it for one resizer: OpenCV’s bicubic, shrinking 4:1 to 512 by 384. The hidden sentence is a harmless canary, not an instruction.
The script changed 6.25% of the pixels, none by more than 42 levels out of 255. Figure 2 shows what those changes look like close up.
Our image is not well hidden, and we did not try to make it so. Zoom to 100% and the text is visible as a fine dotted texture. Anamorpher works harder at it: it optimises the pixel changes and, as the Trail of Bits post explains, uses decoy images with large dark areas to hide the payload. In practice the question is whether anybody looks. Nobody inspects an upload at full zoom, and when the image arrives through an agent, as an email attachment or a page it fetched, nobody looks at it at all.
Why the attacker has to know your pipeline
The image is built for one resizer and one output size, and it works best there. An attacker therefore has to find out what the target does, and both research groups showed that this can be done from outside. Xiao et al. worked out the algorithm and input size of four cloud vision services in 2019 by sending probe images. Trail of Bits sent test patterns, including checkerboards, concentric circles and slanted edges, and read the resizer’s signature from how each came back.
That is the reason not to treat obscurity as protection. The post is blunt about it: hunting for the least vulnerable algorithm and implementation is not a defence you can rely on.
What breaks the attack: our measurements
We ran our test image through other resizers, other sizes and some common processing steps, and measured how much of the hidden text came through. The figure in each row is the contrast of the hidden text as a share of what we intended: 100% means it is all there, 0% means the output is the plain chart. A minus value means the text shows reversed, darker than the chart where it should be lighter.
| What we did to the file | Hidden text that came through |
|---|---|
| OpenCV bicubic to 512 × 384, the resizer we aimed at | 100% |
| OpenCV bilinear to the same size | 65% |
| OpenCV Lanczos to the same size | 106% |
| Nearest neighbour in Pillow | 65% |
| Nearest neighbour in OpenCV | Minus 21% |
| scikit-image bicubic with anti-aliasing off | 101% |
| scikit-image bicubic with anti-aliasing on | 5% |
| Pillow bicubic, bilinear, Lanczos or box | 0 to 1% |
| OpenCV area averaging | 0% |
Chromium 152 canvas drawImage, at its default quality, “low” | 63% |
Chromium 152 canvas drawImage, quality “medium” or “high” | Minus 1% |
| OpenCV bicubic to 500 × 375, slightly the wrong size | 18% on average, in bands |
| OpenCV bicubic to 1,024 × 768, a 2:1 reduction | Minus 1% |
| JPEG at quality 50, then the intended resize | 97% |
| Shifted one pixel, then the intended resize | Minus 1% |
| Gaussian blur, radius 2, then the intended resize | 1% |
| Gaussian blur, radius 1, then the intended resize | 21% |
| Halved in size with an anti-aliased filter first, then OpenCV bicubic | 3% |
Six things stand out.
Averaging removes it, and anti-aliasing nearly does. Every Pillow filter we tried except nearest neighbour, and OpenCV’s area mode, returned the plain chart. scikit-image’s anti-aliasing left a faint 5%.
A different unprotected resizer still leaks. We aimed at bicubic. Bilinear showed the text at about two-thirds strength, because it reads the same centre pixels. An attacker does not need a perfect match.
A browser can be the leaky resizer. Some web applications shrink an image in the browser before uploading it, by drawing it to a canvas. In Chromium 152 the canvas’s default smoothing quality let the hidden text through at 63%, much as bilinear did. So did createImageBitmap at its default. Setting the quality to “medium” or “high” removed it. We tested one browser.
Being slightly off in size does not make it safe. At 500 by 375 the sampling drifts in and out of step with the pattern, and the text appears in bands, some lighter and some darker than the chart. The average is low, but parts of the text are still legible in Figure 3.
JPEG compression did not help. Recompressing at quality 50 left 97% of the hidden text. The pattern repeats every four pixels, which is evidently coarse enough for JPEG to keep.
A blanket median filter left a ghost. A 5 by 5 median filter before the resize left the text reversed at 18%. That reflects how we built the image. It is not a test of the selective median filter Quiring et al. proposed, which replaces only the pixels the resizer reads.
One more result explains why averaging is the sound choice. We built a second version that changed only the centre four pixels of each block, 1.6% of the image, and left the rest alone. Bicubic still showed the text in full. Area averaging and Pillow now showed a faint copy at about 18%. To get rid of that copy the attacker has to adjust the surrounding pixels as well, which is what our first image does and why its changes are easier to see. Quiring et al. measured the same trade on classifiers: against area scaling, an attacker who adapted could still force the output, but only by overwriting about half the image so that the original was no longer recognisable.
The limits of all this are plain. It is one synthetic image, one ratio and one target resizer, on OpenCV 5.0.0, Pillow 13.0.0, scikit-image 0.26.0 and Chromium 152. We did not test PyTorch, TensorFlow, Safari or Firefox. We did not put any of these images in front of an AI model, so we cannot say how faint a ghost a model will still read.
The image is only half the attack
Hidden text reaching a model is an integrity problem. It becomes data theft only when three things are true at once: the model handles content from someone untrusted, it can reach private data, and it can send something out. Simon Willison calls that combination the lethal trifecta. Meta’s Agents Rule of Two turns it into a design rule: an agent session should combine no more than two of the three, and one that needs all three should not run unsupervised.
The Gemini CLI demonstration had all three. An image from outside, a calendar, and a tool that could send email, with the confirmation step that separates them switched off. Take away any one and the hidden text is still read, but nothing leaves.
Text-borne versions of the same pattern are well documented. Each of these was demonstrated by researchers, and none is reported as used against customers.
| Case | What could leak | How it left |
|---|---|---|
| EchoLeak, CVE-2025-32711, Microsoft 365 Copilot, published 11 June 2025 | Anything in Copilot’s context, according to the finders, Aim Labs | A crafted email made Copilot produce an image link that carried the data out. Microsoft rated it 9.3, fixed it on its own servers and recorded it as not exploited |
| CamoLeak, GitHub Copilot Chat, published 30 September 2025 | Private source code and secrets | A hidden comment in a pull request made the chat render a sequence of image requests that spelled out the data. GitHub turned off image rendering in the chat |
| GitHub MCP server, published 26 May 2025 | Private repository contents | An issue in a public repository steered the agent into copying private data into a public pull request |
In each, the injected instruction was only the start. What moved the data was an outbound channel the system left open: a rendered image, a tool that sends or writes. That is where the strongest defences act.
Scaling attacks sit in a small family of image-borne injections. Brave’s October 2025 research hid faint text in an image on a web page, which an AI browser read when the user took a screenshot. Other work renders instructions as small or oddly styled text, or perturbs an image against one specific model. The scaling attack is the one where a person reviewing the uploaded file sees nothing, because the content does not exist until the pipeline creates it.
As for the wild: Google scanned crawled web pages and reported in April 2026 a small number of injections aimed at stealing data, of low sophistication, with the malicious category up 32% between November 2025 and February 2026. Palo Alto Networks’ Unit 42 catalogued 22 techniques on live pages in March 2026, including an attempt to get a scam advertisement past an AI reviewer, and said it was “not aware of any confirmed” real-world success against deployed ad-checking agents. Those are attempts in text and HTML. We found no report of an image-borne injection, by scaling or any other method, used against a real victim.
The best defences, ranked by evidence
We found no published study that measures any of these defences on a multimodal AI product. The image-layer evidence comes from image classifiers in 2020 and from our one test image. The agent-layer evidence comes from text benchmarks. The ranking below weighs how direct the evidence is and says where it stops.
| Rank | Defence | Evidence | Where it stops |
|---|---|---|---|
| 1 | Resize by averaging every pixel, or do not downscale | Quiring et al. on classifiers; our test | Only whoever runs the resizer can do it |
| 2 | Cap what the agent can do: approval for sensitive tools, least privilege, outbound allowlists | Measured on text benchmarks; recommended by Trail of Bits, ASD, OWASP and MITRE | Not measured on images; costs some usefulness |
| 3 | Show and log the image the model receives | Trail of Bits recommendation | No measurement; a person still has to look |
| 4 | Detect scaling attacks before the model sees them | Strong on classifier data sets | Some detectors fail when the attacker adapts |
| 5 | Friction: blur, shifts, odd sizes | Xiao et al.; our test | An attacker who learns the step can build for it |
| Last | Instructions to the model, and guard models | Works against fixed test prompts | Broken by attackers who adapt; no evidence on images |
1. If you run the resizer, read every pixel
When the resize call is in your own code, this is the cheapest fix there is. Quiring et al. tested nearest neighbour, bilinear and bicubic in OpenCV, TensorFlow and Pillow. The attack succeeded against every OpenCV and TensorFlow variant. Pillow’s bilinear and bicubic could be forced to the attacker’s result, but only with changes that their test participants always spotted. Their recommendation was area scaling.
Check what your code does today, because the defaults differ:
- OpenCV:
cv2.resizedefaults to bilinear with a fixed window. UseINTER_AREAwhen shrinking. - TensorFlow:
tf.image.resizehasantialias=Falseby default, according to its documentation. Turn it on. - PyTorch: torchvision’s resize anti-aliases tensors by default since version 0.17. The lower-level
torch.nn.functional.interpolatedoes not unless you passantialias=True. - Pillow: every filter except
NEARESTwidens with the shrink factor. Do not useNEARESTfor reductions. - scikit-image:
resizeapplies anti-aliasing by default when shrinking. Do not turn it off. - Browser canvas: in Chromium 152,
drawImageandcreateImageBitmaplet the hidden text through at their default quality, “low”. SetimageSmoothingQualityto"high", and treat a resize done in the browser as a convenience, not a control: resize again on the server.
import cv2
# Shrinking with OpenCV: average every source pixel.
small = cv2.resize(image, (width, height), interpolation=cv2.INTER_AREA)
Of those, we tested OpenCV, Pillow, scikit-image and one browser ourselves. The TensorFlow and PyTorch lines come from their documentation and source.
If the resizer belongs to a model vendor, you cannot change it, but you can get in front of it. Shrink the image yourself, with an averaging filter, to the size the vendor would have reduced it to, so the vendor has nothing left to do. That takes the vendor’s own rule, not a guess. Anthropic, for example, downscales any image that exceeds either a long-edge limit (1,568 or 2,576 pixels, depending on the model) or a token budget, and says the token budget is usually the one that bites. Its documentation gives the calculation, and its API lets a caller mark an image to be rejected instead of resized, which turns a missed case into a visible error. OpenAI and Google document their own size and tiling rules. None of the three pages names the resizing algorithm.
Trail of Bits go one step further and recommend not downscaling at all: cap the dimensions of what can be uploaded.
2. Whatever the image says, cap what the agent can do
This is the layer that works when the first one fails, and for most organisations using hosted models it is the one that matters. It does not depend on recognising the attack.
- Sensitive tools need a person. Sending email, posting to a webhook, writing to a repository, paying, deleting: none of these should run because of something the model read in an image, a document or a web page, without a person approving that specific action. Trail of Bits call secure design the strongest defence and single out text inside images.
- Nobody gets to switch approval off quietly. The Gemini CLI demo turned on one setting on one tool server. Set tool-server trust centrally, and treat “always allow” as a privilege you grant, not a preference users choose.
- Give the agent the least it needs. A session that reads uploaded images does not also need the calendar, the mailbox and the CRM.
- Allowlist where data can go. A default-deny rule on outbound connections turns most data-theft payloads into a blocked request and an alert. Treat images in the model’s output as an outbound channel too: rendered images are how EchoLeak and CamoLeak got data out, each through a proxy the vendor itself trusted.
The research behind this layer is about text, but the reasoning carries over because the control never looks at the content. Google DeepMind’s CaMeL design, which keeps what the user asked for apart from what untrusted data says, completed 77% of the tasks in a standard agent benchmark with its security guarantees in force, against 84% undefended. The design patterns paper Trail of Bits point to sets out six such structures and what each costs.
Approval has a known weakness: people click through. Meta’s own example of how a design that follows its rule can still fail is a user confirming a warning without reading it. Keep approvals few enough to be read, by reserving them for actions that send data out or cannot be undone. Our piece on MCP’s authorisation surface covers how to scope tools so that fewer prompts are needed, and the delegation model that holds up under prompt injection covers the credentials behind them.
3. Show and log what the model receives
Trail of Bits recommend giving the user a preview of the input the model is processing, in command-line and API tools as well as in chat windows. A reply from one of the authors on Anamorpher’s issue tracker notes that Gemini’s web interface displays the processed image, while the post says Vertex AI Studio showed the original.
A preview only helps if someone looks, so we would add a measure of our own: log the image as the model received it, after any resizing. If an agent ever does something it should not, that is the file your investigation needs.
4. Detection is a second line
Detectors exist, and on the data sets they were built for they score well. Decamouflage reported above 99% accuracy. One of its methods shrinks an image, enlarges it again and compares the result with the original. But a 2023 study by Quiring’s group found that detectors working on an image’s frequency spectrum failed against an attacker who adapted to them, while those comparing pixels held up, and concluded that detection should not replace prevention.
The simplest check is to resize the image two ways and see whether the results disagree:
import cv2
import numpy as np
def scaling_disagreement(path, size):
"""Mean squared difference between a pixel-skipping and an averaging downscale."""
image = cv2.imread(path)
skipping = cv2.resize(image, size, interpolation=cv2.INTER_CUBIC).astype(np.float64)
averaging = cv2.resize(image, size, interpolation=cv2.INTER_AREA).astype(np.float64)
return float(((skipping - averaging) ** 2).mean())
On our test image this returned 206. On the same chart before we hid anything it returned 31, and on sample photographs with the same grain added, 17 to 23. Without the added grain those photographs scored under 7. That is a clear gap on one image, not a validated detector: the gap narrows as the hidden text gets fainter and the clean image noisier, and you would have to set a threshold on your own data. Use it to raise an alert, not to decide what gets through.
What does not work
- Telling the model to ignore instructions in images. A system prompt is a request. A team including researchers from OpenAI, Anthropic and Google DeepMind tested 12 published defences that work at the level of the model or its prompt, on text, with attacks that adapt. Most were bypassed more than 90% of the time.
- Relying on a guard model. Four of those 12 were guard classifiers. We also found no guard model that publishes evidence of catching instructions inside images. Meta’s vision guard models classify harmful content, not injections, and its injection classifier takes text only.
- Looking at the full-size image. The text is not there to see.
- Recompressing or converting the file. In our test, JPEG at quality 50 left the hidden text almost untouched.
- Choosing a “safer” fixed-window algorithm. Our bicubic image also worked against bilinear, Lanczos and one library’s nearest neighbour.
How to test your own pipeline
You can find out whether you are exposed in an afternoon, on systems you own.
- List every way an image reaches a model. Uploads, email attachments, screenshots, scanned documents, pages an agent fetches, files returned by tools.
- Find each resize. Search your code for resize calls, including canvas code that shrinks images in the browser, and check the algorithm and the anti-aliasing flag. Note where a client library or the model vendor resizes for you.
- Capture what the model receives. Log the image after resizing and compare it with the upload.
- Build a canary. Use Anamorpher, or the arithmetic above, to hide a harmless, unique string for your resizer and output size. Its README warns that results vary between implementations, so try each image several times.
- Ask the model what the image says. If the canary comes back, your pipeline reveals hidden text. Fix the resize and test again.
- Then assume it gets through. In a test environment, put a plainly visible instruction in an image, asking for a tool call that sends something out. If the tool runs without a person approving it, that is the finding that matters, whatever the resizer does.
- Keep both tests. Add them to the checks you run when a model, a client library or a tool server changes.
This is the kind of work our AI offensive security review does across a whole system: injection through the channels the system actually reads, and what a successful injection can then reach.
What this means in Australia
No Australian guidance we read mentions images or multimodal input in a security context. What it says about AI agents applies all the same, because an image from outside is untrusted input like any other.
ASD. The Australian Signals Directorate’s guidance on agentic AI, published on 1 May 2026 with its US, UK, Canadian and New Zealand counterparts, says organisations should use agentic AI only for low-risk and non-sensitive tasks, and recommends least privilege and human approval before agents take high-impact actions. Its page on agentic AI harnesses, published on 11 September 2026, says some risks, prompt injection among them, “cannot be reliably addressed within the model alone”. Its AI considerations page of 15 October 2026 says a manipulated model should not be able to exceed the access it was granted. All three point at the second layer above.
APRA. APRA’s letter to industry on AI of 30 April 2026 lists prompt injection among the attack paths it is seeing and says it expects “controls over agentic and autonomous workflows”. The letter names no prudential standard by number. For APRA-regulated entities, CPS 234 already requires a systematic programme of control testing (paragraph 27), and notice to APRA within 72 hours of becoming aware of an information security incident that materially affected the entity or its customers, or could have (paragraph 35). Those obligations bind APRA-regulated entities only.
Privacy. If an agent sends personal information to an attacker, the question is the notifiable data breaches scheme. The Privacy Act defines an eligible data breach as unauthorised access to or disclosure of personal information that a reasonable person would conclude is “likely to result in serious harm” (section 26WE). An organisation that suspects one must take all reasonable steps to finish its assessment within 30 days, and must notify as soon as practicable once it has reasonable grounds to believe one has happened. The Act does not define unauthorised disclosure, and the OAIC’s guidance on AI products does not discuss prompt injection. On our reading, an agent tricked into emailing customer records to a stranger has made an unauthorised disclosure, and whether it must be notified then turns on the likelihood of serious harm. That is our reading and not the regulator’s. Our post on the Privacy Act reforms and AI covers the wider position.
The international frameworks give you the vocabulary for a risk register.
| Framework | Where this attack sits |
|---|---|
| OWASP Top 10 for LLM Applications 2025 | LLM01 Prompt Injection, whose scenarios include a prompt embedded in an image. OWASP notes that defences specific to multimodal input still need research |
| OWASP Top 10 for Agentic Applications 2026 | ASI01 Agent Goal Hijack and ASI02 Tool Misuse and Exploitation, with outbound allowlists and action-level approval as mitigations |
| MITRE ATLAS, October 2026 release | AML.T0129 Triggers in Multimodal Inputs, AML.T0051.001 Indirect Prompt Injection and AML.T0086 Exfiltration via AI Agent Tool Invocation. Mitigations include AML.M0029, human in the loop for agent actions, and AML.M0030, restricting tool use on untrusted data |
How we can help
If you run AI features that accept images, or agents that hold tools, our AI offensive security review tests whether attacker-controlled content reaches the model with enough authority to change what it does, and chains individual weaknesses to show what that leads to. If the gap is on the defensive side, AI defence and agent containment puts in the controls this post ranks highest: default-deny outbound access, scoped credentials for each agent, human approval for irreversible actions and logs the agent cannot edit. If you are still deciding what to deploy and how, secure AI enablement builds those boundaries in from the start. And if the board is asking who is accountable for AI risk, a fractional CISO gives you a named person.
A checklist for this week
- List every path by which an image can reach a model in your systems, including through agents and tools.
- For each path, record who resizes the image and with which algorithm and flags.
- Change every downscale you control, in the browser as well as on the server, to area averaging or an anti-aliased filter, and cap the dimensions of uploads.
- Where a vendor resizes, shrink images yourself first, to the size the vendor’s published rule would produce, and where the API allows it, have oversized images rejected.
- Log the image the model received, after resizing, alongside the original.
- Find every tool an agent can call that sends data out, and require a person’s approval for each. Check that users cannot switch that approval off.
- Put a default-deny rule on outbound connections from agent environments, and stop model output from loading images from addresses you have not approved.
- Run a canary image and a visible-instruction image through each path, and add both to your regression tests.
Further reading
- Trail of Bits: Weaponizing image scaling against production AI systems
- Trail of Bits: Anamorpher on GitHub
- Xiao et al., USENIX Security 2019: Seeing is Not Believing: Camouflage Attacks on Image Scaling Algorithms
- Quiring et al., USENIX Security 2020: Adversarial Preprocessing: Understanding and Preventing Image-Scaling Attacks in Machine Learning
- Beurer-Kellner et al., 2025: Design Patterns for Securing LLM Agents against Prompt Injections
- ASD: Careful adoption of agentic AI services
- OWASP: LLM01:2025 Prompt Injection
Frequently asked questions
What is an image scaling attack?
It hides content in an image so that it appears only after the image is shrunk. Resizing algorithms that read a few pixels and skip the rest can be made to produce a different picture from the one a person sees at full size. Against an AI model that reads text in images, the hidden content can be an instruction.
How does image scaling prompt injection steal data?
The image only delivers the instruction. The theft happens when the model that reads it can reach private data and has a tool that sends something out, such as email. In Trail of Bits’ demonstration, Gemini CLI was connected to a tool server set to run without confirmation, and the hidden instruction had it email the user’s calendar data.
Which AI tools are affected?
In August 2025 Trail of Bits demonstrated the attack on Gemini CLI, Vertex AI Studio, Gemini’s web interface and API, Google Assistant on Android and Genspark. Google said the Gemini CLI case depended on a setting that is off by default. We found no published test of other vendors’ products, and the vendors we checked do not say which resizing algorithm they use.
Has an image scaling attack been used in a real breach?
We found no report of one as of 11 November 2026. There is no CVE for the technique in the US National Vulnerability Database by keyword search, and the studies of prompt injection on live web pages that we read describe text and HTML, not images.
Can I see the hidden prompt by looking at the image?
Not in a normal view. The hidden text is cancelled out by the pixels around it, so the image looks ordinary when a viewer blends pixels to fit it to the screen, as Chromium did with our test image. At full zoom a crude version shows a faint dotted texture, and better-made ones are harder to spot. The reliable way is to look at the image after your pipeline has resized it.
Does converting the image to JPEG remove the hidden prompt?
It did not in our test. Recompressing our test image at JPEG quality 50 left 97% of the hidden text in place. What removed it was resizing with an averaging or anti-aliased filter, a Gaussian blur of radius 2 before the resize, or a shift of one pixel.
Does this create obligations under Australian privacy law?
It can. On our reading, which is not the regulator’s, an AI agent that sends personal information to an attacker has made an unauthorised disclosure. An organisation covered by the Privacy Act then has to assess whether serious harm is likely, which is the test for an eligible data breach, and notify the OAIC and the people affected if it is. APRA-regulated entities also have notification duties under CPS 234.
Where to start
Start with two questions: where do images reach a model in your systems, and what can that model do without a person saying yes. If you can answer both, the checklist above is a week’s work. If you cannot, talk to us and we will help you find out. If you would rather begin with a baseline, the AI governance maturity self-assessment takes about ten minutes and gives you a scored starting point.
Stay informed
Get new posts by email.
The weekly briefing: our latest security research, at most one email a week and only when there's something new.
Continue reading
Related pieces
20 min read
PHP2Shell: why a WAF alone won't stop this PHP RCE
PHP2Shell (CVE-2026-109618, CVE-2026-109619) is fixed in PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Why a proxy alone fails, and how AI agents widen the gap.
- Vulnerability management
- LLM security
- AI agents
21 min read
OpenAI Medicare hack: what it means for Australia's AI guardrails
An OpenAI agent got into a Medicare portal and Australia found out three months later. The verified timeline, legal gaps, coming guardrails, and what to do.
- AI governance
- AI agents
- Regulation
15 min read
Jailbroken AI as an attack tool: how attackers actually use it, and how to defend
Attackers jailbreak frontier models, rent dark LLMs like WormGPT, and bolt AI onto phishing, deepfake fraud, and agentic intrusions. The documented tradecraft, the real incidents, and the defence-in-depth controls that hold, with Rust guardrail code.
- AI agents
- Jailbreaking
- Prompt injection