Skip to content

Documents

Agent Mask can process supported documents with the same entity configuration, languages, and operators used for plain text. Pass document bytes as base64-encoded, zlib-compressed input to mask(), then read the text output, redacted file output, and metadata fields that apply to that format.

FormatUse forReturned output
PDFNative and scanned PDFs, including visual redaction, annotation mode, and optional searchable text layers.De-identified extracted text, optional redacted PDF, document metadata, and optional redaction metadata.
DOCXWord document text extraction and de-identification.De-identified extracted text and document metadata. DOCX inputs do not return an edited or redacted .docx file.
DICOMMedical imaging files with PHI in configured metadata tags or OCR-detected burned-in pixel text.Optional redacted DICOM, document metadata, and optional pixel redaction metadata.
ImagesPNG, JPEG, and TIFF files that need OCR and visual redaction.OCR text after replacement, optional redacted image, document metadata, and optional redaction metadata.
RTFRich Text Format documents where plain text output is enough.De-identified extracted text and document metadata. RTF inputs do not return a redacted .rtf file.
ZIP archivesArchives that contain supported documents or UTF-8 text files.Per-entry de-identified results. A redacted archive is returned only for entries that produced redacted binary output.

Use include_redacted_document only when the input format supports redacted binary output, such as PDF, image, or DICOM:

SELECT app_public.mask(
'<compressed_base64_file>',
OBJECT_CONSTRUCT(
'include_redacted_document', TRUE,
'include_redaction_metadata', TRUE
)
);

Text-only formats such as DOCX and RTF return their de-identified content in columns[0].deidentified_text. For document inputs, columns[0].original_text can contain the extracted source text before replacement; treat it as sensitive if you include it in downstream workflows.

Document output depends on text extraction, OCR quality, document structure, selected language, configured entities, and operator settings. Review output before external sharing, regulated disclosure, or public release. Analyzer results, entity ledger entries, document metadata, and redaction metadata can help your team inspect what was detected and replaced.