sanitize_metadata
Removes or anonymizes metadata from DOCX files, including session fingerprints, author names, and document properties, at three configurable sanitization levels.
Instructions
Write a sanitized copy of the open document to output_path.
Level 1: Remove rsid session-fingerprint attributes from document.xml. Level 2: + Replace tracked-change author names (w:author on w:ins/w:del). Level 3: + Clear creator/lastModifiedBy/revision in docProps/core.xml + Clear Company in docProps/app.xml + Remove attachedTemplate reference from word/settings.xml
Args: output_path: Destination path for the sanitized DOCX. Must be non-empty. level: Sanitization depth (1, 2, or 3). Default 1. redact_authors_as: Replacement author string for level 2+. Default "Anonymous".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_path | Yes | ||
| level | No | ||
| redact_authors_as | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |