Skip to main content
CrewAI uses LangChain’s callback protocol under the hood, so the LangChain integration applies directly. Pass BenchGuard as a callback on the Crew and every tool output flowing through any agent gets scanned.
Python only. CrewAI doesn’t publish an official TypeScript SDK.

Install

Usage

crew.py

What gets scanned

Every tool result returned to the LLM inside any agent of the crew. System prompts and agent-to-agent messages (the assistant role) are not scanned; they’re inside your trust boundary.

Common pitfalls

BenchGuard only scans string content. If your tool returns a dict, convert to JSON before returning, or scan the relevant string field(s) manually with guard.scan(text, role="tool").
Construct one BenchGuard per agent and attach each crew-by-crew. You can have some crews in warn mode for evaluation and others in block for production.