Skip to main content

Snap Safe India

A photo privacy agent for India: it finds what a stranger could learn from your photo, hides only that, and checks again.

People in India post photos with Aadhaar and PAN cards, number plates, UPI screens, courier labels and house name boards in the frame, and a stranger can use every one of them. Snap Safe India looks at a photo the way a stranger would, finds those clues, plans the fewest edits that hide them, makes the edits, and attacks the result again to check. It never prints the names, addresses or numbers it finds.

How it works: (1) a vision model lists every clue with a box and how precisely it gives you away; (2) our code plans the fewest edits that break every way a stranger could learn something, including details that are harmless alone but revealing together; (3) it pixelates inside tight boxes only, or optionally covers text with the surrounding colour (clean fill), and strips EXIF and GPS; (4) it attacks the edited photo again, up to four times; (5) a final literal read of the result decides whether it may call the photo safe. The model sees; the harness (MIT, in this repo) decides, edits and verifies.

India-specific: Aadhaar with the Verhoeff checksum, PAN, GSTIN, voter ID, number plates including the BH series, UPI IDs, IFSC codes, Indian phone numbers, PIN codes and address words, plus Telugu, Hindi and Tamil text. Reports can be written in English, Telugu or Hindi. India is one region pack among several (one file per country; a US pack is included).

Models: Gemini 3 Flash is the main model. Gemma 4 (26B-A4B, open weights, through the Gemini API) ran our whole ten-scene benchmark and 15 of the 20 recorded samples, and the code uses it as an automatic fallback when Gemini’s quota runs out. Any OpenAI-compatible vision model plugs in. Several API keys can be pooled and rotated.

Evidence (generated images, one run per setting, so small): Gemma 4 on ten scenes removed 47 of 48 planted fictional secrets with the India pack on and 41 of 48 with it off; Gemini 3 Flash on the five core scenes removed 19 of 19. A final-read check raised the ID card scene from 2 of 7 to 7 of 7. The pattern checker scored F1 0.915 on 75 hand-written texts.

Front ends: a web page with 20 replayable recorded runs (no key needed), a Telegram bot (tested on real Telegram), and a WhatsApp webhook prototype (future scope, not live-tested). Deployed on Render.

Honest limits: “Verified” is the agent’s own re-check, not proof; boxes are sometimes larger than the text; the benchmark images are generated, not real documents; in a live run the photo goes to the model’s host, so use made-up photos. Gemma 4 returned errors for image input on the Gemini API during our testing on the day of the event, so we have not seen the live fallback work.

We added the India detection and checksums, region packs, languages, box tightening, the final check, clean fill, the key pool and fallback, the benchmark, the interface and the bots.

Built with

pythonfastapiopencvnumpypillowjavascripthtmlcssdockerrendergeminigemmatelegramopenai

AI tools

Coded withClaude CodeClaude Sonnet 5.5CodexAntigravityOpenCodeGoogle AI StudioGemini 3.8 FlashGemini 3.5 Flash LiteClaude Opus 5.5GPT-5.5

Prize Categories Entered

  • Deepmind Google

    Best Use of Gemma 4

    Submitted

    Snap Safe India uses Gemma 4 (26B-A4B-it, through the Gemini API) as its open-weight vision model: it reads a photo's text and image together, lists each clue (an ID number, a plate, an address) with a box, and writes the privacy report in English, Telugu or Hindi. Gemma 4 ran our full ten-scene benchmark (47 of 48 planted fictional secrets removed with our India pack, 41 of 48 without) and recorded 15 of our 20 replayable samples. The code also uses it as the automatic fallback when the main model, Gemini 3 Flash, runs out of quota. Honest limits: Gemma's boxes are looser and it is slower (about 200 s a scene), and on event day it returned errors for image input on the API, so the live fallback is untested.

  • DigitalOcean

    Best Open-Source AI Project

    Submitted

    Snap Safe India is an MIT-licensed open-source harness around a vision model: the model finds the clues, and our code plans the fewest edits (a minimum-cost hitting set), edits only inside tight boxes, attacks the result again, and does a final literal read before calling a photo safe. Open-weight Gemma 4 ran our whole benchmark and most recorded samples and is the automatic fallback; any OpenAI-compatible model plugs in through two settings, and several API keys can be pooled. Region packs add a country in one file (India: Aadhaar checksum, PAN, UPI, plates, Telugu, Hindi and Tamil text). The repo ships an agent skill file (SKILL.md), CONTRIBUTING.md, offline tests and a reproducible benchmark, and credits the MIT project it adapts (before-you-post). Limit: the main live model, Gemini 3 Flash, is closed.