{"record":{"id":"3ef4cace7b4dd910","repo":"paperclipai/paperclip","slug":"prompt-injection-blocked","errorCode":"prompt_injection_blocked","errorMessage":"Tool result contained prompt-injection instructions and was blocked","messagePattern":"Tool result contained prompt-injection instructions and was blocked","errorType":"validation","errorClass":"ToolContentValidationError","httpStatus":502,"severity":"error","filePath":"server/src/services/tool-content-guards.ts","lineNumber":245,"sourceCode":"}) {\n  const sensitiveMode = input.sensitiveMode ?? \"redact\";\n  const promptInjectionMode = input.promptInjectionMode ?? (input.direction === \"result\" ? \"block\" : \"ignore\");\n  const redactedValue = isPlainObject(input.value) ? redactEventPayload(input.value) : input.value;\n  const redactedSummary = summarizeToolValue(redactedValue);\n  const findings: string[] = [];\n\n  if (redactedSummary.redactedFields?.length) {\n    findings.push(\"sensitive_value\");\n    if (sensitiveMode === \"block\") {\n      throw new ToolContentValidationError(\"Tool content contains sensitive values\", \"sensitive_value_blocked\", findings);\n    }\n  }\n\n  const promptFindings = promptInjectionMode === \"ignore\" ? [] : scanPromptInjection(input.value);\n  if (promptFindings.length > 0) {\n    findings.push(...promptFindings);\n    if (promptInjectionMode === \"block\") {\n      throw new ToolContentValidationError(\n        \"Tool result contained prompt-injection instructions and was blocked\",\n        \"prompt_injection_blocked\",\n        promptFindings,\n      );\n    }\n  }\n\n  return {\n    value: redactedValue,\n    summary: redactedSummary,\n    findings,\n  };\n}\n","sourceCodeStart":227,"sourceCodeEnd":259,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/tool-content-guards.ts#L227-L259","documentation":"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.","triggerScenarios":"Thrown at server/src/services/tool-content-guards.ts:233 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}