# Output sanitisation

> How build, test and crash output reaches the person without carrying Occluded source, and what happens to downloads.

Source: https://occlude.dev/docs/output/ · Reviewed 28 November 2026

Occluded source can escape without anyone opening a file: in a crash, a test report, a coverage file. Every byte from the build's side passes the sanitiser before it reaches the person.


## A failure inside an Occluded module

```text
 FAIL  <protected module>
RangeError: <protected module>
 ❯ <protected module>
 ❯ summarizeInvoice src/web/invoices/summarizeInvoice.ts:11:18
 ❯ <protected module>

 Test Files  1 failed | 25 passed (26)
      Tests  1 failed | 399 passed (400)
```

The contractor sees that the failure is past the boundary, and which of their own lines led there. They do not see the code, the error's message or the protected test's name. The walk-through shows [this run](https://occlude.dev/demo/#contractor-5) next to [a full-access engineer's](https://occlude.dev/demo/#engineer-5).

## What it does to text

| Control | What it catches |
|---|---|
| **Protected frames** | Stack frames and lines naming an *Occluded* path collapse to `<protected module>`. The frame in the person's own file stays |
| **Source matching** | Output that reproduces code from an *Occluded* file, verbatim or reformatted, is redacted |
| **Encoded text** | Long encoded runs are redacted |
| **Secrets** | An injected secret's value is replaced by its name |

The full, unsanitised output goes to the record, readable by authorised staff.

## Other routes out

| Route | Control |
|---|---|
| Error messages that reveal existence | `ENOENT` everywhere. Never "permission denied" |
| A debugger stepping into *Occluded* frames | Debugger traffic is filtered: step-into across the boundary becomes step-over, variables of *Occluded* frames are withheld, and requests for their source get `ENOENT` |
| Coverage reports, source maps, bundle output | Filtered before download: files under *Occluded* paths are removed, and source maps for *Occluded* modules are never emitted |
| A visible script reads an *Occluded* file | On the person's side it gets `ENOENT`. Inside a test on the build's side, its output is sanitised, and code that reads *Occluded* paths is flagged before it runs |

## Downloads

`occlude artifact <path>` is the only way to take a file out of the build's side. It passes the download filter: files under *Occluded* paths are removed, there are no source maps for *Occluded* modules, and a bundle passes only when the profile acknowledges the bundle-reachable warning.

## What it cannot catch

Code the build's side runs can read what the build's side can read, so no output filter is complete. Every run is recorded in full, and this residual is set out in writing with every customer. See [Security model](https://occlude.dev/docs/security-model/).
