Environment and configuration reference
Generated from the owned source roots, scripts/lint/process-environment.ts, the core config/path declarations,
and packages/harness/package.json. No machine environment and no user config is read.
Explicit environment keys
Section titled “Explicit environment keys”The 22 files that directly touch the process environment exactly match the
node/no-process-env exception list in scripts/lint/process-environment.ts; generation fails if either side gains or loses a file.
Rows cover literal dot access, literal bracket access, destructuring, node:process env imports,
grounded environment.KEY seams, and keys explicitly written beside a process-environment spread.
| Key | Reader | Purpose, requirement, and default | Phase |
|---|---|---|---|
ENSO_E2E_MODEL |
packages/web/e2e/e2e-home.ts#e2eStack (config load) |
Optional; 1 selects the browser suite’s @model tier, which bun run e2e:model sets: the stack keeps the operator’s home and may reuse a running one. Unset, the model-free tier runs over the suite’s own seeded home (#486). |
load |
ENSO_HOME |
packages/core/src/paths.ts#ensoHome |
Optional user-level Enso directory (#421); an absent or empty value defaults to ~/.enso. pi’s agent dir, the secrets file, the logs and the project list all resolve under it. |
boot / load / per-call |
ENSO_HOME |
test/scratch-preload.ts (process write, before any test file loads) |
Set by the test preload to a directory under the run’s scratch, so the harness extensions a hosted thread loads in-process — which resolve ensoHome from the process environment for the user’s security config and for where a thread’s snapshot store is minted (#551) — never touch the operator’s ~/.enso. Removed with the scratch when the run ends. |
load |
ENSO_LOG_CONSOLE |
packages/core/src/log-process.ts#parseEnsoLogLevels |
Optional terminal log level; launcher default is info, while child-pi logging defaults to no console sink. |
boot / load |
ENSO_LOG_LEVEL |
packages/core/src/log-process.ts#parseEnsoLogLevels |
Optional file log level and per-category overrides; defaults to info. |
boot / load |
ENSO_PROJECTS_DIR |
packages/harness/extensions/run-context/index.ts (the default export’s openSnapshotStore) |
The projects folder the host files trees and stores under, read to open the store each run snapshots into (#586). Unset (the terminal, which has no host), ENSO_HOME/projects. |
per-call |
ENSO_PROJECTS_DIR |
packages/web/src/host/agent-host.ts#createAgentHost (process write) |
Set by every host to its projectsDir, and removed for a host with none, so the run-context extension snapshots into the stores the host mints and forks from (#586). The host owns the path; the extension no longer re-derives it from ENSO_HOME. |
boot |
ENSO_PROJECT_TRUST_BY_HOST |
packages/web/src/host/agent-host.ts#createAgentHost (process write) |
Always 1 in the server: the host decides project trust, asking before a run (#502), so the harness’s .enso/config.json resolution follows pi’s answer (harness/core/session-config.ts#sessionConfigEnvironment) instead of asking a second time. Unset in the terminal, where the harness asks its own question. |
boot |
ENSO_SERVER_URL |
scripts/enso-eval.ts#main |
Optional live-server URL for the session eval; defaults to http://127.0.0.1:5179. |
per-call |
ENSO_SERVER_URL |
scripts/enso-incidents.ts#main |
Optional live-server URL for the incident history; defaults to http://127.0.0.1:5179. |
per-call |
ENSO_SERVER_URL |
scripts/enso-judge.ts#main |
Optional live-server URL for the command-judge cases and replay; defaults to http://127.0.0.1:5179. |
per-call |
ENSO_SERVER_URL |
scripts/enso-logs.ts#main (for bundle) |
Optional live-server URL for bundle retrieval; defaults to http://127.0.0.1:5179. |
per-call |
ENSO_SERVER_URL |
scripts/enso-thread.ts |
Optional live-server URL for thread inspection; defaults to http://127.0.0.1:5179. |
boot |
ENSO_SITE_BASE |
scripts/docs/site-base.ts#SITE_BASE (module read) |
Optional; the path the documentation site is served under. Defaults to /enso for a local build. The publish workflow sets it from the Pages configuration (configure-pages): /<repository> for a project site, empty for a custom domain — derived rather than a literal that rots on a rename or a domain change. |
build |
ENSO_SITE_URL |
scripts/docs/site-base.ts#SITE_URL (module read) |
Optional; the origin the site is served from, which Astro needs to emit a sitemap — without it @astrojs/sitemap skips at WARN and the build still succeeds. Defaults to the unresolvable https://example.invalid because a local build has no origin; the publish workflow sets the origin Pages serves the site from (configure-pages). |
build |
FORCE_COLOR |
scripts/gate.ts#runGate (child environment write) |
Optional; set to 1 only when both gate output streams are TTYs, otherwise not overridden. |
per-call |
GH_TOKEN |
scripts/review/review-pr.ts#reviewPoster (child environment write) |
Set only when ~/.config/enso-review/app.json exists: the review App’s one-hour installation token, for this repository only, so the local reviewer’s gh reads and posts as the App’s bot (#981). Absent: the reviewer’s gh uses the owner’s stored login. |
per-call |
PI_CODING_AGENT_DIR |
packages/harness/extensions/run-context/index.ts (the default export’s readPermissionPolicy) |
The agent directory both Enso surfaces set, read to find the permission policy the engine reads under it, for the run context’s mode.rulesHash (#496). Unset, the mode is null. |
per-call |
PI_CODING_AGENT_DIR |
packages/web/e2e/e2e-home.ts#seededHome (process write) |
Set to the seeded home’s agent directory before the suite writes its stored threads, so pi files them there and never in the operator’s ~/.pi/agent (#486). |
load |
PI_CODING_AGENT_DIR |
packages/web/src/host/agent-host.ts#createAgentHost (process write) |
Required pin to the supplied scratch agent directory before pi loads; no fallback at this boundary. | boot |
PI_CODING_AGENT_DIR |
scripts/enso.ts (pi child environment write) |
Required pin to the selected agent directory in the spawned pi process. | boot |
PI_CODING_AGENT_SESSION_DIR |
scripts/enso.ts (pi child environment write) |
Always set, to the launch directory’s project folder — ENSO_HOME/projects/<projectIdOf(cwd)>/sessions — so the terminal and the web surface file and read one project’s threads in one place (#552). Unset, pi would file by encoded cwd under the agent dir. |
boot |
PI_MULTI_ACCOUNT_INDEPENDENT_ROOTS |
packages/web/src/host/agent-host.ts#createAgentHost (process write) |
Always 1 in the server: pi-multi-account (≥1.23.2) makes every in-process session an independent root with its own failover, instead of passive after the first (#351). Stays set — the extension reads it per session. |
boot |
TMPDIR |
test/scratch-preload.ts (process write, before any test file loads) |
Set by the test preload to a per-run scratch directory, so every temporary directory a suite or a spawned child makes lands in one place that is removed when the run ends — the suites leaked ~1,000 directories per gate run and filled a tmpfs’s inodes (#546). Never read by Enso itself. | load |
npm_config_user_agent |
scripts/gate.ts#detectPackageManager |
Optional package-manager identity; falls back to Bun detection, then npm. |
boot |
Parser limit. Only literal keys in the source shapes named above become rows. Computed names and
whole-environment quarantine/pass-through operations have no concrete key to report; adding a new literal
shape or a literal without checked metadata fails generation as UNCLASSIFIED rather than being omitted.
EnsoConfig schema
Section titled “EnsoConfig schema”The user’s ENSO_HOME/config.json (#421). No file at all is every default below. A file that is there is strict
on unknown keys and fails closed when unreadable. Defaults are consumer behavior when an optional field is omitted;
required fields have no schema default.
| Field | Required | Default when omitted | Reader |
|---|---|---|---|
claudeCode |
no | A Claude login claims pi’s own Claude Code version: conversations send pi’s, and the web search sends the same one. User-only: a trusted project’s claudeCode is ignored with a notice (#925). |
packages/harness/extensions/web-search/index.ts#createWebSearch |
claudeCode.version |
yes | n/a — required once claudeCode is present: a version as Anthropic writes them ("2.1.284"). It is the claude-cli/<version> user-agent of every request made with a Claude login (OAuth), the conversation’s and the web search’s alike; an API key’s requests claim none. Set it when Anthropic refuses a request as claude_code_version_too_old before pi has caught up: the refusal names the version it requires. New sessions use it (#925). |
packages/harness/extensions/web-search/index.ts#claimClaudeCodeVersion |
models |
no | No favorites, no hidden providers, no roles or presets: the model picker groups Recent and the providers, and a new thread starts on pi’s own default. Settings › Providers and Roles write it, the whole section at a time; read fresh on each request and user-only — a project’s .enso/config.json is never read for it (#904). |
packages/web/src/server/models-routes.ts#readSection |
projects |
no | No roots, no fence (#866): a page may add any folder the standing refusals allow — never the home folder or one holding it, never ENSO_HOME or anything under it, and no hidden folder unless the person shows them. |
packages/web/src/server/dev.ts → startEnsoServer({ projectRoots }) → packages/web/src/server/projects.ts#createProjectRegistry |
projects.roots |
yes | n/a — absolute or ~/ paths; a page may register a project only strictly under one (#395), and a root taken out hides the projects under it |
packages/web/src/server/projects.ts#createProjectRegistry |
security |
no | Incidents alert and suspend nothing; the default risk thresholds. | packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents |
no | As above. A trusted project’s approved .enso/config.json may only tighten it — halting on, a threshold reached sooner, a wider window — and what would loosen it is ignored with a notice (#753). |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents.halt |
no | false: an incident opens as an alert and suspends nothing (#466). |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents.highAtKinds |
no | 2 distinct kinds for high. |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents.highAtSignals |
no | 3 signals for high. |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents.incidentAtSignals |
no | 5 signals for incident. |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.incidents.windowCalls |
no | 8 calls back. |
packages/core/src/session-incident.ts#incidentPolicyOf |
security.judge |
no | The judge is off: nothing is sent. | packages/harness/core/session-config.ts#userJudgeConfig |
security.judge.backend |
no | "off": nothing is sent (#469). "jev" sends each in-scope bash call, redacted, to TypeSafe; "local" asks the llama.cpp model security.judge.local names, on this machine (#532). Recorded only. An unreadable config.json leaves it off. |
packages/harness/core/session-config.ts#userJudgeConfig |
security.judge.local |
no | None. Required by "local", which is off without it: { "baseUrl", "model" } — a llama.cpp router on a loopback address (anything else is sent nothing) and the model it asks. |
packages/harness/core/session-config.ts#userJudgeConfig |
threads |
no | A worktree for every new thread (#551 decision 1): a git worktree on branch enso/<thread-id> when the project is a repository’s top level, else a copy — each one adds a worktree registration and that branch to the repository until the thread is deleted (#571). tree sets the mode ("worktree", "copy", or "off": threads run in the checkout, with nothing to restore files to); projects, in the user’s file only, maps a project path (absolute or ~/, resolved to the canonical path) to its own mode, which beats tree. A tree holds no ignored file (node_modules, .env): copy lists the project’s paths (files or directories, relative to it, never leaving it) copied into a new tree, and setup the commands then run in it with sh -c, in order, each for at most 10 minutes, stopping at the first failure; the outcome is recorded on the thread, which opens either way (#754). Default: no copy, no setup. Tiered per project (#754): <project>/.enso/config.local.json > <project>/.enso/config.json > this file > the default, each key’s whole value from one tier (a list replaces, never extends); the project’s own files are read only once the project is trusted, fresh for each new tree. |
packages/core/src/project-config.ts#readProjectThreadSettings, from packages/web/src/host/agent-host.ts |
webFetch |
no | An empty allowlist: nothing is fetchable. | packages/harness/extensions/web-fetch/index.ts#createWebFetch |
webFetch.allowedHosts |
yes | n/a — required once webFetch is present; [] fetches nothing. |
packages/harness/extensions/web-fetch/index.ts#createWebFetch |
webSearch |
no | {}; current-model routing with no Tavily domain filters. |
packages/harness/extensions/web-search/index.ts#createWebSearch |
webSearch.backend |
no | Current-model routing; only "deepseek" pins the dedicated backend. |
packages/harness/extensions/web-search/index.ts#runPrimary |
webSearch.tavily |
no | No Tavily domain filters. | packages/harness/extensions/web-search/index.ts#createWebSearch |
webSearch.tavily.excludeDomains |
no | Omitted from the Tavily request. | packages/harness/extensions/web-search/index.ts#createWebSearch |
webSearch.tavily.includeDomains |
no | Omitted from the Tavily request. | packages/harness/extensions/web-search/index.ts#createWebSearch |
Parser limit. The schema reader handles this repository’s current Type.Object / Type.Optional
declaration layout in config.ts, web-fetch.ts, and web-search.ts; metadata and consumer probes must
match every discovered field or generation fails.
Runtime paths
Section titled “Runtime paths”Every runtime path helper in packages/core/src/paths.ts: the user’s state under ENSO_HOME (~/.enso by default, #421), and the checkout’s own build cache.
| Path | Assembler | Writer | Lifetime |
|---|---|---|---|
ENSO_HOME/logs |
ensoLogsDir |
configureProcessLogging creates it and every harness process appends to the day file. |
One file per local day; logging retains 14 days. |
ENSO_HOME/permissions.json |
ensoPermissionRulesPath |
The operator; preparePermissionPolicy seeds it with Enso’s default policy before pi loads, when it is absent or holds no permission block, and replaces an old-format rules file (kept beside it as .picc-backup, #496). It links the permission engine’s config path under the agent dir to this file and rewrites the mode agents (agents/enso-mode-*.md) at every launch. An unreadable file refuses the launch. |
Per-user until the operator edits it; the permission engine re-reads it when it changes, so an edit applies to running sessions too. |
ENSO_HOME/pi-agent |
ensoAgentDir |
The TUI/server launchers create it; pi and createAgentHost write settings, auth, sessions, and the multi-account seed. |
Per-user state shared by every checkout and launch; retained until the operator removes it. |
ENSO_HOME/projects |
ensoProjectsDir |
One folder per project, named by projectIdOf (sixteen hex digits of the real path’s SHA-256; projects.json is the only id↔path map). Under it, sessions/ holds the project’s thread logs — pi’s session files (#552): the web host and bun run enso both file there (PI_CODING_AGENT_SESSION_DIR), and a launch first moves the sessions pi filed by encoded cwd under the agent dir into their folders, never over an existing file. snapshots/<thread-id> is one thread’s snapshot store (#551): a bare repository the run-context extension writes at every run start through @enso/core/snapshot-store — the tree’s tracked set and unignored untracked files, never a force-add — its objects in the project’s object store snapshots/.objects, which owns them all, so the checkout’s own git gc cannot take one (#573); a mint copies there the blobs of the checkout’s index it seeds from. trees/<name> is one thread’s tree, its cwd (#551), where trees are on: a worktree on enso/<thread-id> or a copy, minted by the web host at a new thread’s first run (named by its id) and at each fork (a fresh id; its enso-thread-tree entry names it). |
Per-user; a moved checkout changes its id, so its threads stay under the old one until moved by hand. Deleting a thread (#571) removes its tree after an inventory and its store, then collects the object store (#573): what only that thread’s snapshots reached goes, a fork’s history stays. Trust (pi-agent/trust.json) and the checkout’s .enso/config.json stay where they are. |
ENSO_HOME/projects.json |
ensoProjectsPath |
The web server, when a page registers, renames (#939) or removes a project (#395); written whole and renamed over. A renamed launch folder is kept as an entry for its path. | Per-user until a project is removed; entries outside the configured roots are kept but not served. |
ENSO_HOME/prompts |
ensoPromptsDir |
The web server, when a page writes or deletes a library prompt (#443) — one <id>.md per prompt, written whole under the precondition the request states (a create is linked into place and never lands on a file there; a replace or delete lands only on the version read, by its ETag); the operator may edit the files directly. |
Per-user until a prompt is deleted; a thread that ran one keeps the text its log recorded. |
ENSO_HOME/secrets.env |
ensoSecretsPath |
The operator; and the web server, only TAVILY_API_KEY, when Settings › Web tools sets, replaces or removes it (#932) — that one line changed, every other kept, written owner-only and renamed over. Harness code reads and quarantines but never writes it. |
Per-user until the operator edits or removes it, or Settings removes the Tavily key; secret reads are per call. |
node_modules/.cache/enso/print-harness |
printHarnessDir |
scripts/print-harness.ts#materializePrintHarness rebuilds the package mirror for non-interactive launches. |
Per-checkout build cache (its links point into this checkout); reconciled on every print launch. |
Harness manifest resources
Section titled “Harness manifest resources”Generated from the pi manifest. Extension order is declaration order and is deliberately not sorted;
the other resource arrays are also shown in declared order. A vendor path is any path rooted at
node_modules/; repository paths are package-local.
| Kind | Declared order | Path | Origin |
|---|---|---|---|
| extensions | 1 | ./extensions/logging/index.ts |
repository path |
| extensions | 2 | ./extensions/guards/index.ts |
repository path |
| extensions | 3 | ./extensions/web-fetch/index.ts |
repository path |
| extensions | 4 | ./extensions/web-search/index.ts |
repository path |
| extensions | 5 | node_modules/@gotgenes/pi-permission-system/src/index.ts |
vendor path |
| extensions | 6 | ./extensions/permission-modes/index.ts |
repository path |
| extensions | 7 | node_modules/pi-multi-account/index.ts |
vendor path |
| extensions | 8 | ./extensions/ask-user/index.ts |
repository path |
| extensions | 9 | ./extensions/write-receipt/index.ts |
repository path |
| extensions | 10 | ./extensions/system-prompt/index.ts |
repository path |
| extensions | 11 | ./extensions/run-context/index.ts |
repository path |
| extensions | 12 | ./extensions/incident-report/index.ts |
repository path |
| skills | 1 | ./skills |
repository path |
| prompts | 1 | ./prompts |
repository path |
| themes | 1 | ./themes |
repository path |
| themes | 2 | node_modules/@mammothb/pi-tokyonight-storm/themes |
vendor path |
