# Observation Mode

> The read-only first step: a recorder in your CI and a read-only GitHub app show which files your builds, tests and tickets touch.

Source: https://occlude.dev/docs/observation-mode/ · Reviewed 28 November 2026

Before anything is enforced, Occlude watches. A read-only GitHub app reads which files your merged pull requests changed, and a recorder in your CI reads your checkout on your own runner. Together they show which files each kind of task needs, and propose profiles.


## What it reads

| Source | What it yields | Where it runs |
|---|---|---|
| **The Occlude GitHub App**, read-only | For the last ninety days of merged pull requests: the files each changed, its ticket key, its author and when it merged. Who has access to the repository | GitHub, through the App's read-only permissions |
| **The recorder, static pass** | Every path in the checkout with its kind, the import edges between your own files, and where secrets were detected | A step in your CI job, on your runner |
| **The recorder, recorded passes** | Which files your `build`, `test` and `dev` scripts actually opened, and where they wrote | The same step, with recording turned on |

Your source never reaches Occlude. The recorder sends a description of the repository, never its contents.

## What it produces

- **The inventory**: files, by toolchain, by task. Which tickets touched which folders, what the build needs that nobody edits, what the tests read.
- **Profile templates**, derived from the inventory. *The last twelve dashboard tickets touched 42 files* becomes a profile with those files *Visible*.
- **Proposed Absent paths**: every file where a secret was detected is proposed *Absent*.

"Create profile from this" writes the rules. An admin reviews, names and owns them.

## Add the recorder to your CI

Add this workflow to the repository as `.github/workflows/occlude-observe.yml`. Set the repository variable `OCCLUDE_CLOUD_URL` to the Occlude address shown with the run, and the repository secret `OCCLUDE_RUN_TOKEN` to the run token. Then start the workflow by hand with the run id.

```yaml
name: Occlude Observation
on:
  workflow_dispatch:
    inputs:
      run-id:
        description: The Observation run id
        required: true
permissions:
  contents: read
jobs:
  observe:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: npm ci
      - uses: occlude-dev/observe-action@<commit>   # pin the full commit of the release
        with:
          run-id: ${{ inputs.run-id }}
          cloud-url: ${{ vars.OCCLUDE_CLOUD_URL }}
          run-token: ${{ secrets.OCCLUDE_RUN_TOKEN }}
          recorder: fanotify
```

Pin the recorder by its full commit, never by a tag. Leave out `recorder` for the static pass alone.

| Input | Default | Meaning |
|---|---|---|
| `run-id` | required | The Observation run id Occlude shows when the run is started |
| `cloud-url` | required | The Occlude address the payload is posted to |
| `run-token` | required | The run token, from a secret; given to the posting step alone |
| `repo` | the workflow's repository | `owner/name` of the repository observed |
| `commit` | the workflow's commit | The commit the checkout is at |
| `checkout` | `.` | Path of the checkout |
| `recorder` | empty | Empty: the static pass only. `fanotify`: records the build, test and dev passes; on a GitHub-hosted runner the capability it needs is given to the recorder alone, and the scripts it starts run as the job's normal user. `ptrace`: records them with `strace`, installed in an earlier step |
| `passes` | `build,test,dev` | Scripts to record, each run as `npm run <name>` |

## What leaves the runner

**Sent to Occlude, once per run:**

- the path of every file in the checkout (not under `node_modules`, `.git`, `dist` or `coverage`), with a kind such as source or config;
- import edges between your own files, as pairs of paths;
- for each secret detection, the file's path, the rule that matched and a count. Never the matched text;
- the names of your package scripts and the `include` patterns of your TypeScript config, as written;
- if recording is on: which files your build, test and dev scripts opened, the directories they wrote to, the names of the programs that ran, and each script's exit code and duration;
- the repository name, the commit and the recorder's version.

**Never leaves the runner:** file contents, diffs, environment variables, secret values, command lines, the output of your build and tests, and the recorder's own notes of each recorded script.

**Checked before sending.** The payload is compared with every text file in the checkout. If any part of it matches file content, the job fails and nothing is posted. The failing line in your job log quotes the start of the match, so you can see what was caught; that text stays in your log. The step that posts sends only a payload that passed this check, byte for byte.

**Network.** The recorder is downloaded from its release and its checksum is verified before it runs. It makes one request: the payload, to the Occlude address you set. During a recorded dev pass it also requests pages from your dev server on `localhost`.

## The run token

The run token lets whoever holds it post a payload to the one run it was made for, and nothing else: it cannot read a report, start a run or reach another run or repository. A second post to the same run replaces the first. Keep it in a repository secret and pass it as `run-token`. The recorder gives it to the posting step and to no other step, so the scripts it runs never see it. The token expires ninety days after it was made or last rotated, and you can rotate or revoke it in Occlude at any time.

## Supported

| | Supported |
|---|---|
| Runners | Linux, x64 and arm64: GitHub-hosted Ubuntu runners or your own |
| Static pass | Any repository. The import graph reads TypeScript and JavaScript, with `paths` and `baseUrl` from your root TypeScript configs |
| Recorded passes | npm projects: a package manifest at the checkout root, dependencies installed, scripts named `build`, `test` or `dev` |

A checkout the recorded passes do not support is told so in one line, and nothing runs or is posted. Leave `recorder` empty to run the static pass instead.

## What it is not

Nothing is enforced, and nothing is written to your repository. The App removes in one click. What Occlude keeps, for how long, and how to delete it is on the [privacy page](https://occlude.dev/privacy/#observation).

To start, see the [Quickstart](https://occlude.dev/docs/quickstart/).
