redact_text
Permanently remove sensitive text from Word documents, scanning body, headers, footnotes, and metadata. Verifies successful redaction and reports unexamined content, leaving the file unchanged on any error.
Instructions
Permanently REMOVE matched text (true redaction: the characters are replaced in the XML, not highlighted). targets: [{find, regex?}]. Runmap-safe: secrets fragmented across Word's split runs are removed as one match. Scrubs body incl. tables, headers/footers, footnotes/endnotes (per scope: body | headers | footnotes | all), and ALWAYS: comment text, document properties, hyperlink text/tooltips/URL targets, field instructions, cached field results, tracked-change deleted text. Reports per-class counts, what was NOT examined (images, charts, OLE; text drawn in an image is not redacted), and verified_clean from a full post-redaction re-scan. Zero-width regexes and empty finds are refused up front; any error leaves the file unchanged. Irreversible in the saved file: the prev backup slot is the undo. Auto-backup: prev/anchor slots in .ks4w-backups (backup=False skips rotation only); atomic validated save. Refuses documents open in Word.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scope | No | all | |
| backup | No | ||
| targets | Yes | ||
| file_path | Yes | ||
| replacement | No | [REDACTED] |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||