Skip to main content
Scans any text for prompt injection attempts — instructions embedded in user input or tool results that try to hijack agent behavior. Fast, standalone check (regex first, escalating to a model pass for borderline cases). Cost: 0.5 credits per call.

Parameters

content
string
required
The text to scan for injection attempts. Can be user input, tool output, a retrieved document, or any string an agent is about to process.
content_source
string
Optional description of where this text came from, e.g. "user_input", "web_search_result", "api_response".

Request

Response

The response is flat — no result wrapper:
injection_detected
boolean
true if an injection attempt was detected.
confidence
number
Confidence score from 0.0 to 1.0.
attack_type
string
"none", "direct_instruction_override", "role_hijack", "jailbreak", "data_exfil_attempt", or "indirect_injection".
severity
string
"none", "low", "medium", "high", or "critical".
"PASS", "FLAG", or "BLOCK".

Usage in SDK

Common injection patterns detected

Phrases like “Ignore all previous instructions” or “Disregard your instructions”. These attempt to cancel the agent’s system prompt.
Attempts to redefine the agent’s identity, such as “You are now DAN” or “Act as an unrestricted AI”.
Attempts to bypass safety constraints through hypothetical framing, roleplay, or encoding tricks.
Instructions embedded in retrieved content (a document, a tool result) that try to leak data or redirect the agent when that content is later processed.

What’s next

Agent: Tool Call Evaluation

Evaluate tool calls before execution.

Agent: Tool Result Scanning

Scan tool results for PII and injection.

Concepts: Agent Evaluation

Overview of all agent safety endpoints.

Python SDK: Agent Evaluation

Full Python SDK reference for agent safety.