> ## Documentation Index
> Fetch the complete documentation index at: https://llmwiki.atomicstrata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Review Policy - Auto-Hold Risky Generated Pages

> Configure .llmwiki/config.json to automatically hold low-confidence, contradicted, or schema-violating pages for review instead of writing them live.

By default, `llmwiki compile` writes every generated page directly to `wiki/`. You can change that behavior in two ways. The `--review` flag is all-or-nothing: every candidate goes to the review queue and nothing lands in `wiki/` until you approve it. A **review policy** is more surgical - it lets a normal `compile` run write most pages live while automatically holding back the ones that trip specific risk conditions.

With a policy in place, a low-confidence page gets queued for your review while an unambiguous page is written immediately. You get confidence-appropriate friction without slowing down the happy path.

## Configuring the policy

Create `.llmwiki/config.json` in your project root (alongside `sources/` and `wiki/`):

```json theme={null}
{
  "version": 1,
  "review": {
    "hold": ["low-confidence", "contradicted", "schema-violating", "provenance-violating"],
    "lowConfidenceThreshold": 0.5
  }
}
```

An absent config file, a missing `review` key, or `"hold": []` all mean **off** - compile writes pages directly, matching today's default behavior.

The same config file can also contain a `sources` object for
[recursive discovery and exclusions](/cli/compile#nested-source-folders).
Keep `review` and `sources` as sibling keys; source selection does not disable
the review policy.

## Hold modes

A page is held as a candidate if it trips **any** enabled mode (union semantics). The live `wiki/` page is left untouched when a page is held.

* **`low-confidence`** - holds any page whose `confidence` frontmatter field is below `lowConfidenceThreshold` (default `0.5`). Pages with no `confidence` field are held by default. Set `"treatMissingConfidenceAs": "ok"` in the `review` object to let them pass instead.

* **`contradicted`** - holds any page that declares one or more `contradictedBy` entries in its frontmatter, indicating the compiled content conflicts with another page.

* **`schema-violating`** - holds any page that fails a schema cross-link rule defined in `.llmwiki/schema.json`. For example, a `comparison` page with fewer than the minimum required wikilinks trips this mode.

* **`provenance-violating`** - holds any page whose citations are broken or malformed - pointing to missing source files, impossible line ranges, or unparseable citation markers.

* **`all`** - holds every generated page, regardless of any other condition. Equivalent to running `compile --review` but expressed as a persistent policy.

* **`off`** or `"hold": []` - disables the policy entirely. All pages are written live.

## Fail-closed behavior

Review policy configuration is **fail-closed**. If llmwiki encounters an unknown mode name in the `hold` array, or if `config.json` is corrupt and cannot be parsed, the compile aborts with an error rather than silently disabling the policy and writing all pages live. This prevents a misconfigured policy from quietly bypassing the review gate.

## What happens when a page is held

When a page is held by the policy:

* A candidate record is stored in `.llmwiki/candidates/` with reason codes explaining exactly why it was held.
* The existing live page in `wiki/` (if any) is left untouched.
* `llmwiki review list` and `llmwiki review show <id>` display the hold reasons alongside the candidate content.

After every compile, llmwiki reports the split between written and held pages:

```
Wrote 8 page(s), held 2 for review - run `llmwiki review list`
```

## What is and isn't policy-gated

* **`llmwiki compile`** - honors the review policy.
* **`llmwiki refresh --stale`** - honors the same policy when recompiling stale or orphaned pages.
* **`llmwiki query --save`** - is **not** policy-gated in the current version. Saved query answers are written directly to `wiki/queries/`.

## Managing the review queue

Use the review commands to process held candidates:

```bash theme={null}
llmwiki review list           # see all pending candidates and their hold reasons
llmwiki review show <id>      # inspect a single candidate's title, summary, and body
llmwiki review approve <id>   # promote the candidate into wiki/ and refresh the index
llmwiki review reject <id>    # archive the candidate without touching wiki/
```

For full review queue documentation, see the [review CLI reference](/cli/review).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.