Skip to main content
Defender scans tool call responses for prompt injection before they reach your LLM. It runs server-side on every RPC call, so it protects any agent — MCP, the Agent SDK, or a direct API call — regardless of language. Project-wide settings live in the dashboard — see Defender for the concept and configuration. This page covers per-toolset overrides in the SDK.

Per-toolset SDK configuration

Per-toolset SDK configuration is currently available only in the TypeScript SDK (@stackone/ai). Python agents still get Defender via the dashboard setting — it runs server-side on every call.
Override the dashboard setting for a specific toolset with the defender option on StackOneToolSet. It accepts four shapes:
When Defender runs, the RPC response includes a defenderMetadata sibling next to data with the risk level, sanitized fields, and detections. See the full TypeScript reference for every config field, the resolved-mode getter, and the override warnings.