Lion Cipher Lab

Harden a multimodal ingestion pipeline against image-borne instructions

Why it matters

The moment your application lets a person attach a picture or a document, you have quietly added a set of instruction-carrying channels that almost nobody enumerates, and the ones people do think of are not the dangerous ones. Everybody has now heard of prompt injection -- untrusted text that reaches a model's prompt and is read as instruction rather than as data -- and most teams have written some kind of filter for it. Almost all of those filters look at the chat box. Meanwhile the upload path is quietly doing something far more generous: a metadata extractor dumps every PNG text chunk and…

What you'll learn

Steps in this lab

  1. What this lab is, and the three words you need before you start
  2. Why the upload path and not the chat box (and what this is NOT)
  3. Zero-assumption setup: a terminal, Python, and a folder
  4. Create mmpipe.py -- the pipeline, the parsers, the font and the stub
  5. Create measure.py -- the harness that counts everything
  6. Run it once, and read the headline
  7. Section [1]: twenty channels on ONE upload
  8. Section [2]: the pixel channel, proved rather than asserted
  9. Section [3a]: strip all metadata -- what it closes, and what it costs
  10. Section [3b]: the keyword denylist, and the five variants that beat it
  11. Section [3c]: refuse images containing text -- the defense that deletes the product
  12. Section [3d]: provenance tagging -- what it proves, and what it does not
  13. Section [3e]: capability gating -- the one that holds, and the trap inside it
  14. Failure mode 4a: sanitize-then-reparse (the chunk that lives after the image)
  15. Failure mode 4b: the channel nobody enumerated
  16. Failure mode 4c: encoding order -- you scanned the wrong bytes
  17. Failure mode 4d: one instruction, two channels
  18. Failure mode 4e: the resizer that helpfully copies it forward
  19. Judgment: why this, not that -- input filtering versus action gating
  20. Find it in your own pipeline: the review a professional actually runs

Open the full interactive lab →