Sunglasses is a filter that sits ahead of every agent in your CrewAI crew. Always ON. Every message an agent sends or receives — the filter scans first. This page walks through the CrewAI wiring.
Who this page is for
CrewAI devs running multi-agent crews where agents pass work to each other. Cross-agent injection, forged handoff tickets, and replayed approval receipts are real attack surfaces in A2A workflows. The filter sits between agents and scans every message before it becomes an action.
The command
from sunglasses.integrations.crewai import sunglasses_scan
Filter between every agent in the crew. Add the filter to your Task or Crew definition. Every message passing between agents — researcher to writer, planner to executor, any handoff — gets scanned before the downstream agent acts on it.
Benefit: A2A is the easy part. Trust is the hard part. The filter turns every inter-agent message into a scanned input, not an implicitly trusted one.
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.
FAQ
How do I secure a CrewAI multi-agent system?
Import sunglasses_scan from sunglasses.integrations.crewai and wire it into your Task or Crew definition. Every message between agents is filtered before the receiving agent acts on it.
What is cross-agent injection?
Cross-agent injection is when hostile content in one agent's output tries to manipulate another agent in the crew. Forged handoff tickets, replayed approval receipts, and spoofed delegation tokens are common patterns. The Sunglasses filter catches these at the boundary between agents.
Does this work with CrewAI hierarchical and sequential processes?
Yes. The filter attaches to the Crew or individual Tasks and scans inputs regardless of process type — sequential, hierarchical, or custom.
Is this mandatory or opt-in per handoff?
Mandatory. Once wired into the Crew or Task, every input the agent receives passes through the filter — no per-call opt-in.
Does Sunglasses slow down the crew?
Average scan time is 0.26ms. A filter pass is negligible compared to an LLM call. For a 5-agent crew passing 20 messages, total filter overhead is roughly 5ms.
Where this wiring fits
Sunglasses is one filter with four wiring options. This page covers the CrewAI 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.