Indirect Prompt-Injection, Invisible Unicode & Beacon Output Scrubber
sanitize_tool_output_streamSanitizes untrusted external tool or web-scrape output by removing invisible Unicode Tag characters, disarming tracking beacons, and blocking indirect prompt overrides before LLM context.
Instructions
Sanitizes untrusted external tool or web-scrape outputs by stripping invisible Unicode Tag characters (U+E0000), neutralizing Markdown tracking image beacons, and defusing indirect prompt overrides. Use when cleaning raw third-party tool outputs or scraped web text before inserting it into the LLM context window; for redacting personal identifiable information (emails, SSNs, keys) from outbound text, use redact_sensitive_pii instead. Read-only edge call (32 KB, 60 RPM): accepts 'raw_tool_output' (with enum defaults), uses '?demo=true' or L402 (15 sats); HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wrap_tag | No | XML isolation wrapper applied around the sanitized text; defaults to 'tool_data' when omitted. | |
| raw_tool_output | Yes | Untrusted text returned by an external tool, webhook, or web scraper. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sanitized_output | Yes | Cleaned text with invisible Unicode, tracking beacons, and overrides neutralized. | |
| threats_neutralized | Yes | List of smuggling or injection vectors stripped from the input. | |
| injection_risk_score | Yes | Threat score from 0.0 to 0.99 prior to sanitization. | |
| safe_for_context_ingestion | Yes | True once the sanitized payload is safe to feed to the LLM. |