paperclipai/paperclip · error · ToolContentValidationError
prompt_injection_blocked
prompt_injection_blocked
Error message
Tool result contained prompt-injection instructions and was blocked
What it means
Prompt-injection guard in validateToolContent: the tool result matched injection patterns and promptInjectionMode is block (the default for results), so it is refused before reaching the model. The remote tool result embedding instruction-like text is at fault.
Source
Thrown at server/src/services/tool-content-guards.ts:245
}) {
const sensitiveMode = input.sensitiveMode ?? "redact";
const promptInjectionMode = input.promptInjectionMode ?? (input.direction === "result" ? "block" : "ignore");
const redactedValue = isPlainObject(input.value) ? redactEventPayload(input.value) : input.value;
const redactedSummary = summarizeToolValue(redactedValue);
const findings: string[] = [];
if (redactedSummary.redactedFields?.length) {
findings.push("sensitive_value");
if (sensitiveMode === "block") {
throw new ToolContentValidationError("Tool content contains sensitive values", "sensitive_value_blocked", findings);
}
}
const promptFindings = promptInjectionMode === "ignore" ? [] : scanPromptInjection(input.value);
if (promptFindings.length > 0) {
findings.push(...promptFindings);
if (promptInjectionMode === "block") {
throw new ToolContentValidationError(
"Tool result contained prompt-injection instructions and was blocked",
"prompt_injection_blocked",
promptFindings,
);
}
}
return {
value: redactedValue,
summary: redactedSummary,
findings,
};
}
View on GitHub (pinned to 01ad858492)
Solutions
- The tool result was blocked by the prompt-injection guard. Treat the source as untrusted; sanitize or avoid passing that content to the agent, and review the flagged patterns.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/tool-content-guards.ts:233 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/3ef4cace7b4dd910.
Report an issue: GitHub.