Sunglasses: Open-Source Input Defense Layer for AI Agents
Key Takeaways
- ▸Free, open-source input defense layer designed specifically for AI agents to block prompt injection and credential exfiltration attacks
- ▸Operates 100% locally in-browser or via CLI with no cloud calls, API keys, or telemetry; image OCR never leaves the user's device
- ▸Supports comprehensive input formats including text, images, audio, video, PDFs, and QR codes with detection across 23 languages
Summary
Sunglasses is a new free, open-source input defense layer designed to protect AI agents from prompt injection attacks and other malicious inputs hidden in normal-looking content. The tool filters emails, web pages, images, audio, video, PDFs, and QR codes before they reach an AI agent, stripping hidden instructions while allowing legitimate content to pass through unmodified. Operating 100% locally with no cloud dependencies, API keys, or telemetry, Sunglasses runs in users' browsers at sunglasses.dev/scan or as a command-line tool.
The tool detects sophisticated attack vectors including prompt injection in 23 languages, credential exfiltration attempts, social engineering tactics, and evasion techniques like Unicode obfuscation, leetspeak, Base64 encoding, and homoglyph substitution. It processes multiple input formats through specialized modules: OCR and EXIF metadata scanning for images, speech-to-text and audio metadata analysis, video subtitle and audio transcription, PDF text and annotation extraction, and QR code decoding. Average scanning latency is less than 1 millisecond.
Sunglasses positions itself as a foundation layer in a defense-in-depth strategy for AI agent security, explicitly acknowledging comparable tools like Lakera Guard, LLM Guard, and NVIDIA NeMo Guardrails while highlighting its unique value proposition of local-only operation and zero infrastructure requirements. The project includes an adapter system for integration with other security tools in the same pipeline, supporting both standalone and combined deployment scenarios.
- Detects sophisticated evasion techniques including Unicode obfuscation, Base64 encoding, RTL tricks, and homoglyph substitution
- Available as a web demo, pip package, and CLI tool; designed to work alone or integrate with other security tools as a pipeline layer



