Skip to main content
Every scan takes a role parameter. The role tells Benchspan whether the content came from a user (the person interacting with your agent) or from a tool (a function call result, document fetch, API response, email body, etc.).

Supported roles

The classifier weights patterns differently per role. Tool-origin content is the dominant attack vector for agents (IPI hiding in scraped web pages, emails, docs), and the model has been trained specifically on that distribution.
Not scanned: system (your own instructions) and assistant (the model’s own output). These are your trust boundary. The framework integrations skip them automatically.

What to pass

The source field

An optional source lets you tag which tool the content came from. It shows up in the dashboard so you can see which tools produce the most injections.
When you use a framework integration (LangChain, OpenAI Agents, etc.) and your tool has a name, the SDK auto-populates source for you.

The agent field

When constructing BenchGuard, pass agent="my-agent-name" to tag every scan with the agent identifier. This lets you filter usage per agent in the dashboard. Useful if you run multiple distinct agents on the same workspace.