Sunglasses is a filter that sits ahead of your LangChain agent. Always ON. Every input the agent would process — the callback scans first. No opt-in. This page walks through the LangChain wiring.
Who this page is for
LangChain devs building custom agents on top of ChatAnthropic, ChatOpenAI, or any other LangChain-wrapped LLM. Drop-in callback integration — every input the agent processes runs through the filter first, before the LLM sees it.
The command
from sunglasses.integrations.langchain import SunglassesCallback
Mandatory filter for every LangChain input. Drop the callback into your LLM wrapper. Every input the agent processes — user messages, tool responses, retrieved documents — is scanned before the LLM sees it.
Benefit: This is framework-level enforcement. Unlike MCP (agent opts in per call), the callback fires on every single input. 100% coverage within your LangChain pipeline.
Full walkthrough coming next. This is an identity-first scaffold — the core command and wiring pattern are ready. The full step-by-step code walkthrough, integration examples, and troubleshooting section are being drafted now. Check back shortly.
Where this wiring fits
Sunglasses is one filter with four wiring options. This page covers the LangChain path. Other wiring paths:
- Claude Code / Claude Desktop — MCP server registration
- LangChain — mandatory callback filter
- CrewAI — between-agent filter for multi-agent crews
- Custom Python agent — SDK middleware for any LLM call
Same filter underneath. Different wiring based on your stack.