{
  "name": {"finding":"pi coding agent","quote":"# Pi","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/README.md","third_party":false},
  "repo": {"finding":"https://github.com/earendil-works/pi","quote":"\"full_name\":\"earendil-works/pi\"","url":"https://api.github.com/repos/earendil-works/pi","third_party":false},
  "docs": {"finding":"https://pi.dev/docs/latest; checked 2026-10-27. Source-code citations use stable v1.4.0; documentation citations use latest; maintenance describes main.","quote":"Use Pi for software development","url":"https://pi.dev/docs/latest","third_party":false},
  "headless": {"finding":{"invocation":{"finding":"Yes: pi --print \"Summarize the changes in this repository\" (alias -p) runs once, prints final assistant text, and exits. Structured one-shot: pi --mode json \"Review this repository\" > events.jsonl. RPC is long-lived. All modes use the same agent/tools.","quote":"Print mode runs the supplied prompts, writes the final assistant text to stdout, and exits:","url":"https://pi.dev/docs/latest/cli-integration","third_party":false},"prompt_input":{"finding":"Positional prompt accepted; pi -p @prompt.txt attaches file contents; cat prompt.txt | pi -p uses stdin, prepended to the first prompt. @paths resolve from cwd. RPC rejects @file.","quote":"Prepend its contents to the first prompt","url":"https://pi.dev/docs/latest/cli","third_party":false},"working_directory":{"finding":"Uses process.cwd(): cd /path/to/project before launching, or set the subprocess cwd.","quote":"const cwd = process.cwd();","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/main.ts","third_party":false},"working_directory_flag":{"finding":"not found","quote":"","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/cli/args.ts","third_party":false},"exit_codes":{"finding":"Print source returns 0 normally; text mode returns 1 for final assistant error, aborted or length (prints partial text for length). Caught errors return 1. JSON omits this stopReason check and can exit 0 on model failure: inspect events. SIGTERM returns 143; non-Windows SIGHUP returns 129. Plain print output has no usage footer.","quote":"if (assistantMsg.stopReason === \"error\" || assistantMsg.stopReason === \"aborted\")","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/modes/print-mode.ts","third_party":false},"approvals":{"finding":"No per-tool approvals to auto-answer. Print/JSON/RPC cannot show project-trust UI. Without override/extension/saved trust, defaultProjectTrust=\"ask\"/\"never\" skips protected resources; \"always\" loads them. --approve/-a trusts resources once; --no-approve/-na skips them. Neither limits tool operations.","quote":"Print, JSON, and RPC modes cannot show the built-in trust prompt.","url":"https://pi.dev/docs/latest/security","third_party":false}},"quote":"Non-interactive mode: process prompt and exit","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/cli/args.ts","third_party":false},
  "confinement": {"finding":{"default_boundary":{"finding":"OS permissions of the launching process govern files, shell, network and credentials. Cwd is not a jail; project trust gates resource loading, not tool access.","quote":"Project trust does not limit what tool calls can access or affect.","url":"https://pi.dev/docs/latest/security","third_party":false},"tool_selection":{"finding":"Defaults: read,bash,edit,write. --tools/-t allowlists names/* patterns, or modifies defaults with +name/-name. --exclude-tools/-xt is a final denylist; --no-tools disables all initially; --no-builtin-tools retains extensions. MCP remains callable unless explicitly filtered: use --no-mcp or --exclude-tools 'mcp__*'. write creates/overwrites files; edit replaces text.","quote":"Disables comma-separated tool names or patterns after all other selection options, MCP tools included.","url":"https://pi.dev/docs/latest/cli","third_party":false},"resource_controls":{"finding":"--no-extensions disables discovery/built-ins; explicit -e still loads. --no-mcp disables built-in MCP; --no-skills and --no-context-files suppress those resources. These are not OS boundaries.","quote":"Disable extension discovery and built-in extensions (explicit -e paths still work)","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/cli/args.ts","third_party":false},"command_filter_extension":{"finding":"Optional permission-gate.ts blocks matched bash regexes (rm -r/-rf/--recursive, sudo, chmod/chown with 777) when headless; with UI it asks. No core command-string permission mode is documented. Example policy, not comprehensive shell confinement.","quote":"const dangerousPatterns = [/\\brm\\s+(-rf?|--recursive)/i, /\\bsudo\\b/i, /\\b(chmod|chown)\\b.*777/i];","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/permission-gate.ts","third_party":false},"path_filter_extension":{"finding":"Optional protected-paths.ts blocks write/edit if a path contains .env, .git/ or node_modules/. It does not constrain bash or other tools.","quote":"const protectedPaths = [\".env\", \".git/\", \"node_modules/\"];","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/protected-paths.ts","third_party":false},"os_isolation":{"finding":"Official options: whole-process Docker, Docker Sandboxes, OpenShell (filesystem/process/network/credential policy); or Gondolin's Linux micro-VM for built-ins and ! commands only. Gondolin leaves other extensions on host, inherits host environment, and writes through the /workspace mount.","quote":"Pi, its built-in tools, `!` commands, and extension tools run inside the OpenShell boundary.","url":"https://pi.dev/docs/latest/containerization","third_party":false},"shell_sandbox_example":{"finding":"Optional @anthropic-ai/sandbox-runtime example: macOS sandbox-exec; Linux bubblewrap. network.allowedDomains/deniedDomains; filesystem.denyRead/allowWrite/denyWrite. Covers bash/user_bash, not read/edit/write. --no-sandbox, enabled:false, unsupported OS or initialization failure disables it; execution falls back to unsandboxed localBash.","quote":"if (!sandboxEnabled || !sandboxInitialized) {\n\t\t\t\treturn localBash.execute(id, params, signal, onUpdate);","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/sandbox/index.ts","third_party":false},"offline_scope":{"finding":"--offline / PI_OFFLINE=1 suppresses automatic network activity/catalog refreshes, not a documented traffic-denial boundary. Network enforcement requires external sandbox policy.","quote":"Disable automatic network activity, including model catalog refreshes","url":"https://pi.dev/docs/latest/environment-variables","third_party":false},"global_network_off_flag":{"finding":"not found","quote":"","url":"https://pi.dev/docs/latest/cli","third_party":false}},"quote":"Pi does not include a built-in permission system for restricting filesystem, process, network, or credential access.","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/README.md","third_party":false},
  "token_reporting": {"finding":{"json_events":{"finding":"--mode json writes JSONL: message_update.usage is cumulative per response and may stay zero until completion; message_end.message is authoritative. Sum each final message once, not repeated deltas/turn_end/agent_end copies. agent_settled marks completion.","quote":"The top-level `usage` is the latest cumulative provider-reported usage for the assistant response.","url":"https://pi.dev/docs/latest/json","third_party":false},"fields":{"finding":"Usage: input, output, cacheRead, cacheWrite, totalTokens; optional reasoning and cacheWrite1h. cost: input, output, cacheRead, cacheWrite, total. reasoning is included in output; cacheWrite1h is part of cacheWrite. Assistant usage is mandatory; nested tool usage optional.","quote":"When present, `reasoning` is already included in `output`; do not add it again.","url":"https://pi.dev/docs/latest/message-types","third_party":false},"session_files":{"finding":"JSONL persists assistant and optional tool usage, separate usage entries (e.g. cache warming), and compaction/branch-summary usage. Default: ~/.pi/agent/sessions/--<path>--/<timestamp>_<session-id>.jsonl.","quote":"Sessions are stored as JSONL (JSON Lines) files.","url":"https://pi.dev/docs/latest/session-format","third_party":false},"rpc_totals":{"finding":"get_session_stats returns tokens.input/output/cacheRead/cacheWrite/total and scalar cost across the full session, including tool and summary usage. contextUsage estimates current context, not consumption. Inference for job metering: start fresh or subtract a baseline.","quote":"Get token usage, cost statistics, and current context window usage.","url":"https://pi.dev/docs/latest/rpc-commands","third_party":false},"sdk_totals":{"finding":"session.getSessionStats() counts all entries, including compacted history and separate usage entries. Its aggregate tokens object has no reasoning breakdown.","quote":"getSessionStats(): SessionStats {","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/core/agent-session.ts","third_party":false}},"quote":"Assistant messages always contain usage.","url":"https://pi.dev/docs/latest/message-types","third_party":false},
  "parallelism": {"finding":{"subagents":{"finding":"Optional official subagent extension: separate pi processes; {agent,task}, parallel {tasks:[...]} (max 8 tasks, 4 concurrent), or sequential {chain:[...]}. Markdown frontmatter selects model/tools. Defaults to ~/.pi/agent/agents; project agents require agentScope=project/both.","quote":"Multiple agents run concurrently (max 8, 4 concurrent)","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/subagent/README.md","third_party":false},"child_invocation":{"finding":"Load the example index.ts via -e with agents.ts/definitions available. Children use --mode json -p --no-session, --model/--tools and per-task cwd. Project-agent confirmation runs only with ctx.hasUI; contexts are separate, filesystems are not sandboxed.","quote":"const args: string[] = [\"--mode\", \"json\", \"-p\", \"--no-session\"];","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/subagent/index.ts","third_party":false},"many_sessions":{"finding":"Multiple sessions per process are supported. PI_CODEMODE_MAX_WORKERS (default 2) caps codemode workers across sessions; excess scripts queue. It is not an agent-count limit.","quote":"Maximum codemode workers alive at once across all sessions in the process; default `2`.","url":"https://pi.dev/docs/latest/environment-variables","third_party":false},"parallel_tools":{"finding":"One assistant message's tool calls can execute in parallel, independently of subagent orchestration.","quote":"Tool calls from one assistant message can run in parallel.","url":"https://pi.dev/docs/latest/extensions","third_party":false}},"quote":"skips features like sub-agents and plan mode","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/README.md","third_party":false},
  "providers": {"finding":{"builtins":{"finding":"Built-ins: Amazon Bedrock, Ant Ling, Anthropic, Azure, Baseten, Cerebras, Cloudflare AI Gateway/Workers AI, DeepSeek, Fireworks, GitHub Copilot, Google/Google Vertex, Groq, Hugging Face, Kimi, Meta, MiniMax (global/China), Mistral, Moonshot (global/China), NVIDIA, OpenAI, OpenAI Codex, OpenCode/Go, OpenRouter, Qwen Token Plan (global/China/Individual), Radius, Together, TypeSafe, Vercel AI Gateway, xAI, Xiaomi/API and Token Plan (Amsterdam/China/Singapore), ZAI/global and Coding China.","quote":"All built-in providers, freshly constructed.","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/all.ts","third_party":false},"credentials":{"finding":"API keys and/or OAuth, with per-provider environment variables. Bedrock: AWS profiles/IAM/bearer/ECS/IRSA; Vertex: Google Cloud key/ADC/service account. Azure: OpenAI and Microsoft Foundry.","quote":"Amazon Bedrock and Google Vertex AI can also use ambient cloud credentials.","url":"https://pi.dev/docs/latest/providers","third_party":false},"local_custom":{"finding":"Native llama.cpp router/GGUF; Ollama, LM Studio, vLLM, SGLang via models.json. OpenAI/Anthropic/Google-compatible endpoints supported; extensions add protocols/auth. TypeSafe is for classifier models.","quote":"For Ollama, LM Studio, vLLM, SGLang, and other compatible servers,","url":"https://pi.dev/docs/latest/models","third_party":false}},"quote":"Most hosted providers support one or both","url":"https://pi.dev/docs/latest/providers","third_party":false},
  "subscription_login": {"finding":{"setup":{"finding":"Supported subscriptions can replace API keys. /login [provider] authorizes interactively and saves auth.json; remote OAuth may require pasting redirect/code. Provision login before unattended runs.","quote":"Run `/login` and select a provider.","url":"https://pi.dev/docs/latest/providers","third_party":false},"claude":{"finding":"Claude Pro/Max OAuth: browser/callback or pasted code, with token refresh; isSubscription:true.","quote":"name: \"Anthropic (Claude Pro/Max)\",\n\tisSubscription: true,","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/anthropic.ts","third_party":false},"chatgpt":{"finding":"openai: ChatGPT subscription OAuth, browser/callback or pasted redirect; token refresh implemented.","quote":"name: \"OpenAI (ChatGPT subscription)\",\n\tisSubscription: true,","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/openai-chatgpt.ts","third_party":false},"legacy_codex_provider":{"finding":"openai-codex is a legacy backend supporting ChatGPT Plus/Pro OAuth; it is not the Codex CLI.","quote":"name: \"OpenAI Codex (legacy)\",","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/openai-codex.ts","third_party":false},"copilot":{"finding":"GitHub Copilot subscription OAuth uses device-code authorization and access-token refresh.","quote":"grant_type: \"urn:ietf:params:oauth:grant-type:device_code\",","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/github-copilot.ts","third_party":false},"kimi":{"finding":"Kimi Code subscription OAuth or KIMI_API_KEY.","quote":"name: \"Kimi Code (subscription)\",","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/kimi-coding.ts","third_party":false},"xai":{"finding":"SuperGrok/X Premium subscription OAuth or API key.","quote":"loginLabel: \"Sign in with SuperGrok or X Premium\",","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/xai.ts","third_party":false},"meta":{"finding":"Meta Muse subscription OAuth or META_API_KEY.","quote":"name: \"Meta (Muse subscription)\",","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/meta.ts","third_party":false},"vendor_login":{"finding":"Radius supports OAuth or RADIUS_API_KEY. A particular subscription price/entitlement is not established here.","quote":"oauth: lazyOAuth({ name, load: () => loadRadiusOAuth({ name, gateway }) }),","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/radius.ts","third_party":false},"gemini_subscription":{"finding":"not found","quote":"auth: { apiKey: envApiKeyAuth(\"Gemini API key\", [\"GEMINI_API_KEY\"]) },","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/google.ts","third_party":false}},"quote":"A supported subscription","url":"https://pi.dev/docs/latest/models","third_party":false},
  "license": {"finding":"MIT (SPDX: MIT); repository LICENSE is the MIT License, copyright 2025 Mario Zechner.","quote":"MIT License","url":"https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/LICENSE","third_party":false},
  "latest_stable": {"finding":{"github_release":{"finding":"v1.4.0; published 2026-10-21 (2026-10-21T22:49:48Z); draft=false, prerelease=false. Newest stable from the releases API, not HTML.","quote":"\"published_at\":\"2026-10-21T22:49:48Z\"","url":"https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=1","third_party":false},"package_registry":{"finding":"npm @earendil-works/pi-coding-agent latest = 1.4.0, observed 2026-10-27. This is the publisher's package metadata on the npm registry.","quote":"\"version\":\"1.4.0\"","url":"https://registry.npmjs.org/@earendil-works/pi-coding-agent/latest","third_party":false}},"quote":"\"tag_name\":\"v1.4.0\"","url":"https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=1","third_party":false},
  "latest_prerelease": {"finding":"not found","quote":"","url":"https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=1","third_party":false},
  "last_commit": {"finding":"main tip 6c384aa30f619d7b28963f2bab24d8dacbe73cb6; author and committer: 2026-10-26T21:05:54Z (ISO date 2026-10-26), not pushed_at.","quote":"\"date\":\"2026-10-26T21:05:54Z\"","url":"https://api.github.com/repos/earendil-works/pi/commits/main","third_party":false},
  "fork_of": {"finding":"GitHub fork=false, no parent. No upstream coding-agent fork is identified; this is GitHub metadata, not a code-ancestry audit.","quote":"\"fork\":false","url":"https://api.github.com/repos/earendil-works/pi","third_party":false},
  "maintenance": {"finding":{"repository_state":{"finding":"Not archived and not disabled; default branch main. API observed 2026-10-27.","quote":"\"archived\":false","url":"https://api.github.com/repos/earendil-works/pi","third_party":false},"maintainer_signal":{"finding":"Current changelog has Unreleased fixes. No unmaintained notice found in checked README/changelog.","quote":"## [Unreleased]","url":"https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/CHANGELOG.md","third_party":false}},"quote":"\"default_branch\":\"main\"","url":"https://api.github.com/repos/earendil-works/pi","third_party":false},
  "gaps": [{"field":"headless.finding.working_directory_flag","finding":"not found","detail":"No top-level CLI cwd flag; use process cwd. Documentation's --cwd is for an MCP server.","checked":["https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/cli/args.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/main.ts","https://pi.dev/docs/latest/cli"]},{"field":"confinement.finding.global_network_off_flag","finding":"not found","detail":"No all-traffic-off core flag; --offline covers automatic network activity.","checked":["https://pi.dev/docs/latest/cli","https://pi.dev/docs/latest/security","https://pi.dev/docs/latest/environment-variables"]},{"field":"subscription_login.finding.gemini_subscription","finding":"not found","detail":"No Gemini subscription OAuth in stable inventory; google uses GEMINI_API_KEY. Vertex cloud credentials are distinct.","checked":["https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/google.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/all.ts","https://pi.dev/docs/latest/providers"]},{"field":"latest_prerelease","finding":"not found","detail":"Paginated all releases: 100+100+75; page 4 empty. None marked prerelease=true.","checked":["https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=1","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=2","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=3","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=4"]}],
  "sources": ["https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/README.md","https://api.github.com/repos/earendil-works/pi","https://pi.dev/docs/latest","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/cli/args.ts","https://pi.dev/docs/latest/cli-integration","https://pi.dev/docs/latest/cli","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/main.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/modes/print-mode.ts","https://pi.dev/docs/latest/security","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/permission-gate.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/protected-paths.ts","https://pi.dev/docs/latest/containerization","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/sandbox/index.ts","https://pi.dev/docs/latest/environment-variables","https://pi.dev/docs/latest/message-types","https://pi.dev/docs/latest/json","https://pi.dev/docs/latest/session-format","https://pi.dev/docs/latest/rpc-commands","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/src/core/agent-session.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/subagent/README.md","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/coding-agent/examples/extensions/subagent/index.ts","https://pi.dev/docs/latest/extensions","https://pi.dev/docs/latest/providers","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/all.ts","https://pi.dev/docs/latest/models","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/anthropic.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/openai-chatgpt.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/openai-codex.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/auth/oauth/github-copilot.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/kimi-coding.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/xai.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/meta.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/radius.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/packages/ai/src/providers/google.ts","https://raw.githubusercontent.com/earendil-works/pi/v1.4.0/LICENSE","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=1","https://registry.npmjs.org/@earendil-works/pi-coding-agent/latest","https://api.github.com/repos/earendil-works/pi/commits/main","https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/CHANGELOG.md","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=2","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=3","https://api.github.com/repos/earendil-works/pi/releases?per_page=100&page=4"]
}
