# pi · Credential handling

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [pi](https://ai-agents-review.com/runtime/pi.md)
- Column: [Credential handling](https://ai-agents-review.com/column/credential-handling.md) (Execution controls)
- Mark: 1 s
- Default deployment: 1
- Best supported configuration: 1
- Page: https://ai-agents-review.com/cell/pi/credential-handling

## Rationale

Full env to bash; only inheritEnv:false for MCP and !command keychain lookups; L2 unmet: no denylist

## Rubric criteria for this column

- 0: Full environment inherited, credentials stored in plaintext readable by agent code, no filtering
- 1: Some protection (keychain option, redaction of output, per-command secret injection), but the full environment is still inherited by default
- 2: Default denylist filtering of the environment, but known provider keys or credential files remain reachable by agent code
- 3: Default cleared environment plus allowlist for agent processes; credential stores may still be readable on the same filesystem
- 4: Level 3, plus provider credentials held outside the agent's reach (separate process or broker) **and** auxiliary processes (MCP stdio) also get an allowlisted environment

## Review finding

bash inherits the full `process.env`, plus `PI_*` session vars when exposed. MCP stdio servers inherit the env unless `inheritEnv: false`. `auth.json` is 0600 under a lock but readable by the same user. Config values can come from a `!command` (e.g. a host keychain CLI). No in-tree keychain; redaction applies only to bug reports. [X115][X116][X117][X118][X119]

## Evidence cited by the mark

- [X115] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/utils/shell.ts#L201-L213 — getShellEnv returns full process.env plus PATH — [S]
- [X117] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/mcp/src/transports/stdio.ts#L100 — MCP stdio inherits process.env unless inheritEnv false — [S]
- [X119] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/resolve-config-value.ts#L140-L161 — !command config values executed via shell — [S]

## Evidence also cited by the review finding

- [X116] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/tools/bash.ts#L226-L241 — bash adds PI_* session vars when exposed — [S]
- [X118] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/auth-storage.ts#L9-L37 — auth file 0600, dir 0700 — [S]

## Grading record

- Grader A (default / best): 1 / 1
- Grader B (default / best): 1 / 1
