# Approve

When grill finishes, a card appears: a one-screen summary of the plan. You read it and type `approve`. Until you do, the gate denies the runs the plan covers.

The gate is a hook that checks each command the agent tries to run. Turn it on once per repository with `/mycelium-extra:init`.

## The card

This is the card from the [walkthrough](walkthrough.md), trimmed:

```text
mycelium-extra · plan 84bb5fce · 3 steps · ready for approval
Choices   1 keep preferred_acquisition == TRUE  [repo: .living/decisions.md]
          2 median-of-ratios; exact permutation; BH, α = 0.05  [repo: .living/decisions.md]
          3 hits at padj < 0.05  [default: matches step 2]*
To confirm: step 3  (* = a default or inherited choice)
Checks    24 rows, 12 donors x 2 visits · sample IDs identical across tables · …
Runs      3 scripts (3 pinned) · any arguments · reads 2 pinned · writes 3
▶ approve  (or approve plan 84bb5fce)
```

Read `To confirm` first: these are the choices the agent made for you. Then check two things: that each default is one you would defend to a reviewer, and that the inputs are the right files. Approving without reading gives the agent your consent without your judgement, which is the one thing the plugin exists to prevent.

When you are satisfied, type `approve` as your whole message. It approves the card shown last. `approve plan 84bb5fce` picks a card by its hash.

Only the exact words count. "approve it" or "sounds good" approves nothing. To drop a plan, do not approve it: ask grill for a new one.

## What approval does

- **Lets the listed steps run**, in this session, for 24 hours by default. Before approval, the agent's attempt is denied:

  ```text
  mycelium-extra gate: blocked because no active approved plan covers this run.
  ```

- **Pins the inputs and scripts** by content. If a pinned input changes, the gate blocks the run and names the file; you re-check and approve again. If the agent edits a script, the gate pins the new version and says so; it does not block the edit.
- **Starts the record.** Each covered run now leaves a receipt in `.mycelium-extra/receipts.jsonl`: the command, the script's fingerprint, git state, environment, exit status and the outputs that changed. (Codex does not report exit status, so verify shows it as a gap.)

## Three other things you can type

| You type | What it does |
|---|---|
| `freeze <hash>` | Shows every script changed since approval, with diffs. Approve it to make the reviewed code the pinned code. |
| `allow explore` | Lets the agent try things this session. Explore runs are marked, so they never pass as results. |
| `gate off` | Switches the gate off in this repository. Nothing is checked or recorded until `gate on`. |

## What it does not do

The gate sees only commands the agent runs. **Anything you run yourself, in RStudio or your own terminal, is invisible to it**: not denied, not recorded. Among the agent's commands, it denies a covered run that no approval names, of the command forms it reads; some forms, such as `make`, it does not read. The list is under [Limits](https://github.com/mdmanurung/mycelium-extra/blob/main/docs/approval-gate.md#limits). It catches mistakes; it is not a security boundary.

Next: [Verify](verify.md). Every typed command is on the [reference page](commands.md).
