Extensions for the Pi coding agent. This repository contains the extensions used in the author's Pi setup. For installation and environment setup, see the Pi installation guide.
Each extension has two documents:
-
README.mdis for users. It explains purpose, configuration, commands, tools, and visible behavior. -
AGENTS.mdis for coding agents. It explains module ownership, implementation details, invariants, and change checks. -
bwrap-sandboxprovides a Linux Bubblewrap boundary and approval gate for Bash and selected Pi file tools. -
delete-sessiondeletes the current session file after confirmation and starts a new session. -
keybinding-shortcutsadds OpenCode-style command and word-deletion shortcuts to the Pi TUI editor. -
websearchprovides provider-native grounded web search with citations and ordered fallback.
Read the matching AGENTS.md before you change an extension.
bwrap-sandbox is Linux-only.
It requires Bubblewrap and the bwrap-hardened launcher.
For system package installation and launcher build instructions, see the Pi harness setup guide.
The extension starts from a read-only host root.
It uses deterministic path and direct secret checks, Bubblewrap mounts, user-approved session grants, exact one-shot write paths, and one classifier reviewer for model-generated Bash.
The default reviewer is openai/gpt-5.6-luna with low reasoning.
The reviewer can use bounded user-role instructions to authorize matching, narrowly scoped Bash mutations and one deterministically validated atomic write-path set for one exact future Bash call.
It treats deterministic reads from fixed public remote resources as routine when the request cannot include local, project, environment, credential, secret, proprietary, prior-output, or dynamic data.
A missing or failed reviewer does not use model fallback and sends the exact action to human review.
Bubblewrap is the primary security boundary.
Read its user guide before you configure it.
The extension's global configuration is:
~/.pi/agent/extensions/sandbox.json
The default classifier configuration is equivalent to:
{
"classifier": {
"reviewer": {
"provider": "openai",
"model": "gpt-5.6-luna",
"reasoning": "low"
},
"timeoutMs": 30000,
"maxRetries": 1
}
}Only global configuration can replace classifier.reviewer.
If the model, provider, authentication, or provider call is unavailable, the extension uses human review and tells the user that they can configure classifier.reviewer globally.
It does not use a fallback model.
Trusted project configuration is:
.pi/sandbox.json
The extension registers the /sandbox command and the sandbox_access tool.
/sandbox shows the current sandbox status.
/sandbox off disables the sandbox for the current session only.
It turns off the OS boundary, the tri-tier authorization, and the direct host file-tool checks for the rest of the session, without a confirmation prompt.
/sandbox on re-enables the sandbox and re-runs full initialization.
It is rejected when --no-sandbox or configuration disabled the sandbox.
The toggles do not persist across sessions.
These surfaces and their safety rules are documented in the extension guide.
Starting Pi with --no-sandbox disables the sandbox for the parent and all subagent sessions in that Pi process.
A child cannot restore it silently.
websearch registers websearch_cited.
It uses Pi's model registry and authentication.
It does not need separate API keys.
Its global and project configuration files are:
~/.pi/agent/extensions/websearch.json
.pi/websearch.json
Read the websearch user guide for model fallback, tool parameters, provider behavior, and errors.
delete-session registers /delete.
The command asks for confirmation, waits for Pi to become idle, removes the current session file, and starts a new session.
It does nothing for an ephemeral session.
Read the delete-session user guide for use.
keybinding-shortcuts replaces the editor component only in TUI mode.
It maps ctrl+p to Pi's slash-command menu, and maps ctrl+backspace and ctrl+delete to word deletion.
The extension needs the conflicting default ctrl+p actions removed from ~/.pi/agent/keybindings.json.
Read the keybinding user guide for details.
The four extension packages live at the repository root, each in its own directory (bwrap-sandbox/, delete-session/, keybinding-shortcuts/, websearch/).
Keep user documentation and agent documentation in the same extension folder.
Keep the root README focused on extension descriptions and repository layout.
For bwrap-sandbox, run the outside-pi Bun unit harness documented in bwrap-sandbox/AGENTS.md.
The suite does not run inside Pi and does not include live reviewer or shell integration checks.
Do not commit credentials, provider responses, session files, or generated runtime resources.