# Export and sanitize evidence

An export is an explicitly reviewed derivative of a report revision. Review narrative, source snapshots, diagnostic values and attachment bytes before a bundle or provider sees them.

## Supply a named policy

`createReportBundle(report, options)` requires an export ID, timestamp, attachment reader and named sanitization policy. The [first bug-report example](../getting-started/first-bug-report.md) demonstrates the API with known authored text and no attachment inclusion.

For real data:

1. `reviewReport` reviews the complete report, including filenames, diagnostic keys/values and executable instructions, while preserving identity.
2. `readAttachment` supplies actual bytes by evidence ID or `null` for unavailable data.
3. `reviewAttachment` explicitly supplies reviewed replacement bytes or omits the attachment.

Retrieval/review errors abort export. There is no raw fallback or implicit pass-through of screenshots/video. A policy may safely omit binaries until it has a suitable review process.

## Understand redaction limits

`redactReportSecrets` replaces exact supplied strings, including nested keys/values. It is not automatic sensitive-data detection or an image/video sanitizer. The host owns review rules and cannot infer complete safety from the helper alone.

Sanitization clears affected reproduction/step verification. Changed scripts become incomplete; unavailable/omitted/transformed proof cannot retain stale verification claims. The in-memory original is not edited by export.

## Preserve the complete bundle

The bundle contains reviewed `report.json`, a local `index.html`, and optional generated `attachments/` paths. Copy the entire directory or archive it together. The host chooses filesystem/download/archive transport.

The manifest records reviewed/redacted/omitted/unavailable states without removed values. `importReportBundle` validates format, references, paths, byte lengths and viewer consistency. Import never executes script fields and is not a trust or sanitization decision.

## Provider delivery

`submitBugReport` uses the same review boundary and passes a complete sanitized bundle to a host provider. It does not ship a live Jira/Linear adapter, retry automatically, or synchronize edits. Partial delivery can preserve a created ticket reference in `IncompleteDeliveryError.delivery`.

See [canonical export details](../../../integration/portable-reports.md#sanitization-and-self-contained-export), [bundle formats](../reference/report-and-bundle-formats.md), and [public entries](../reference/public-api.md).
