/edit

September 20, 2026 ยท View on GitHub

/edit helps Pi make small code changes without taking the keys away from you.

It reads a request, shows what it wants to do, asks for your approval, and changes only the files and actions you allowed. Then it checks the result and leaves a receipt.

Why use it?

Use /edit when a change should be small, reviewable, and easy to undo.

  • You stay in charge. Nothing changes until you approve the exact request.
  • Small steps. The tool can only use the actions you grant it.
  • Safe paths. It cannot wander outside the workspace, through .., absolute paths, symlinks, or extra hard links.
  • Folders you name. Each request lists which folders may receive which commands. Anything else is refused.
  • Undo on failure. If the check after a change fails, the original content is put back.
  • Proof after the change. A check must pass before the run is called successful.
  • Clear receipts. Each run records what happened.

Try it

Install the Pi extension at ~/.pi/agent/extensions/edit.ts, then reload Pi:

/edit fixtures/approved_replace_text/request.json fixtures/approved_replace_text/approval.json

The sample changes draft to published in note.txt.

Check it locally

mix deps.get
mix test
bun test

The full check also asks Jev to review the proposed change:

export AI_GATEWAY_TOKEN=...
export CLOUDFLARE_ACCOUNT_ID=...
export CLOUDFLARE_AI_GATEWAY_ID=default
./scripts/prove.sh

Jev runs as typesafe/jev on Cloudflare Workers AI through your AI Gateway. The token stays in your shell environment; it is never written to source, logs, or output. If the provider is unavailable, /edit stops instead of pretending that a review happened.

What it does not do

/edit does not make broad changes, skip approval, invent a review, or call a successful run when its check failed.

Evaluation and proof

What to inspectLinkWhat it tells you
Evaluation guideevals/README.mdWhat is measured and what is not claimed
Evaluation tasksevals/tasks.jsonThe exact cases being run
Local evaluation receiptevals/results-local.jsonlA recorded baseline-versus-/edit run
Escape suiteevals/results-escape-executor_only.jsonEighteen requests that must be refused, run without Jev: 0 escapes
Labeled Jev setevals/results-judgment.jsonTen labeled requests: precision 0.71, recall 1.0
Live Jev receiptevals/results-live.jsonThe recorded Jev decision, verification, and effects from the full proof
Reproducible evaluation commandscripts/eval.shThe command that creates fresh workspaces and runs both paths
Full proof commandscripts/prove.shTests, the fixture, and the live Jev-backed path

Run the repeatable local checks from a clean checkout:

mix deps.get
mix test
bun test
./scripts/eval.sh

For the complete proof, configure an approved Jev provider and run:

./scripts/prove.sh

The evaluation now includes folder policy, an 18-case escape suite, five task workspaces, and a labeled Jev set. The two-model baseline matrix is still unrecorded. See evals/README.md.

Status

Tests pass. The executor-only escape suite is 0/18. Folder policy is deny-by-default. The last recorded live Jev fixture run approved. A later live call on this machine returned HTTP 401 and was not retried.