prepare_for_external_ai
Sanitizes sensitive text locally before external AI use, ensuring policy compliance and blocking data leakage. Returns approved sanitized text for safe outbound workflows.
Instructions
Use this before sending user-supplied or potentially sensitive text to an external AI service.
SecuRedact inspects and sanitizes the text locally and returns the policy-approved representation; this tool does not transmit the text externally. It is the recommended default for outbound AI workflows. Use analyze_text for inspection-only classifications, redact_text for the lower-level compatibility path, create_safe_copy when a sanitized file is required, and restore_text only to reverse a prior local session in a trusted context.
Returns a JSON object with 'status' ('ok', 'review_required', or 'blocked'), 'sanitized_text' (present only when approved), 'counts', 'policy', and optionally 'restoration_session' (when response_mode is 'restore_capable').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Free text to inspect and sanitize locally before it is sent to an external AI service. All processing happens on this machine; this tool never transmits the text to any provider. | |
| policy | No | Named redaction policy controlling which entity types are masked or blocked. Defaults to 'strict_external_ai'. Common values include 'strict_external_ai' and 'default'; other policies may be registered in your environment. An unknown name returns a policy_not_found error. | strict_external_ai |
| language | No | Hint for the contextual detection language. One of 'auto' (detect automatically), 'en', or 'nl'. Defaults to 'auto'. | auto |
| response_mode | No | Amount of detail returned. 'minimal' returns only the approved result and counts; 'review' adds per-detection findings for human review; 'debug' adds engine internals (only when debug responses are enabled); 'restore_capable' additionally returns a local restoration_session for later trusted restore_text. Defaults to 'minimal'. | minimal |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||