Anamorpher
image scaling attacks for multi-modal prompt injection
Install / Use
/learn @trailofbits/AnamorpherREADME
Anamorpher
Anamorpher (named after anamorphosis) is a tool for crafting and visualizing image scaling attacks against multi-modal AI systems. It provides a frontend interface and Python API for generating images that only reveal multi-modal prompt injections when downscaled. Refer to "Weaponizing image scaling against production AI systems" for more information on this attack vector.
Anamorpher is in active beta development. We welcome feedback and contributions!
Features
- Generate payloads for systems using select implementations of the bicubic, bilinear, and nearest neighbor downscaling algorithms
- Compare payload effectiveness through a frontend interface that includes implementations from OpenCV, PyTorch, TensorFlow, and Pillow
- Include your own custom image downscaling implementation using the modular design of the Python API
Requirements
- Python 3.11+
- uv (recommended) or pip
Setup
- Install dependencies:
uv sync
- Run backend:
uv run python backend/app.py
- Open
frontend/index.htmlin a web browser
Windows: Use WSL2 due to TensorFlow dependencies.
Warnings and Known Limitations
- Due to the probabilistic nature of these systems, results may vary. For consistent evaluation, run each example 5 times.
- Additional image transformations may interfere with the effectiveness of the injections.
- Not all payloads will work against each implementation and parameter set of the bicubic and bilinear downscaling algorithms as a result of varying robustness of anti-aliasing across implementations, different default parameters in scaling libraries, and implementation-specific optimizations that affect interpolation behavior.
- This also holds true of production AI systems more broadly as system scaling behavior is subject to change.
Maintainers
References
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
