Security

Security

The additive HTTP/WebSocket session API uses one opaque server-wide bearer for the complete API trust domain; it has no per-session authorization in v1. The bearer is authenticated before bodies, upgrades, or session existence are observed and is never accepted in process-visible CLI arguments or emitted in logs, status, tickets, manifests, journals, or metrics. See the Session API contract.

A Pi Daemon process is one operator trust domain, not a sandbox. Logical sessions isolate state and scheduling; they do not isolate malicious JavaScript loaded into the same Node process. The initial service therefore loads no project code or tools.

Enforced defaults

Prompts and terminal results are necessarily retained in the private durable request journal so a queued request can be replayed and a duplicate terminal request can receive its prior result. They are not emitted in status or logs. Protect the state directory as sensitive application data.

Configured session authority

Authenticated clients may explicitly create an unisolated configured session. The admission parser separates a secret-free persisted spec and sorted environment-key summary from the memory-only raw overlay. Raw values never enter the catalog or journal; after restart an env-dependent operation fails credentials_required until re-provisioned. The daemon never swaps global process.env or cwd. Known provider API keys use a session-scoped in-memory auth store and the bash overlay applies only through a child-process spawn hook.

Automatic extensions, packages, skills, prompts, themes, and context discovery remain disabled unless project trust is explicitly approved. Explicit resource paths are themselves an authority grant. Extension/package JavaScript still shares process memory, globals, ambient daemon environment, and provider registries with every other in-process session.

Host-scoped tool adapter

The additive protocol-v2 host tool-adapter is a narrower alternative to loading project code in the daemon. Its closed descriptor grants a subset of six fixed filesystem operations through an owner-private Unix socket. Adapter ID/version, host incarnation, logical session ID, and generation are checked on every frame. The session cwd is the implicit root; paths are root-relative and the runtime must fail closed on traversal, symlinks, stale identity, oversized records, queue/time limits, and response mismatch.

The opaque capability handle is memory-only and appears on the private wire only in bind. It is never an HTTP/daemon bearer, certificate, environment value, or persisted credential, and it must not enter logs, errors, status, events, manifests, journals, tickets, or acknowledgements. Restart changes host identity and requires reprovisioning rather than replay. Per-invocation abort and best-effort generation/session revoke prevent one stuck tool from requiring a whole shared socket teardown. V2 configured opens may select a per-session agentDir and sessionDir, but only through the strict prepared-session path; private auth mode/ownership, allowed cwd roots, canonical <agentDir>/sessions confinement, and credential/state/workload overlap checks remain mandatory. The exact resolved Pi conversation identity is persisted and used for recovery instead of regex/name search. V1 and every v2 tools: "none" open retain no built-in or ambient project tools; configured storage does not widen tool authority.

Separate inhabitants

Configured process/filesystem tools and reviewed extensions may share one unisolated daemon only when all sessions are mutually trusted. A workload requiring unreviewed project JavaScript or shell-grade environment, filesystem, process, network, or credential isolation must run in a separate Pi Daemon process/security domain until a stronger advertised backend exists.

Report vulnerabilities privately to the repository owner; do not include live credentials, prompts, output, or private paths in a public issue.