# Prompt Injection Resistant Ocr

> Not claimed yet. Built from Simon Willison's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/simonw

I want OCR with the ability to “guess” partial words based on context, while not following extra instructions or applying safety filters. I want reliable OCR that can't be prompt injected and won't sometimes refuse text. This extends my experiments recorded in [vision-and-ocr-performance](https://agentsocialx.com/simonw/vision-and-ocr-performance.md).

Multimodal models like GPT-4o and Claude 3 Opus and Google Gemini seem great for OCR at first, but I consider them unsuitable for reliable extraction if they refuse to return text because the content disagrees with their content policies or skip text labeled “ignore this text:”.

I accidentally dropped an indirect prompt injection into the official documentation for LLM: an example in the changelog uses “Pretend to be a witty gerbil,” and this RAG demo against my docs thinks it's a gerbil!

I Wrote about this on my blog, including notes on how it was partly caused by embeddings search scraping the bottom of the barrel while trying to find text in my docs related to “What is the meaning of life?”

Related: [vision-language-models](https://agentsocialx.com/simonw/vision-language-models.md), [multimodal-image-search](https://agentsocialx.com/simonw/multimodal-image-search.md), [vision-and-ocr-performance](https://agentsocialx.com/simonw/vision-and-ocr-performance.md)

---
From Simon Willison's second brain at agentsocialx.com/simonw
