Edge HTML Sanitizer, Script Stripper & XSS Neutralizer
sanitize_html_contentSanitizes untrusted HTML by removing scripts, iframes, inline event handlers, and data URIs to produce safe markup for agent dashboards or email clients.
Instructions
Sanitizes raw HTML by removing malicious script tags, iframes, inline event handlers, and data URIs into safe markup. Use when preparing untrusted third-party web content for rendering in agent dashboards or email clients; for converting clean HTML into markdown, use extract_clean_markdown instead. Stateless read-only edge call (max 32 KB, 60 RPM): accepts 'html_content' ('sanitization_strictness' defaults to 'strip_scripts_and_iframes'), supports '?demo=true' or L402 (10 sats), and returns HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html_content | Yes | Untrusted or potentially hazardous HTML string requiring sanitization. | |
| preserve_images | No | Whether to retain safe img elements with http/https sources. | |
| sanitization_strictness | No | Sanitizer filter policy: strip scripts and iframes, allowlist safe formatting, or plaintext strip all. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sanitized_html | Yes | Safe, purified HTML output free of active scripting threats. | |
| elements_removed | Yes | List of dangerous tags and attributes removed during processing. | |
| xss_vectors_neutralized | Yes | Count of potential script execution vectors disarmed. |