# trailofbits/anamorpher

image scaling attacks for multi-modal prompt injection

Repository: https://github.com/trailofbits/anamorpher
Canonical: https://ross.abutalabs.com/products/anamorpher
Language: Python
License: Apache-2.0
License Family: permissive
Last push: 2026-05-19T20:12:03+00:00

## Health v2 (maintenance only)
Score: 55/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 83, release rhythm 35, longevity 27
- inputs: {"age_days": 378, "days_push": 106, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1075, forks 91 (observed 2026-08-28T04:03:29.235045+00:00)

## What it is
Anamorpher is a tool for crafting and visualizing image scaling attacks that hide multi-modal prompt injections in images, revealed only when the image is downscaled. It provides a web frontend for comparing payload effectiveness across downscaling implementations (OpenCV, PyTorch, TensorFlow, Pillow) and a modular Python API for custom scaling implementations.

## Use cases
- generate images that hide prompt injection payloads revealed on downscaling
- test whether a multimodal AI system is vulnerable to image scaling attacks
- compare bicubic, bilinear, and nearest neighbor downscaling implementations for attack susceptibility
- evaluate payload effectiveness across OpenCV, PyTorch, TensorFlow, and Pillow scaling
- research adversarial preprocessing attacks on vision-language models
- build custom downscaling implementations to test with the Python API

## When to choose
- red-teaming or security-testing multimodal AI systems against image scaling prompt injection
- researching image-scaling attack vectors described in the Trail of Bits blog post
- you need a visual interface to compare downscaling algorithm behavior on adversarial images

## When to avoid
- you need general-purpose image resizing or editing rather than attack payload generation
- you need a production-ready, stable tool - it is in active beta with probabilistic results
- your environment is Windows without WSL2, due to TensorFlow dependencies

## Facets
- artifact type: application
- maturity: active
- function: image-processing, security, penetration-testing, machine-learning, gui
- domain: security, machine-learning, artificial-intelligence, image-processing, penetration-testing
- platform: python
- tags: adversarial-ml, prompt-injection, image-scaling-attack, multimodal-ai, red-team, attack-tool, linux, macos, web-server

## Member repositories
- trailofbits/anamorpher (main) score 55

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:29.235045+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:53:28.642949+00:00, confidence not recorded.
  - readme: https://github.com/trailofbits/anamorpher (fetched 2026-08-28T04:03:29.235045+00:00, sha eadfea653b39)
- Data as of 2026-08-30T08:39:29.467469+00:00.
