@mzwing/pi-permission-auto-review

Codex-style automatic approval reviews for @gotgenes/pi-permission-system

Packages

Package details

extension

Install @mzwing/pi-permission-auto-review from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@mzwing/pi-permission-auto-review
Package
@mzwing/pi-permission-auto-review
Version
0.1.4
Published
Jul 27, 2026
Downloads
476/mo · 476/wk
Author
mzwing
License
MIT
Types
extension
Size
171.5 KB
Dependencies
2 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "./dist/index.js"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@mzwing/pi-permission-auto-review

npm version CI License: MIT TypeScript Pi Package

A Pi extension that adds Codex-style automatic permission reviews to @gotgenes/pi-permission-system.

Differences between @gotgenes/pi-permission-model-judge

@gotgenes/pi-permission-model-judge is a general-purpose model-based authorizer that can be used to evaluate any permission request.

Ours is mostly specialized for OpenAI's codex-auto-review model, which is trained to evaluate permission requests in the context of a coding assistant. Our extension aims at providing Codex-style automatic permission reviews for Pi's coding agent.

Install

pi install npm:@gotgenes/pi-permission-system # dependency
pi install npm:@mzwing/pi-permission-auto-review

Pi 0.80.10 and Pi 0.81.x are supported. The extension uses @mzwing/pi-polyfill transitively for provider lookup on Pi 0.80.10; do not install the polyfill as a separate Pi extension.

Enable

Add "auto-review" to pi-permission-system's config:

{
  "authorizerChain": ["auto-review"]
}

The config is normally located at ~/.pi/agent/extensions/pi-permission-system/config.json.

Extension config can be omitted. The defaults are:

{
  "provider": "openai-codex",
  "model": "codex-auto-review",
  "reasoning": "low",
  "timeoutMs": 90000,
  "includeBaselinePolicy": true
}

codex-auto-review is an official hidden model. The extension derives it from Pi's openai-codex provider and reuses the existing Codex login.

Configuration

Scope Path
Global ~/.pi/agent/extensions/pi-permission-auto-review/config.json
Project <cwd>/.pi/extensions/pi-permission-auto-review/config.json

Project fields override global fields. PI_CODING_AGENT_DIR replaces ~/.pi/agent when set.

Field Default Description
provider openai-codex Pi model-registry provider id
model codex-auto-review Model id within the selected provider
reasoning low Reasoning level for reviewer calls
timeoutMs 90000 Total budget across all retry attempts
includeBaselinePolicy true Include the built-in Codex-style risk policy
additionalPolicy omitted Trusted operator policy appended to it

See the example config and bundled JSON Schema. Unknown or invalid fields disable automatic decisions and fall through to the normal prompt.

Use /permission-auto-review in Pi's interactive TUI to edit and apply global or project config without reloading the session. Available subcommands:

/permission-auto-review show
/permission-auto-review path
/permission-auto-review reset [global|project]
/permission-auto-review help

Custom providers and models must be defined in Pi's ~/.pi/agent/models.json, then selected with this extension's provider and model fields. To replace the built-in risk policy completely, set includeBaselinePolicy to false and provide a non-empty additionalPolicy.

Behavior and Limits

  • Model, authentication, timeout, provider, or response-format failures defer to the normal human prompt.
  • Unexpected internal review failures also defer to the human prompt instead of escaping into the permission gate.
  • Three consecutive denials, or ten denials in the latest fifty reviews, open a circuit breaker until the next Pi turn.
  • pi-permission-system prevents authorizers from auto-approving path and external_directory requests.

License

MIT