create_safe_copy
Sanitize text locally and write the approved result to a new file for safe storage, without overwriting existing files or transmitting data.
Instructions
Sanitize text locally and write the approved result to a new file in the Safe Copies directory.
Use this when you need a sanitized on-disk copy (for storage, handoff, or archival) rather than an in-memory sanitized string. For the sanitized text only, use prepare_for_external_ai; for inspection-only use analyze_text; for reversing a prior session use restore_text.
Side effects: a new file is written to the directory set by SECUREDACT_SAFE_COPY_DIR. The supplied 'content' is not modified and no existing file is overwritten. The filename must be a bare '.txt' or '.md' basename (no path separators or directory traversal). The operation blocks and reports 'blocked' if the directory is unconfigured, the filename is invalid, or policy blocks the content.
Returns a JSON object with 'status' ('ok' or 'blocked'), 'filename', and 'counts'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policy | No | Named redaction policy applied before writing. Defaults to 'strict_external_ai'. An unknown name returns a policy_not_found error. | strict_external_ai |
| content | Yes | Text to sanitize locally and write to disk. Processed on this machine; never transmitted. | |
| filename | Yes | Bare target filename (no directory components) ending in '.txt' or '.md'. The file is created inside the configured Safe Copies directory; an existing file is never overwritten. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||