@zergai/ztc 0.26.5-dev.202611240151 → 0.26.6-dev.202611240947

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1058,6 +1058,8 @@ Their `data` contains the request fields; resolved events also contain the decis
1058
1058
  Use `requestId` to pair events, and `sessionId` to associate the run.
1059
1059
  Only `approved` allows the requested hook or tool; questions require `answered` with a string `answer`.
1060
1060
  Without a remote URL, headless mode keeps automatic approvals and selects each question's first option.
1061
+ Under `ZTC_PERMISSION_PROFILE_PINNED`, or where its host runs it (`ZTC_HOSTED=1`), it approves no call that starts a program outside the OS sandbox by itself (an LSP tool's language server, `run_and_capture`'s command, a Claude Code or Codex pane): it refuses one, naming the variable, and its JSON output carries `approval_denied` and status `hook_auto_denied`.
1062
+ The request a remote service is sent doesn't say whether the call starts a program outside the OS sandbox; a library host's approver is told, in `startsProgramsOutsideSandbox`.
1061
1063
 
1062
1064
  ### Environment-only sandboxes
1063
1065
 
@@ -1076,6 +1078,7 @@ node dist/cli_main.js --headless --json --cwd /workspace --session-file /workspa
1076
1078
  `ZTC_OPENAI_COMPATIBLE_BASE_URL` overrides saved compatible endpoint settings.
1077
1079
  `ZTC_CONFIG_DIR` selects the configuration directory; `ZTC_SESSIONS_DIR` selects the default session store.
1078
1080
  `--session-file` takes precedence for the active session's load and save operations.
1081
+ A host that runs such a run for someone sets `ZTC_HOSTED=1`: a run with a prompt or a Voyager task on its command line, or one on a `--session-file` thread, then starts only on a permission profile that requires the OS sandbox for the agent's commands and names the folders they may write (`allowedPaths`), or runs none (`--permission-profile workspace_autonomous`, say), and otherwise exits 2 saying why; with no approval service it approves no call that starts a program outside the sandbox by itself (see `ZTC_HOSTED` under [Environment Variables](#environment-variables)). The zerg service's one-shot run doesn't set the variable yet, so it starts on `trusted` as before (see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)).
1079
1082
  When `ZTC_ROUTER_REQUIRED=1`, `ZERG_PROXY_URL` and `ZERG_AUTH_TOKEN` select the required router and its credential.
1080
1083
  The required profile permits exactly one model, `openai/gpt-6.1-sol`, for the parent, subagents and compaction.
1081
1084
  A host can pin a different single model with `ZTC_ROUTER_REQUIRED_MODEL=provider/model`; `ZTC_PROVIDER`, `ZTC_MODEL` and callers cannot move it.
@@ -2442,8 +2445,11 @@ preserves normal interactive discovery.
2442
2445
  | Variable | Description |
2443
2446
  |----------|-------------|
2444
2447
  | `ANTHROPIC_API_KEY` | Anthropic API key for direct API billing |
2445
- | `ZTC_AUTH_TOKEN` | A ZergAI platform login, for the platform API named for it: `ZTC_API_BASE_URL`, a colony cell's `COLONY_PORT`, an API environment chosen in the settings, or that API's own `/api/zrouter` in `ZERG_PROXY_URL`. ZTC sends it nowhere when no platform API is named for it, and never sends a Zerg Router credential it can recognize in it to a platform API: an `sk-zr-` key or another prefix Router issues, a Router JSON Web Token (audience `zergrouter`), or a value ZTC also holds as a Router credential (the host's grant, `ZERG_AUTH_TOKEN`, your Router sign-in). An opaque Router token that ZTC holds nowhere else has no shape it can tell: with a platform API named, it is sent there as the login; with none named, it goes nowhere. `ZTC_API_ENVIRONMENT` and `ZERG_DEPLOY_TIER` name none, nor does a proxy the zerg image filled in from its tier (`ZERG_PROXY_URL_SOURCE`). For Zerg Router turns a host sets `ZTC_ROUTER_RUNTIME_GRANT` with `ZERG_ROUTER_BASE_URL`, and a person runs `ztc auth login`; see [Credentials a host hands over](#credentials-a-host-hands-over) |
2448
+ | `ZTC_AUTH_TOKEN` | A ZergAI platform login, for the platform API named for it: `ZTC_API_BASE_URL`, a colony cell's `COLONY_PORT`, an API environment chosen in the settings, or that API's own `/api/zrouter` in `ZERG_PROXY_URL`. ZTC sends it nowhere when no platform API is named for it, and never sends a Zerg Router credential it can recognize in it to a platform API: an `sk-zr-` key or another prefix Router issues, a Router JSON Web Token (audience `zergrouter`), or a value ZTC also holds as a Router credential (the host's grant, `ZERG_AUTH_TOKEN`, your Router sign-in). An opaque Router token that ZTC holds nowhere else has no shape it can tell: with a platform API named, it is sent there as the login; with none named, it goes nowhere. `ZTC_API_ENVIRONMENT` and `ZERG_DEPLOY_TIER` name none, nor does a proxy the zerg image filled in from its tier (`ZERG_PROXY_URL_SOURCE`). For Zerg Router turns a host sets `ZTC_ROUTER_RUNTIME_GRANT` with `ZERG_ROUTER_BASE_URL`, and a person runs `ztc auth login`; see [Credentials a host hands over](#credentials-a-host-hands-over). No Codex ZTC starts is given it, whatever it holds, nor another variable holding its value ([Codex's environment](#codexs-environment)) |
2446
2449
  | `ZTC_API_BASE_URL` | The ZergAI platform API (`https://api.zergai.com`, say) that issued `ZTC_AUTH_TOKEN`. The account check, `/zerg` and the zerg tools use it, and model turns can go through its `/api/zrouter` |
2450
+ | `ZERG_API_TOKEN` | The zerg image's platform token, which its entrypoint hands ZTC as `ZTC_AUTH_TOKEN` in zrouter mode when that is unset, and where ZergCloud's launch passes the host's Router grant too. A copy of a credential ZTC holds is taken out with it (see [Credentials a host hands over](#credentials-a-host-hands-over)); one ZTC doesn't hold is yours, and ZTC's children keep it, but no Codex ZTC starts is given it, whatever it holds, nor another variable holding its value ([Codex's environment](#codexs-environment)) |
2451
+ | `ZERG_AUTH_TOKEN` | The required Router's credential, with `ZERG_PROXY_URL`, when `ZTC_ROUTER_REQUIRED=1`. No Codex ZTC starts is given it, whatever it holds, nor another variable holding its value ([Codex's environment](#codexs-environment)) |
2452
+ | `ZTC_ROUTER_RUNTIME_GRANT` | A host's Router runtime grant, for the Router `ZERG_ROUTER_BASE_URL` names; see [Credentials a host hands over](#credentials-a-host-hands-over). No Codex ZTC starts is given it, whatever it holds, nor another variable holding its value ([Codex's environment](#codexs-environment)) |
2447
2453
  | `ZERG_PROXY_URL_SOURCE` | Set by the zerg image's entrypoint when it filled `ZERG_PROXY_URL` in itself, from `ZERG_DEPLOY_TIER` or `ZERG_ROUTER_BASE_URL`. ZTC then takes that proxy as naming no platform API, so on its own it gets `ZTC_AUTH_TOKEN` sent neither to that platform's API nor through the proxy. A `ZERG_PROXY_URL` the launcher names itself carries no mark |
2448
2454
  | `ZTC_NO_BROWSER` | Set to `1` so ZTC never opens a browser (logins, `/mirror`, billing); it prints the URL instead. CI and test runs behave this way already |
2449
2455
  | `ZTC_DEBUG` | Enable debug logging |
@@ -2453,11 +2459,13 @@ preserves normal interactive discovery.
2453
2459
  | `ZTC_DOCKER_CONTAINER` | Route file tools through Docker |
2454
2460
  | `ZTC_TODO_STORE` | Override path to the todo JSON file (defaults to `~/.ztc/todos/<projectHash>.json`) |
2455
2461
  | `ZTC_EXTENSION_DISCOVERY` | Set to `explicit` for env-root-plus-builtin discovery with no cwd/repository/home extensions or repo config, or `default` for normal discovery; unset, it is `explicit` under a host's Router runtime grant and `default` otherwise |
2462
+ | `ZTC_HOSTED` | Set to `1` by a host that runs ZTC for someone: ZergRouter's hosted runtime runs it as a hosted workbench, which allows one agent pane per thread (among its other limits ZTC opens no ZTC pane of its own there: "Hosted workbenches allow one agent pane per thread."), and a service may start a one-shot headless ZTC for a turn with it set (the zerg service's doesn't yet: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)). ZTC then gives Codex only the allowlisted environment, as it does on a host's `--session-file` thread ([Codex's environment](#codexs-environment)). A headless start there whose settings are its launch's, `ztc`'s or `zerg-ztc-headless`'s, doesn't start where the permission profile it holds once its startup is done (`--permission-profile`'s, a host thread's under `--headless --mirror`, or the one `config.json` saves) runs the agent's commands without requiring an OS sandbox for them, or writes and runs them but names no `allowedPaths`, by the tests `ZTC_PERMISSION_PROFILE_PINNED` applies to them: `trusted`, the default, or one that only asks for the sandbox, under which its commands, and the programs some of its tools start, would run outside one with whatever ZTC itself can reach, as root where the host runs ZTC as root; or one that requires the sandbox but names no roots, whose commands may write in whatever folder the agent runs them in (`run_command`'s `cwd`), ZTC's own state among them. Such a start is a run with a prompt or a Voyager task on its command line (`-p <prompt>`, `--prompt`, `--prompt-file`, `--voyager-task`), one on a `--session-file` thread, the mux workbench's among them, a headless mirror without mux (`--headless --mirror --no-mux`, whose prompts come through the mirror), and one that names a prompt or a thread where `ZTC_HEADLESS_MUX` is set (a headless mux gives it to every pane it opens, a shell pane's commands among them). It exits 2 before it asks any model, saying "ZTC did not start: its host runs it (ZTC_HOSTED=1), and the permission profile it would run on, trusted, doesn't require an OS sandbox (sandbox.requireOsEnforcement), so the agent's commands, and the programs some of its tools start, can run outside one, where they reach whatever ZTC itself can, its own state included. Start ZTC with --permission-profile and a profile that requires the OS sandbox (sandbox.requireOsEnforcement) and names the folders it may write in allowedPaths, as workspace_autonomous does, or one that runs no command (shell_exec off), or set ZTC_PERMISSION_PROFILE_PINNED=1 with such a profile.", or, for a profile with no roots, that it "lets the agent write and run commands but names no allowedPaths, so each command it runs may write in whatever folder the agent runs it in, ZTC's own state included." (`zerg-ztc-headless`, which takes no `--permission-profile`, says to save such a profile as `permissionProfile` in `config.json`, and closes the MCP servers it started before it exits). A profile that requires the OS sandbox and names its roots (`workspace_autonomous`, `ask_before_mutation`, a resident's `requireOsEnforcement` profile with its `allowedPaths`, any a host's thread gives) or runs no command (`safe_edits`) starts as before, and so does the mux workbench on a thread its host wrote before it started ZTC, as ZergRouter's hosted runtime writes one, whose settings require the sandbox; on a thread not written yet, or with a prompt on its command line and no thread, the workbench is checked on its launch's profile, as any start is. The mux workbench started with neither a thread nor a prompt on its command line, whose threads get their settings from its host once it runs, isn't checked (see the Limits). With no approval service such a headless run approves by itself no call that starts a program outside the OS sandbox (an LSP tool's language server, `run_and_capture`'s command, a Claude Code or Codex pane), which a profile that asks before each command (`tests_allowed`, `ask_before_mutation`) leaves it to approve: it refuses the call, saying "Permission denied: diagnostics starts a program outside the OS sandbox, and ZTC approves no such call by itself where its host runs it (ZTC_HOSTED=1). Give the run an approval service (--approval-url or ZTC_APPROVAL_URL) to decide it, or use run_command, which runs inside the sandbox.", as under `ZTC_PERMISSION_PROFILE_PINNED`; an approval service decides one as before. Any other value is none of this |
2463
+ | `ZTC_CODEX_ENV_ALLOWLIST` | Set to `1` (or `true`) to give every Codex ZTC starts, the codex app-server and a Codex pane, only the allowlisted environment, as a hosted runtime does, with nothing else of one: none of what `ZTC_HOSTED` brings (the hosted workbench's limits, the check of a headless start's permission profile), and no pin, which needs a profile that limits the agent and an OS sandbox under it ([Codex's environment](#codexs-environment)). The zerg image's entrypoint sets it, unless its launcher sets `0`. Without it, or with another value, Codex's environment is allowlisted only where its host runs ZTC |
2456
2464
  | `ZTC_MODEL_PINNED` | Set to `1` to pin the session to the provider and model it starts on (`ZTC_PROVIDER` and `ZTC_MODEL`, or `--provider` and `--model`): `/model`, `/models set` and `/models latest`, `/provider`, `/config`'s route settings and Zerg Router address (`zrouter-url`), `/connect`, the agent's own `ztc_command`, the mirror's model picker and routing setting, a resumed session's saved route and a host effort policy that names another model (schema 2) are refused with the pinned route named. A host `--session-file` thread saved on another route runs on the pinned route, and its other settings still apply. Effort and reasoning the model takes can still change. Where `ZTC_LLM_AUTH_MODE` also pins the routing, a refused switch names the pinned route. Not held: a Morph key saved while the session runs (`/config key morph`) takes a session pinned to Morph through Zerg Router to Morph's own API unless `ZTC_LLM_AUTH_MODE=zrouter` holds too; `/profile` can move it to the routing another profile saves unless `ZTC_LLM_AUTH_MODE` pins that, and where the environment names no Zerg Router, `/profile` and `/auth login --url` can change its Zerg Router address; and a new ZTC pane is pinned to the route it opens on: another model when it names one (the web client's "+ ZTC pane", the agent's `create_ztc_pane`), the route new panes start on when it names none (`ZTC_PROVIDER` and `ZTC_MODEL` pass to a pane, `--provider` and `--model` don't) |
2457
- | `ZTC_PERMISSION_PROFILE_PINNED` | Set to `1` (or `true`) to pin the session's permission profile and sandbox as its startup leaves them: the profile `--permission-profile` names, a host's `--session-file` thread gives it (a `--headless --mirror` resident's) or `config.json` saves, with that profile's definition, the sandbox settings and the tool permissions as ZTC holds them. ZergCloud's hub sets it next to `ZTC_MODEL_PINNED`. ZTC reads it once, as its startup ends (`zerg-ztc-headless` too), so nothing later in the process unsets it. A host that pins them means them to limit the agent: where the profile ZTC would pin limits nothing (`trusted`, the default, `local_full` or an id nothing defines, unless the sandbox settings require the OS sandbox), or runs the agent's commands without requiring an OS sandbox for them, whether it asks for none (one that only turns `computer_control` off, asks before a capability or limits shell commands or network hosts, where `/status` would say `OS command sandbox: not required, and none is used`) or only asks for one (one that names `allowedPaths` or `deniedPaths`, keeps commands off the network or names a sandbox backend, where `/status` would say `OS command sandbox: not required; enforced by seatbelt`, and under which the LSP tools, `run_and_capture` and `workflow` start programs outside the sandbox), ZTC doesn't start, whatever starts it (a one-prompt run; a resident, one on a host's thread with no settings yet included; a ZTC pane or colony cell a pinned session opens), and exits 2 saying "ZTC did not start: its host pins this session's permission profile and sandbox (ZTC_PERMISSION_PROFILE_PINNED), and the permission profile it would pin, trusted, limits nothing. Start ZTC with --permission-profile and a profile that limits the agent, such as workspace_autonomous, or unset ZTC_PERMISSION_PROFILE_PINNED.", or, for the second, that the profile "doesn't require an OS sandbox (sandbox.requireOsEnforcement), so the agent's commands, and the programs some of its tools start, can run outside one, where they reach ZTC's own state and the config.json the pin is taken from. Start ZTC with --permission-profile and a profile that requires the OS sandbox (set sandbox.requireOsEnforcement to true in it, as workspace_autonomous does) or runs no command (shell_exec off), or unset ZTC_PERMISSION_PROFILE_PINNED." (`zerg-ztc-headless`, which takes no `--permission-profile`, says to save such a profile as `permissionProfile` in `config.json`). Every other profile that limits the agent is pinned: one that requires the OS sandbox for its commands (`sandbox.requireOsEnforcement` in it or in the sandbox settings, or one that writes nothing), or runs none (`shell_exec` off in it or in the tool permissions), as every built-in one that limits the agent does. Your own commands (`!cmd` and `/shell`, `/diff`'s git, the commands `/optimize` runs), yours or a controller's, then run only inside the OS sandbox too, as the agent's do, under the pinned profile's roots with ZTC's own state hidden, even where the profile runs none of the agent's, and where no OS sandbox is usable they are refused with "OS sandbox enforcement required but unavailable: ..." (the Ink interface's run outside any: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)). From then on, whoever asks (you, a controller, a relayed line, the agent), `/permissions use` and `/permissions set`, a `/profile` switch, `create` or `duplicate` to a config profile that holds other ones, the settings panel's permission profile, tool permission and sandbox rows, a host thread's later `set_session_settings` revision that names another permission profile than the session started on (the thread's then, else the pinned one), a factory reset, which would remove `config.json` (`/config reset`, the settings panel's; `ztc config reset`, run from a shell, takes no pin), and a restart in place, your own `/restart` included, while `config.json` holds an edit to them (ZTC reads the file for it whatever its inode, size and modification time say, so an edit made in place that kept them counts too) are refused with "This session's permission profile and sandbox are pinned by its host (ZTC_PERMISSION_PROFILE_PINNED): ...", which names nothing of the profile, and nothing is saved, nor anything of a refused revision taken. A revision that names that profile is taken without its profile and sandbox, which the pin holds; a session that took no thread's settings as it started, pinned on a profile no revision can name (a resident's own), takes none. The profile's relative file roots (`workspace_autonomous`'s `.`) are resolved once, against the folder the session started in (its `--cwd`, the mounted workspace), and `/permissions` names them: a `/cd` elsewhere (yours, a controller's or a relayed one), an environment the session opens, or the agent built again there moves none, so the agent's file tools outside them are refused, and so are its commands there, which every pinned profile that runs them keeps in the OS sandbox (`workspace_autonomous`, `ask_before_mutation`, a resident's `requireOsEnforcement` profile). A restart in place starts the next ZTC in that folder, wherever an environment moved the session, and refuses one that would start elsewhere (a session the resume panel picks that works in another folder, or that folder gone); it hands that ZTC the variable, whatever this process's environment says of it by then, and what its pin was taken from as `config.json` or the host's thread gives it (in `ZTC_PERMISSION_PIN_SOURCE`, which that ZTC, `zerg-ztc-headless` too, takes out of its environment as it starts, before any MCP server connects, and which no MCP server, hook, pane or command is given, whatever an MCP server's `passEnv` names), with no built-in profile they don't redefine and no default (so an update that rewords a built-in profile or changes a default doesn't keep that ZTC from starting), and one that finds `config.json` or the host's thread changed them after the restart's check doesn't start, saying "ZTC did not start again in place: the permission settings it would pin changed after the ZTC it replaces checked them: ..." and exiting 2. Nor does a pinned ZTC update itself, since an update would put a ZTC its host didn't choose in its place: `/update` installs nothing and says "ZTC doesn't update itself in a session its host pins (ZTC_PERMISSION_PROFILE_PINNED): an update replaces the ZTC that holds the session's permission profile and sandbox, and a ZTC its host didn't choose might not hold them. Nothing was installed. Update ZTC where its host starts it, or with `ztc update` from a shell.", the native interface's start-up check, which installs a newer release with npm and starts it in place, doesn't run (the Ink interface's still installs one: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)), and the desktop app is given no context to start that ZTC again with, without which its updater installs no app update while that ZTC runs. An agent's `/ztc` compares the pane's saved profile with the pinned one by the folder the pane starts in. A reload takes no `config.json` edit to them, nor to the hooks, MCP servers, skills and workflows, as under a profile that limits the agent, and a save leaves another process's edit as it made it, never writing what the pin holds as yours. `/config scope clear` leaves them (the agent's is refused, and says its host pinned them), `/permissions` shows them and says they are pinned, `/status` names the profile and says "pinned by its host (ZTC_PERMISSION_PROFILE_PINNED)", and a Claude Code or Codex pane you open starts with its permission prompts, whatever `panes.agentPermissions` says. A ZTC pane opened from the session is given the variable and pins what it starts on itself (`--permission-profile` passes to it), or doesn't start where that limits nothing or doesn't require the OS sandbox; a colony cell inherits it. Not held: words that skip a Claude Code or Codex pane's permission checks (`/claude --dangerously-skip-permissions`), yours, a controller's or a relayed line's, still do, and a config profile that holds the same permission settings brings its own hooks and MCP servers, as without the pin. Without the variable, or with one that isn't `1` or `true`, nothing changes |
2465
+ | `ZTC_PERMISSION_PROFILE_PINNED` | Set to `1` (or `true`) to pin the session's permission profile and sandbox as its startup leaves them: the profile `--permission-profile` names, a host's `--session-file` thread gives it (a `--headless --mirror` resident's) or `config.json` saves, with that profile's definition, the sandbox settings and the tool permissions as ZTC holds them. ZergCloud's hub sets it next to `ZTC_MODEL_PINNED`. ZTC reads it once, as its startup ends (`zerg-ztc-headless` too), so nothing later in the process unsets it. A host that pins them means them to limit the agent: where the profile ZTC would pin limits nothing (`trusted`, the default, `local_full` or an id nothing defines, unless the sandbox settings require the OS sandbox), or runs the agent's commands without requiring an OS sandbox for them, whether it asks for none (one that only turns `computer_control` off, asks before a capability or limits shell commands or network hosts, where `/status` would say `OS command sandbox: not required, and none is used`) or only asks for one (one that names `allowedPaths` or `deniedPaths`, keeps commands off the network or names a sandbox backend, where `/status` would say `OS command sandbox: not required; enforced by seatbelt`, and under which the LSP tools, `run_and_capture` and `workflow` start programs outside the sandbox), ZTC doesn't start, whatever starts it (a one-prompt run; a resident, one on a host's thread with no settings yet included; a ZTC pane or colony cell a pinned session opens), and exits 2 saying "ZTC did not start: its host pins this session's permission profile and sandbox (ZTC_PERMISSION_PROFILE_PINNED), and the permission profile it would pin, trusted, limits nothing. Start ZTC with --permission-profile and a profile that limits the agent, such as workspace_autonomous, or unset ZTC_PERMISSION_PROFILE_PINNED.", or, for the second, that the profile "doesn't require an OS sandbox (sandbox.requireOsEnforcement), so the agent's commands, and the programs some of its tools start, can run outside one, where they reach ZTC's own state and the config.json the pin is taken from. Start ZTC with --permission-profile and a profile that requires the OS sandbox (set sandbox.requireOsEnforcement to true in it, as workspace_autonomous does) or runs no command (shell_exec off), or unset ZTC_PERMISSION_PROFILE_PINNED." (`zerg-ztc-headless`, which takes no `--permission-profile`, says to save such a profile as `permissionProfile` in `config.json`). Every other profile that limits the agent is pinned: one that requires the OS sandbox for its commands (`sandbox.requireOsEnforcement` in it or in the sandbox settings, or one that writes nothing), or runs none (`shell_exec` off in it or in the tool permissions), as every built-in one that limits the agent does. It doesn't start either where ZTC's own state (`ZTC_CONFIG_DIR`, `~/.ztc`, `ZTC_SESSIONS_DIR`, `ZTC_WORKSPACE_LAYOUT_DIR`) lies inside a folder that profile lets the agent write, its relative roots those of the folder the session starts in, but as a root of its own or a folder directly in one that is no link, which both sandboxes hold whole (so a root that is your home folder, holding `~/.ztc`, and `workspace_autonomous` started there, start), nor where `TMPDIR` or `/tmp`, where ZTC's runtime keeps its credential hand-offs, lies inside one or is one: a command there could rename a folder above it and carry it off under another name, forging the `config.json` the pin is taken from or reading a credential ZTC hands over. It exits 2 naming each and the root that holds it ("ZTC did not start: its host pins this session's permission profile and sandbox (ZTC_PERMISSION_PROFILE_PINNED), and ZTC's own state lies inside a folder the permission profile it would pin, resident, lets the agent write: TMPDIR (/workspace/.tmp) inside /workspace. ...") and says to keep them outside the profile's `allowedPaths`, own state as a root of its own or a folder directly in one that is no link, or to unset the variable; a profile that writes nothing isn't checked. Nor does it start on a profile that writes and runs the agent's commands but names no `allowedPaths`, whose commands write wherever they run, ZTC's own state and `TMPDIR` among it: it says to name the folders the profile may write in its `allowedPaths` (`.` for the folder ZTC starts in), as every built-in one that limits the agent and writes does. Your own commands (`!cmd` and `/shell`, `/diff`'s git, the commands `/optimize` runs), yours or a controller's, then run only inside the OS sandbox too, as the agent's do, under the pinned profile's roots with ZTC's own state hidden, even where the profile runs none of the agent's, and where no OS sandbox is usable they are refused with "OS sandbox enforcement required but unavailable: ..." (the Ink interface's run outside any, and `/environment service start` and `/job` run theirs as the profile has them: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)). A pinned headless run (`ztc --headless` or `-p`, `zerg-ztc-headless`) with no approval service approves by itself no call that starts a program outside the OS sandbox, which a pinned profile that asks before one (`tests_allowed`, `ask_before_mutation`) left it to approve: an LSP tool's language server, `run_and_capture`'s command, a Claude Code or Codex pane. It refuses the call, saying "Permission denied: diagnostics starts a program outside the OS sandbox, and ZTC approves no such call by itself while its host pins this session's permission profile and sandbox (ZTC_PERMISSION_PROFILE_PINNED). Give the run an approval service (--approval-url or ZTC_APPROVAL_URL) to decide it, or use run_command, which runs inside the sandbox."; an approval service decides one as before, and `run_command` is still approved. From then on, whoever asks (you, a controller, a relayed line, the agent), `/permissions use` and `/permissions set`, a `/profile` switch, `create` or `duplicate` to a config profile that holds other ones, the settings panel's permission profile, tool permission and sandbox rows, a host thread's later `set_session_settings` revision that names another permission profile than the session started on (the thread's then, else the pinned one), a factory reset, which would remove `config.json` (`/config reset`, the settings panel's; `ztc config reset`, run from a shell, takes no pin), and a restart in place, your own `/restart` included, while `config.json` holds an edit to them (ZTC reads the file for it whatever its inode, size and modification time say, so an edit made in place that kept them counts too) are refused with "This session's permission profile and sandbox are pinned by its host (ZTC_PERMISSION_PROFILE_PINNED): ...", which names nothing of the profile, and nothing is saved, nor anything of a refused revision taken. A revision that names that profile is taken without its profile and sandbox, which the pin holds; a session that took no thread's settings as it started, pinned on a profile no revision can name (a resident's own), takes none. The profile's relative file roots (`workspace_autonomous`'s `.`) are resolved once, against the folder the session started in (its `--cwd`, the mounted workspace), and `/permissions` names them: a `/cd` elsewhere (yours, a controller's or a relayed one), an environment the session opens, or the agent built again there moves none, so the agent's file tools outside them are refused, and so are its commands there, which every pinned profile that runs them keeps in the OS sandbox (`workspace_autonomous`, `ask_before_mutation`, a resident's `requireOsEnforcement` profile). A restart in place starts the next ZTC in that folder, wherever an environment moved the session, and refuses one that would start elsewhere (a session the resume panel picks that works in another folder, or that folder gone); it hands that ZTC the variable, whatever this process's environment says of it by then, and what its pin was taken from as `config.json` or the host's thread gives it (in `ZTC_PERMISSION_PIN_SOURCE`, which that ZTC, `zerg-ztc-headless` too, takes out of its environment as it starts, before any MCP server connects, and which no MCP server, hook, pane or command is given, whatever an MCP server's `passEnv` names), with no built-in profile they don't redefine and no default (so an update that rewords a built-in profile or changes a default doesn't keep that ZTC from starting), and one that finds `config.json` or the host's thread changed them after the restart's check doesn't start, saying "ZTC did not start again in place: the permission settings it would pin changed after the ZTC it replaces checked them: ..." and exiting 2. Nor does a pinned ZTC update itself, since an update would put a ZTC its host didn't choose in its place: `/update` installs nothing and says "ZTC doesn't update itself in a session its host pins (ZTC_PERMISSION_PROFILE_PINNED): an update replaces the ZTC that holds the session's permission profile and sandbox, and a ZTC its host didn't choose might not hold them. Nothing was installed. Update ZTC where its host starts it, or with `ztc update` from a shell.", the native interface's start-up check, which installs a newer release with npm and starts it in place, doesn't run (the Ink interface's still installs one: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)), and the desktop app is given no context to start that ZTC again with, without which its updater installs no app update while that ZTC runs. An agent's `/ztc` compares the pane's saved profile with the pinned one by the folder the pane starts in. A reload takes no `config.json` edit to them, nor to the hooks, MCP servers, skills and workflows, as under a profile that limits the agent, and a save leaves another process's edit as it made it, never writing what the pin holds as yours. `/config scope clear` leaves them (the agent's is refused, and says its host pinned them), `/permissions` shows them and says they are pinned, `/status` names the profile and says "pinned by its host (ZTC_PERMISSION_PROFILE_PINNED)", and a Claude Code or Codex pane you open starts with its permission prompts, whatever `panes.agentPermissions` says. Codex, as the codex app-server or in a Codex pane, is given only the allowlisted environment ([Codex's environment](#codexs-environment)). A ZTC pane opened from the session is given the variable and pins what it starts on itself (`--permission-profile` passes to it), or doesn't start where that limits nothing or doesn't require the OS sandbox; a colony cell inherits it. Not held: words that skip a Claude Code or Codex pane's permission checks (`/claude --dangerously-skip-permissions`), yours, a controller's or a relayed line's, still do, and a config profile that holds the same permission settings brings its own hooks and MCP servers, as without the pin. Without the variable, or with one that isn't `1` or `true`, nothing changes |
2458
2466
  | `ZTC_LLM_AUTH_MODE` | `zrouter`, `direct` or `auto`, over the saved Routing setting (`ZERG_LLM_AUTH_MODE` is read when it is unset; the zerg image sets it from its deploy tier). `zrouter` and `direct` pin the routing: a switch to a route that runs another way, from `/model`, `/provider`, `/models latest`, `/config`, `/connect`, the settings panel, the mirror or the agent's `ztc_command`, and a new ZTC pane that names a provider on one, are refused with the mode named, and nothing is saved. That is a local login (Codex, Kimi Code) or a provider's own key under `zrouter`, where Morph runs through Zerg Router even with a Morph key on this machine, and Zerg Router under `direct`. Any model on that routing can still be chosen. The pin refuses switches: it doesn't move a session that starts on another routing (a default saved before it, a `ZTC_PROVIDER` or `--provider` that names a local login), nor refuse a `/profile` switch to a profile saved on one, or a new ZTC pane that names no provider, which starts on the route new panes start on. `auto` picks each provider's routing and pins none |
2459
2467
  | `ZTC_PROMPT_CACHE_TTL` | The prompt cache ZTC asks for on a Claude model: `1h` (the default), `5m` or `off`, in any letter case. With `off`, ZTC's requests to Anthropic, and on Zerg Router's native Anthropic route, carry no `cache_control`, and a Claude turn on Zerg Router's chat route (on a host's Router runtime grant or your own Router key or sign-in) asks Router for no prompt cache either (`prompt_cache: false`), so Router adds none to a long system prompt and can price the turn (one it records without a price counts against a dollar spending limit at its whole hold). Zerg Router drops the field before any provider sees it (since Router #903), so ZTC adds no route for it, and a deck's or workspace's stored route plan, with its fallbacks, applies as with the variable unset. Use `off` only with a Router at or past #903: an older one (this repository's `zapps/zergrouter` among them) hands the field as it came to another provider's model that a stored route plan falls back to, which may refuse it, and ZTC adds no route to keep the turn on Claude (`allow_fallbacks: false`), since Router refuses one from a service-account key. A route plan of the turn's own (`zrouterRoutePlan`) that can fall back to another provider's model asks for nothing, nor do Router's Responses route and another provider's model. An older Router that refuses the field from a service-account key (400 "Unsupported service inference option") gets the turn again at once without it, and nothing more of it on that Router and key for the rest of the run, which ZTC says once among its runtime diagnostics (the Logs tab; stderr in a headless run). With `off`, the settings panel's "Compact before the cache expires" counts no Anthropic cache lifetime, unless you set "Prompt cache lifetime (seconds)" |
2460
- | `ZTC_ROUTER_RUNTIME_GRANT_FILE` | Path of a file holding the host's Router runtime grant, in place of `ZTC_ROUTER_RUNTIME_GRANT`: read once and removed as ZTC starts, so the environment ZTC was started with never holds the grant under `ZTC_ROUTER_RUNTIME_GRANT`. A copy the launcher also sets is still there: ZergCloud's launch sets the grant as `ZERG_API_TOKEN` and `ZTC_AUTH_TOKEN`, and in zrouter mode the zerg image copies `ZERG_API_TOKEN` into `ZTC_AUTH_TOKEN` when that is unset. The file keeps the grant out of ZTC's start environment only when no other variable holds it. A regular file with one name that only its owner can read; see [Credentials a host hands over](#credentials-a-host-hands-over) |
2468
+ | `ZTC_ROUTER_RUNTIME_GRANT_FILE` | Path of a file holding the host's Router runtime grant, in place of `ZTC_ROUTER_RUNTIME_GRANT`: read once and removed as ZTC starts, so the environment ZTC was started with never holds the grant under `ZTC_ROUTER_RUNTIME_GRANT`. A copy the launcher also sets is still there: ZergCloud's launch sets the grant as `ZERG_API_TOKEN` and `ZTC_AUTH_TOKEN`, and in zrouter mode the zerg image copies `ZERG_API_TOKEN` into `ZTC_AUTH_TOKEN` when that is unset. The file keeps the grant out of ZTC's start environment only when no other variable holds it. A regular file with one name that only its owner can read; see [Credentials a host hands over](#credentials-a-host-hands-over). No Codex ZTC starts is given the variable, nor the grant under any name ([Codex's environment](#codexs-environment)) |
2461
2469
  | `ZTC_MIRROR_SHARED_SECRET_FILE` | Path of a file holding the mirror's shared secret, in place of `ZTC_MIRROR_SHARED_SECRET`, taken the same way |
2462
2470
  | `ZTC_PLUGIN_PATHS` | Explicit plugin roots (platform-delimited) |
2463
2471
  | `ZTC_MODE_PATHS` | Explicit mode YAML roots (platform-delimited) |
@@ -2504,8 +2512,10 @@ under one wider than 24 columns, or beside a right-hand border is not withheld.
2504
2512
  **What a child gets.** ZTC keeps these credentials out of every child's own environment: the commands and tools its
2505
2513
  agent runs, hooks (a hook's `passEnv` can't name one, under its name or a copy's), stdio MCP servers (nor can an MCP
2506
2514
  server's `passEnv`), ZTC's native helpers, `git`, image helpers, the renderers it starts and the shells you open beside
2507
- ZTC get your environment without them. That keeps them out of what a child inherits, not out of reach of every program
2508
- (see Limits below). ZTC hands a child what it needs explicitly, and only these:
2515
+ ZTC get your environment without them. Codex, which ZTC starts as the codex app-server or in a Codex pane, gets less
2516
+ still: no platform or Router bearer at all, and where its host runs ZTC only an allowlisted environment (see
2517
+ [Codex's environment](#codexs-environment)). That keeps them out of what a child inherits, not out of reach of every
2518
+ program (see Limits below). ZTC hands a child what it needs explicitly, and only these:
2509
2519
 
2510
2520
  - A ZTC pane or colony cell ZTC opens (yours, its agent's, a split) gets the grant with the Router it names, explicit
2511
2521
  extension discovery and the host's effort policy, since it routes on them, and keeps them from its own children the
@@ -2596,6 +2606,53 @@ start takes them all.
2596
2606
  - ZTC used as a library takes nothing out of its environment, so a renderer it starts still inherits what a ZTC pane
2597
2607
  infers and routes with.
2598
2608
 
2609
+ #### Codex's environment
2610
+
2611
+ Codex runs the commands its model asks for with the environment ZTC starts it with, and so does every program its own
2612
+ `git` runs: a work tree's filter driver (a clean filter that a tracked `.gitattributes` selects and `.git/config`
2613
+ names) runs whenever Codex's git reads the work tree, even when the model's only command is `pwd`, since Codex turns
2614
+ fsmonitor and hooks off for its git but leaves filter drivers on. So every Codex ZTC starts, the codex app-server (a
2615
+ `codex_app_server` turn, the model list, the account status, the `/accounts` login) and a Codex pane (`/codex`, the
2616
+ chooser, the + menus, a resumed session, workspace-mcp's `open_pane`), is given:
2617
+
2618
+ - **No ZergAI platform or Zerg Router bearer, for anyone.** None of `ZTC_AUTH_TOKEN`, `ZERG_API_TOKEN`,
2619
+ `ZERG_AUTH_TOKEN`, `ZTC_ROUTER_RUNTIME_GRANT` and `ZTC_ROUTER_RUNTIME_GRANT_FILE`, whatever each holds (your own
2620
+ platform token too), nor any other variable holding one's value. A Codex pane has them blanked in its environment,
2621
+ and its shell unsets them again after your login files run, so one they export doesn't reach it either. On your own
2622
+ computer the rest of your environment reaches Codex: your SSH agent and toolchains, which your builds and git need,
2623
+ and in a Codex pane the sign-in methods your own Codex offers (`OPENAI_API_KEY` and the like). The app-server, which
2624
+ runs on the sign-in under its `CODEX_HOME`, is never given those.
2625
+ - **Only the allowlisted names, where Codex's environment is allowlisted:** where its host runs ZTC (`ZTC_HOSTED=1`, a
2626
+ `--headless --mirror` resident on a host's `--session-file` thread, `ZTC_PERMISSION_PROFILE_PINNED`), or asks for that
2627
+ alone (`ZTC_CODEX_ENV_ALLOWLIST=1`, which the zerg image's entrypoint sets). Codex then starts with only `CI`,
2628
+ `COLORTERM`, `FORCE_COLOR`, `HOME`, `LANG`, `LOGNAME`, `NO_COLOR`, `PATH`, `SHELL`, `TEMP`, `TERM`, `TMP`, `TMPDIR`,
2629
+ `TZ`, `USER` and `LC_*` (the names the bubblewrap sandbox gives a command), `CODEX_HOME`, the CA bundles a private CA
2630
+ or a TLS-inspecting proxy is trusted with (`CODEX_CA_CERTIFICATE`, `SSL_CERT_FILE`, `SSL_CERT_DIR`,
2631
+ `NODE_EXTRA_CA_CERTS`, `GIT_SSL_CAINFO`, `CURL_CA_BUNDLE` and `REQUESTS_CA_BUNDLE`) and the proxies (`HTTP_PROXY`,
2632
+ `HTTPS_PROXY`, `ALL_PROXY` and `NO_PROXY`, in both cases): never `CODEX_AUTH_JSON`, a key or a bearer. A Codex pane
2633
+ there also gets what its renderer gives every pane (its id, the terminal's type), starts from `/bin/sh`, not a login
2634
+ shell, whose files are its host's, and opens without ZTC's workspace tools, saying "Codex opened without ZTC's
2635
+ workspace tools (where its host keeps Codex to an allowlisted environment, a Codex pane is given no pane relay), so it
2636
+ cannot open or message other panes.": through the pane relay, what runs in the pane could open a pane with the rest of
2637
+ the environment.
2638
+
2639
+ Where Codex's environment is allowlisted, Codex runs only on the sign-in its `CODEX_HOME` holds, and nothing from the
2640
+ environment stands in for it. A Codex with none there is refused before any thread starts, as a Codex with no sign-in
2641
+ always was, and says what its host does about it: "codex_app_server has no sign-in in its CODEX_HOME, so nothing was
2642
+ sent. Where its host runs ZTC (ZTC_HOSTED, a host's thread, ZTC_PERMISSION_PROFILE_PINNED) or keeps Codex to the
2643
+ allowlisted environment (ZTC_CODEX_ENV_ALLOWLIST), Codex runs only on the sign-in its CODEX_HOME holds and is given no
2644
+ key from the environment in its place (OPENAI_API_KEY, CODEX_API_KEY, CODEX_AUTH_JSON). The host signs Codex in there
2645
+ (CODEX_HOME=<folder> codex login), or runs this thread through Zerg Router." A plain `ztc --headless --mirror` is no
2646
+ hosted runtime: it is your own session, whose Codex keeps your environment, but for the bearers.
2647
+
2648
+ **Limits.**
2649
+
2650
+ - This keeps the rest of the environment out of what Codex inherits, not out of reach of a program that looks for it:
2651
+ one running as the same user can still read the environment ZTC was started with (see the Limits under
2652
+ [Credentials a host hands over](#credentials-a-host-hands-over)), and reach the pane relay's socket where it finds it.
2653
+ - A `codex` you start yourself, in a shell pane say, gets that shell's environment, and the desktop app's native Codex
2654
+ panes, which its own launcher starts, are none of the Codex panes above.
2655
+
2599
2656
  #### A profile that limits the agent
2600
2657
 
2601
2658
  A permission profile limits the agent when it names `allowedPaths` or `deniedPaths`, shell or network limits, turns a
@@ -2615,16 +2672,17 @@ with none it runs no commands. Under one:
2615
2672
 
2616
2673
  - **ZTC's own state is never the agent's**, but for its commands, and the programs its tools start, where they run
2617
2674
  outside any OS sandbox (see the Limits). Its config folder, `~/.ztc`, its sessions and its runtime's hand-offs in a
2618
- temp folder are refused to the file tools, search, the project-context index and the host verifiers by name and, for
2619
- a hard link to one of them, by the file it is, and to the OS sandbox by name. Your own skills folder,
2675
+ temp folder are refused to the file tools, search, the project-context index and the host verifiers by name and, for a
2676
+ hard link to one of them, by the file it is, and to the OS sandbox by name, which also pins the folders above them in
2677
+ the command's roots so that no command carries them off under another name (below). Your own skills folder,
2620
2678
  `~/.ztc/skills`, stays readable, never writable, where discovery is not explicit. Commands that run outside any OS
2621
2679
  sandbox read and write that state as any program of yours does: those of a profile that runs them but asks for no OS
2622
2680
  sandbox for them (one that only turns `computer_control`, `screen_capture`, `ml_inference` or `file_read` off, asks
2623
2681
  before a capability, or limits shell commands or network hosts), and, on a host that has none, those of one that asks
2624
2682
  for it without requiring it (`/status` says `not enforced: no OS sandbox on this host`); neither kind starts under
2625
- `ZTC_PERMISSION_PROFILE_PINNED` (below). A profile whose sandbox block turns the network off
2626
- (`sandbox.network: false`) asks for the OS sandbox for its commands, as one that turns its `network` capability off
2627
- does.
2683
+ `ZTC_PERMISSION_PROFILE_PINNED`, nor as a headless start its host runs under `ZTC_HOSTED=1` (below). A profile whose
2684
+ sandbox block turns the network off (`sandbox.network: false`) asks for the OS sandbox for its commands, as one that
2685
+ turns its `network` capability off does.
2628
2686
  - **ZTC's own files must be its own, with one name.** ZTC doesn't start while `config.json` (or a backup of it),
2629
2687
  `router-auth.json`, `~/.ztc/hooks_approved.json`, `~/.ztc/plugin.yaml` or a pooled account's credential file in its
2630
2688
  config folder (a Codex `auth.json`, a Kimi Code `kimi-code.json`) is a hard link, a symbolic link or not a file:
@@ -2668,12 +2726,29 @@ with none it runs no commands. Under one:
2668
2726
  runs no command (`shell_exec` off) (`zerg-ztc-headless`: to save one as `permissionProfile`), or to unset the
2669
2727
  variable. Every other profile that limits the agent is pinned: one that requires the OS sandbox for its commands
2670
2728
  (`sandbox.requireOsEnforcement` in it or in the sandbox settings, or one that writes nothing), or runs none, as every
2671
- built-in one that limits the agent does. Your own commands (`!cmd` and `/shell`, `/diff`'s git, the commands
2672
- `/optimize` runs), yours or a controller's, then run only inside the OS sandbox too, as the agent's do, under the
2673
- pinned profile's roots with ZTC's own state hidden, even under one that runs none of the agent's (`safe_edits`), so
2674
- they reach neither that state nor the `config.json` the pin is taken from, and where no OS sandbox is usable they are
2675
- refused ("OS sandbox enforcement required but unavailable: ..."); the Ink interface's, and your hooks under a profile
2676
- that runs no command, run outside it (see the Limits). You, a controller, a relayed line and the agent are all
2729
+ built-in one that limits the agent does. It doesn't start either where ZTC's own state (`ZTC_CONFIG_DIR`, `~/.ztc`,
2730
+ `ZTC_SESSIONS_DIR`, `ZTC_WORKSPACE_LAYOUT_DIR`) lies inside a folder that profile lets the agent write (its relative
2731
+ roots are the folder the session starts in), but as a root of its own or a folder directly in one that is no link,
2732
+ which both sandboxes hold whole, so a root that is your home folder, and `workspace_autonomous` started there, start;
2733
+ nor where `TMPDIR` or `/tmp`, where ZTC's runtime keeps its credential hand-offs, lies inside one or is one. A command
2734
+ there could rename a folder above it and carry it off under another name, forging the `config.json` the pin is taken
2735
+ from or reading a credential ZTC hands over. It exits 2, naming each and the root that holds it, and says to keep them
2736
+ outside the profile's `allowedPaths` (own state may be a root of its own or a folder directly in one that is no link)
2737
+ or to unset the variable; a profile that writes nothing isn't checked. Nor does it start on a profile that writes and
2738
+ runs the agent's commands but names no `allowedPaths`, whose commands write wherever they run, `TMPDIR` among it: it
2739
+ says to name the folders the profile may write in its `allowedPaths` (`.` for the folder ZTC starts in). Your own
2740
+ commands (`!cmd` and `/shell`, `/diff`'s git, the commands `/optimize` runs), yours or a controller's, then run only
2741
+ inside the OS sandbox too, as the agent's do, under the pinned profile's roots with ZTC's own state hidden, even under
2742
+ one that runs none of the agent's (`safe_edits`), so they reach neither that state nor the `config.json` the pin is
2743
+ taken from, and where no OS sandbox is usable they are refused ("OS sandbox enforcement required but unavailable:
2744
+ ..."); the Ink interface's, and your hooks under a profile that runs no command, run outside it, and
2745
+ `/environment service start` and `/job` run theirs as the profile has them (see the Limits). A pinned headless run
2746
+ (`ztc --headless` or `-p`, `zerg-ztc-headless`) with no approval service approves by itself no call that starts a
2747
+ program outside the OS sandbox, which a pinned profile that asks before one (`tests_allowed`, `ask_before_mutation`)
2748
+ left it to approve (an LSP tool's language server, `run_and_capture`'s command, a Claude Code or Codex pane): it
2749
+ refuses the call, saying to give the run an approval service (`--approval-url` or `ZTC_APPROVAL_URL`) to decide it or
2750
+ to use `run_command`, which is still approved; so does a headless run its host runs under `ZTC_HOSTED=1` without the
2751
+ pin (below). You, a controller, a relayed line and the agent are all
2677
2752
  refused `/permissions use` and `set`, a `/profile` switch to a config profile that holds other ones, the settings
2678
2753
  panel's rows for them, a factory reset (it would remove `config.json`; `ztc config reset` from a shell takes no pin),
2679
2754
  and a restart in place (your `/restart` too) while `config.json` holds an edit to them. The host is refused a thread
@@ -2704,6 +2779,27 @@ with none it runs no commands. Under one:
2704
2779
  from a shell; the native interface's start-up check, which installs a newer release with npm and starts it in place,
2705
2780
  doesn't run; and the desktop app is given no context to start that ZTC again with, without which its updater installs
2706
2781
  no app update while that ZTC runs.
2782
+ - **A headless start its host runs keeps the agent's commands in an OS sandbox** (`ZTC_HOSTED=1`, which a host sets
2783
+ where it runs ZTC for someone), whether or not the host pins the profile. A start whose settings are its launch's,
2784
+ `ztc`'s or `zerg-ztc-headless`'s, doesn't start where the profile it holds once its startup is done
2785
+ (`--permission-profile`'s, a host thread's or the one `config.json` saves) runs the agent's commands without
2786
+ requiring an OS sandbox for them, or writes and runs them but names no `allowedPaths`, by the tests the pin applies
2787
+ (above): `trusted`, the default, or one that only asks for the sandbox, under which its commands, and the programs
2788
+ some of its tools start, would run outside one with whatever ZTC itself can reach; or one that requires the sandbox
2789
+ but names no roots, whose commands may write in whatever folder the agent runs them in. Such a start is a run with a
2790
+ prompt or a Voyager task on its command line (`-p <prompt>`, `--prompt`, `--prompt-file`, `--voyager-task`), one on
2791
+ a `--session-file` thread, a headless mirror without mux, and one that names a prompt or a thread where
2792
+ `ZTC_HEADLESS_MUX` is set (every pane of a headless mux has it). It exits 2 before it asks any model, naming the
2793
+ variable and saying to start ZTC with `--permission-profile` and a profile that requires the OS sandbox
2794
+ (`sandbox.requireOsEnforcement`) and names the folders it may write in `allowedPaths`, as `workspace_autonomous`
2795
+ does, or one that runs no command (`shell_exec` off), or to set `ZTC_PERMISSION_PROFILE_PINNED=1` with such a profile
2796
+ (`zerg-ztc-headless`: to save one as `permissionProfile` in `config.json`). The mux workbench (a `--headless --mirror`
2797
+ or `--headless-mirror` without `--no-mux`) is checked on a `--session-file` thread or a prompt on its command line
2798
+ too: on a thread its host wrote before it started ZTC, as ZergRouter's hosted runtime writes one, the thread's
2799
+ settings, which require the sandbox, are its profile, and it starts; on one not written yet it holds its launch's.
2800
+ Started with neither, its threads get their settings from its host once it runs, and it starts as before (see the
2801
+ Limits). With no approval service such a run approves no call that starts a program outside the OS sandbox by
2802
+ itself, as a pinned one doesn't (above), and says the variable is why.
2707
2803
  - **Hooks run inside the OS sandbox the profile requires, or not at all**, except under a profile whose agent writes
2708
2804
  nothing (`read_only`, `hosted_read_only`), where your own approved hooks run as before. In the sandbox a hook reads,
2709
2805
  beside the system's folders and the project, its own code, read-only: the program its command line starts (found on
@@ -2822,17 +2918,50 @@ with none it runs no commands. Under one:
2822
2918
  `deniedPaths` entry, or one of the folders of ZTC's own state (`~/.ztc`, its config folder, `ZTC_SESSIONS_DIR`,
2823
2919
  `ZTC_WORKSPACE_LAYOUT_DIR`), doesn't exist when a command starts, in a root the command writes, it stands an empty
2824
2920
  read-only folder over it for the command's run: the command can make neither it nor anything in it
2825
- (`Read-only file system`, `Is a directory` or `File exists`), so a denied `.env` or `.github/workflows` stays unmade.
2826
- bwrap makes that folder on the host, as you, with any folder above it that didn't exist either, and it stands there
2827
- for the whole of the command's run, a background command's too; every command this ZTC plans meanwhile stands one
2828
- there again, and ZTC removes them once the last of those commands ends, keeping one that something was put in.
2829
- Meanwhile your other programs see an empty folder there: writing `.env`, or reading it as dotenv and `docker compose`
2830
- do, gets `Is a directory`, and a file watcher sees the folder come and go around each command. A folder made above
2831
- it (`.github`, for a denied `.github/workflows`) is an ordinary writable folder on the host meanwhile, and what is
2832
- put in it stays. A file you put at the path while such a command runs, once you have removed its folder, is hidden
2833
- from the next command as a file is, with `/dev/null` over it. None is put outside the roots the command writes,
2834
- through a link below a root, under a read-only or emptied mount, under a profile that writes nothing, inside another
2835
- one, or in a folder you can't write, where the command can make nothing either (see the Limits).
2921
+ (`Read-only file system`, `Is a directory` or `File exists`), so a denied `.env` or `.github/workflows` stays unmade,
2922
+ and no command can rename a folder above it away to make it anew (below). bwrap makes that folder on the host, as you,
2923
+ and it stands there for the whole of the command's run, a background command's too; every command this ZTC plans
2924
+ meanwhile stands one there again, and ZTC removes it once the last of those commands ends, keeping one that something
2925
+ was put in. Meanwhile your other programs see an empty folder there: writing `.env`, or reading it as dotenv and
2926
+ `docker compose` do, gets `Is a directory`, and a file watcher sees the folder come and go around each command. A file
2927
+ you put at the path while such a command runs, once you have removed its folder, is hidden from the next command as a
2928
+ file is, with `/dev/null` over it. None is put outside the roots the command writes, under a read-only or emptied
2929
+ mount, under a profile that writes nothing, inside another one, or in a folder you can't write, where the command can
2930
+ make nothing either (see the Limits). On both, a folder above a denied path that doesn't exist either (`.github`, for
2931
+ a denied `.github/workflows`) is made before the command starts, as you and only inside the roots the command writes
2932
+ (by bwrap, or on macOS by ZTC), and pinned as every folder above a denial is (below): it stays writable, so
2933
+ `.github/dependabot.yml` and `.github/ISSUE_TEMPLATE/` land beside the denied `.github/workflows`, and a checkout adds
2934
+ `.github/CODEOWNERS` there, but no command can remove it or rename it away. It is an ordinary folder on the host
2935
+ meanwhile, and ZTC removes it once the commands it was made for have ended, if nothing was put in it.
2936
+ - **No command carries off what the sandbox hides with a folder above it.** Both sandboxes hide a denied path, ZTC's own
2937
+ state and its runtime's hand-offs by their paths, and a rename of a folder above one moved it out from under that: a
2938
+ command renamed `config` above a denied `config/prod/secrets.json` and read the file under its new name (on macOS in
2939
+ the same command, under bubblewrap in the next, whose plan hides the path by its old name), renamed a folder above a
2940
+ denial away and made the denied path anew, or built it elsewhere and renamed a folder into its place; ZTC's
2941
+ `config.json` two levels inside a root could be forged so, and a hand-off read in a `TMPDIR` inside one. Now every
2942
+ folder from a root the command writes down to a denied path, and, under a profile that limits the agent, to ZTC's own
2943
+ state and to its runtime's temp folder (`TMPDIR`, `/tmp`) where that lies inside a root, is pinned as itself:
2944
+ bubblewrap binds each onto itself, so a `mv` or `rmdir` of it gets `Device or resource busy`, and macOS's sandbox
2945
+ denies removing or making each as itself, so a `mv` of it, or of another folder into its place, gets
2946
+ `Operation not permitted`, exchange and exclusive renames included. It stays writable: a command writes in it as
2947
+ before, and on macOS `touch`, `chmod`, extended attributes and `tar`'s or `cp -p`'s restore of its times still work on
2948
+ it. macOS's sandbox pins a link among those folders as itself. bubblewrap can stand no mount on a link, so it plans no
2949
+ command whose `deniedPaths` entry is named through a symbolic link in a folder the command may write, the path itself
2950
+ included (`./secrets` a link to `.vault`), nor, under a profile that limits the agent, one whose ZTC's own state is:
2951
+ the command doesn't start, and the refusal names the link and what to name instead ("ZTC did not start this command:
2952
+ its permission profile denies ./secrets (/workspace/secrets), named through a link in a folder the command may write
2953
+ (/workspace/secrets). bubblewrap hides a path by a mount, which stands where a link leads and never on the link
2954
+ itself, so a command could remove or rename the link, and the next command would see what the denial hides at its real
2955
+ path. Name the denial by its real path (/workspace/.vault) in the profile's deniedPaths."; for ZTC's own state, to
2956
+ name `ZTC_CONFIG_DIR`, `HOME`, `ZTC_SESSIONS_DIR` and `ZTC_WORKSPACE_LAYOUT_DIR` by their real paths, or keep them
2957
+ outside the profile's roots). A link outside the roots the command writes, or one no hidden path runs through, plans
2958
+ as before. bubblewrap pins at most 256 folders a plan, besides those it pins for the repositories' git programs, and
2959
+ refuses a plan that would pin more: "ZTC did not start this command: hiding what its permission profile denies, and
2960
+ ZTC's own state, would pin 300 folders above them in the roots the command writes (each bound onto itself, so that no
2961
+ command can rename it away), more than the 256 a plan pins. Name fewer or shallower deniedPaths, or keep ZTC's own
2962
+ state (ZTC_CONFIG_DIR, ~/.ztc, ZTC_SESSIONS_DIR, ZTC_WORKSPACE_LAYOUT_DIR) and TMPDIR outside the profile's roots."
2963
+ macOS's sandbox has no such cap. Only the folders above something a plan hides are pinned, and a pinned folder can't
2964
+ be removed or renamed, with what that costs (see the Limits).
2836
2965
  - **On macOS, a sandboxed command that keeps the network gets IP networking and the system's name resolver, and connects
2837
2966
  to no other Unix socket.** It connects out to any address, listens and accepts on local ones and resolves names
2838
2967
  through the resolver's socket (`mDNSResponder`), but no other Unix socket is in its reach, in its workspace or outside
@@ -2918,12 +3047,38 @@ programs.
2918
3047
  let the user create user namespaces, as Ubuntu 24.04's AppArmor doesn't by default), every sandboxed command fails
2919
3048
  with bubblewrap's error, and none runs outside the sandbox, a profile's that only asks for it included; `/status`
2920
3049
  says so (above).
2921
- - Under bubblewrap, ZTC removes the empty folders that keep a denied path not made yet (above) once the command ends:
2922
- one can stay where ZTC is killed while the command runs, and where it exits or starts again in place then, since it
2923
- stops a running command without waiting for it to end (remove it with `rmdir`); and where two ZTCs run commands in
2924
- one workspace at once with the same denied path not made yet, the end of one's command can remove the folder the
2925
- other's stands on, and the other command can then make that path. A denied path that is a link leading nowhere is
2926
- neither hidden nor held: a command can remove the link and make the path.
3050
+ - ZTC removes the empty folders it makes for a denied path not made yet (above) once the command ends, bwrap's
3051
+ placeholder and the folders above it under bubblewrap, the folders above it on macOS: one can stay where ZTC is killed
3052
+ while the command runs, and where it exits or starts again in place then, since it stops a running command without
3053
+ waiting for it to end (remove it with `rmdir`). One ZTC doesn't count another's: where two run commands in one
3054
+ workspace at once with the same denied path not made yet, the end of one's command can remove a folder the other's
3055
+ command stands on, and under bubblewrap that command can then make the denied path, while on macOS it can no longer
3056
+ make the folder above it that the other ZTC made and removed.
3057
+ - Under bubblewrap each pinned folder (above) is a mount of its own, and a rename works within one mount only: a rename
3058
+ into or out of a pinned folder fails with `Invalid cross-device link`, as
3059
+ `git mv config/prod/app.yml config/staging/app.yml` does beside a denied `config/prod/secrets.json`, and so does a
3060
+ move from the root's own part into a pinned folder or, where `TMPDIR` lies inside a root and holds a hand-off of
3061
+ ZTC's, of a temp file from it into the workspace. `git mv`, Node's `fs.rename`, Rust's `std::fs::rename` and Python's
3062
+ `os.rename` fail so; GNU `mv` and Python's `shutil.move` copy instead. A rename within one pinned folder, or within
3063
+ the root's own part, goes through, and only the folders above something a plan hides are pinned: a profile that names
3064
+ no `deniedPaths`, with ZTC's own state and `TMPDIR` outside its roots, pins none.
3065
+ - On both, a command can't remove or rename a pinned folder (above): `rm -rf dist`, where `dist` holds a denied
3066
+ `dist/secret.key`, fails at `dist` (remove what is in it instead), and `git mv config cfg` above a denied
3067
+ `config/prod/secrets.json` is refused.
3068
+ - Under bubblewrap, ZTC's runtime hand-offs in a temp folder are hidden one by one, as they are when a command is
3069
+ planned, and the folders above those that exist then pinned: where `TMPDIR` lies in a command's view (inside or equal
3070
+ to a root the command writes, as it can be for a command a profile that names no `allowedPaths` runs in `TMPDIR` or
3071
+ `/tmp`), a hand-off ZTC makes while that command runs (a pane's credential or input, the host credential a relaunch is
3072
+ handed) is in its reach, and a `TMPDIR` that holds none when the command is planned isn't pinned, so that command can
3073
+ rename it. macOS's sandbox denies the hand-offs by pattern, now or later. `ZTC_PERMISSION_PROFILE_PINNED` keeps
3074
+ `TMPDIR` out of the agent's commands' roots (above).
3075
+ - bubblewrap binds each pinned folder by its path, which bwrap looks up again as it starts the command: a command still
3076
+ running from an earlier plan (one left in the background), for which that folder wasn't pinned, could replace it with
3077
+ a link in between, and bwrap would bind where the link leads. ZTC checks the folders as it plans the command, not as
3078
+ bwrap binds them.
3079
+ - bubblewrap's cap counts the folders a plan pins, not the bytes of bwrap's arguments: a profile with many long
3080
+ `deniedPaths` (up to 128 of up to 2,048 characters each) can make a plan whose arguments pass Linux's limit (2 MiB by
3081
+ default), and then bwrap starts no command (`Argument list too long`).
2927
3082
  - A restart in place checks `config.json` before it starts the next ZTC, which reads the file again as it starts: an
2928
3083
  edit another process makes in between to the hooks, MCP servers, skills or workflows is taken. Under
2929
3084
  `ZTC_PERMISSION_PROFILE_PINNED`, one to the pinned permission settings keeps that ZTC from starting instead.
@@ -2933,11 +3088,33 @@ programs.
2933
3088
  `ZTC_PERMISSION_PROFILE_PINNED`. Nor is the desktop app's start of ZTC after it installs an update, which doesn't
2934
3089
  check `config.json` first either, and which it makes only for a ZTC that isn't pinned (above).
2935
3090
  - Under `ZTC_PERMISSION_PROFILE_PINNED`, ZTC takes the pin as its startup ends, after it has started the MCP servers
2936
- `config.json` names: one that then doesn't start (the profile it would pin limits nothing or doesn't require an OS
2937
- sandbox, or the pinned settings changed after a restart's check) has started them by then. A ZTC started again in
2938
- place takes what it was handed (`ZTC_PERMISSION_PIN_SOURCE`) out of its environment before any of them starts, so
2939
- none holds it, but the environment the process was started with (`/proc/<pid>/environ` on Linux) still does, which a
2940
- program running as the same user can read, as it can read `config.json`.
3091
+ `config.json` names: one that then doesn't start (the profile it would pin limits nothing, doesn't require an OS
3092
+ sandbox, holds ZTC's own state or `TMPDIR` in its roots, or writes and runs commands but names no `allowedPaths`; or
3093
+ the pinned settings changed after a restart's check) has started them by then. A ZTC started again in place takes what
3094
+ it was handed (`ZTC_PERMISSION_PIN_SOURCE`) out of its environment before any of them starts, so none holds it, but
3095
+ the environment the process was started with (`/proc/<pid>/environ` on Linux) still does, which a program running as
3096
+ the same user can read, as it can read `config.json`.
3097
+ - Under `ZTC_HOSTED=1`, ZTC checks a headless start's profile as its startup ends, where the pin is taken, so a start it
3098
+ refuses has done what its startup does first: it has started the MCP servers `config.json` names (which it closes
3099
+ again before it exits), `zerg-ztc-headless` has loaded and built the handlers an `--agent-domain` names and, for
3100
+ `--effort` on a Zerg Router route, may have asked Router for its model catalog, and a headless mirror has loaded the
3101
+ plugins ZTC discovers. It checks a start whose settings are its launch's: a run with a prompt or a Voyager task on its
3102
+ command line, one on a `--session-file` thread, a headless mirror without mux, and one that names a prompt or a
3103
+ thread where `ZTC_HEADLESS_MUX` is set. The mux workbench started with neither a thread nor a prompt on its command
3104
+ line, whose threads get their settings from its host once it runs (a prompt a controller sends before then runs on
3105
+ the profile it started on), a ZTC pane (zmux's `--pane`, or the pane child a headless mux opens, which names
3106
+ neither), the terminal app and a headless run that takes its prompts on stdin with no `--session-file`
3107
+ (`--json-stream`, `ztc -p` with no prompt after it, or a prompt piped to `ztc --headless`) start on whatever profile
3108
+ they hold, as before. Without `ZTC_PERMISSION_PROFILE_PINNED` nothing holds the profile once the run has started:
3109
+ your own `/permissions use`, or a controller's, can still change it.
3110
+ - The zerg service's one-shot run (`run_headless_ztc`, `zerg/zerg/agent/core/workflows/ztc_headless/runtime.py`)
3111
+ doesn't set `ZTC_HOSTED` yet: the environment it gives the ZTC it starts (`zerg-ztc-headless`) keeps an allowlist of
3112
+ names that holds neither it nor `ZTC_PERMISSION_PROFILE_PINNED`, whatever the service's own holds, so that run starts
3113
+ on `trusted`, its commands outside any OS sandbox, as root where the service runs as root. For the check to hold it,
3114
+ the service must set `ZTC_HOSTED=1` in that environment itself; save, as `permissionProfile` in the run's own config
3115
+ folder (`ZTC_CONFIG_DIR`), a profile that requires the OS sandbox and names its roots, or one that runs no command,
3116
+ since `zerg-ztc-headless` takes no `--permission-profile`; and run where an OS sandbox is usable, which the zerg image
3117
+ isn't (it ships no bubblewrap).
2941
3118
  - Under `ZTC_PERMISSION_PROFILE_PINNED`, the Ink interface, which ZTC runs where its native interface isn't built
2942
3119
  (Windows, say), still installs a newer release with npm as it starts, for the next start to run (it starts nothing in
2943
3120
  place); `ZTC_DISABLE_UPDATE=1` keeps it from checking, and the `ztc` command the npm package installs sets it.
@@ -2949,6 +3126,11 @@ programs.
2949
3126
  reaches ZTC's own state, and the `config.json` the pin is taken from, as any program of yours does, and where the
2950
3127
  profile lets the agent write, a hook that runs the workspace's code (`npm run lint`) runs what the agent may have
2951
3128
  written there.
3129
+ - Under `ZTC_PERMISSION_PROFILE_PINNED`, `/environment service start` and the commands `/job` runs in named command
3130
+ panes are planned with the pinned profile's own sandbox settings, not with the OS sandbox required as your `!cmd` and
3131
+ `/shell` are: under a pinned profile that runs none of the agent's commands, which needn't require it, they run
3132
+ outside any OS sandbox where the profile asks for none or this host has none, and reach ZTC's own state and the
3133
+ `config.json` the pin is taken from.
2952
3134
  - `--new-window` in Terminal or iTerm starts the new window's ZTC in a shell of its own, which ZTC hands neither
2953
3135
  `ZTC_PERMISSION_PROFILE_PINNED` nor `ZTC_MODEL_PINNED`: that ZTC pins neither.
2954
3136
  - Settings that name programs ZTC runs when you ask aren't kept as ZTC started with them: the Codex app server's
@@ -2961,8 +3143,10 @@ programs.
2961
3143
  - Your own `/zerg launch` still runs Poetry in the working directory's `zerg/` project, which the agent may have
2962
3144
  written, as `make` there would.
2963
3145
  - A headless run with no approval client approves what a profile that asks would ask you (`--approval-url` hands those
2964
- decisions to a service), so there the tools above that start a program outside the sandbox can run. Under
2965
- `--computer-use`, the computer-control tools can type into any window.
3146
+ decisions to a service), so there the tools above that start a program outside the sandbox can run, but under
3147
+ `ZTC_PERMISSION_PROFILE_PINNED`, which refuses each such call there (above). The request an approval service is sent
3148
+ doesn't say whether a call starts a program outside the OS sandbox (a library host's approver is told, in
3149
+ `startsProgramsOutsideSandbox`). Under `--computer-use`, the computer-control tools can type into any window.
2966
3150
  - A mirror you start in the terminal UI (`ztc --mirror`, `/mirror`) with sign-in off, the default outside production,
2967
3151
  answers anyone on this computer (see the mirror's section) and takes their input as yours: under a profile that
2968
3152
  leaves the agent's commands the network (`workspace_autonomous`), a command of the agent's could post
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/zterm-darwin-arm64
3
3
  size: 35046592 bytes
4
- sha256: e0c1d69d0ef30a89adf64cb27524bc026cbfbec81bf77d919450419bb9a5b868
4
+ sha256: 8d8b0e479dd6b2056bb6ce936a51f4c1a3af94160a6dd4d1d017f4e3bb65c3d6
@@ -47,17 +47,62 @@ export interface CodexAppServerClientOptions {
47
47
  turnTimeoutMs?: number;
48
48
  }
49
49
  /**
50
- * Environment for the spawned `codex app-server`, pinned to the account's own
51
- * credentials. Injects the per-account CODEX_HOME (when given) and SCRUBS a
52
- * stray auth overrides from the parent env — otherwise the
53
- * codex CLI would bill that API key instead of the account's ChatGPT
54
- * subscription (auth.json under CODEX_HOME). It applies even with no
55
- * per-account home so an ambient key never hijacks the default ChatGPT login.
56
- * The app-server runs the commands Codex's model asks for with this
57
- * environment, so it starts from a user subprocess's (buildUserSubprocessEnv):
58
- * the person's own, and none of ZTC's credentials or its host's effort policy.
50
+ * What a Codex whose environment is allowlisted (config/hosted_runtime.ts codexEnvAllowlisted: its host runs ZTC, or
51
+ * asks for that alone) is given of its environment besides the names the bubblewrap sandbox gives a command
52
+ * (utils/subprocess_env.ts buildCredentialSafeSubprocessEnv: CI, COLORTERM, FORCE_COLOR, HOME, LANG, LOGNAME, NO_COLOR,
53
+ * PATH, SHELL, TEMP, TERM, TMP, TMPDIR, TZ, USER and LC_*): where its sign-in is (CODEX_HOME); the certificates a host's
54
+ * private CA or TLS-inspecting proxy is trusted with (CODEX_CA_CERTIFICATE and SSL_CERT_FILE, which the codex binary
55
+ * reads, SSL_CERT_DIR, NODE_EXTRA_CA_CERTS, which the npm package's node launcher and the node tools its commands run
56
+ * read, and GIT_SSL_CAINFO, CURL_CA_BUNDLE and REQUESTS_CA_BUNDLE, which git, curl and Python's requests read for the
57
+ * commands it runs); and the proxy it reaches OpenAI through (HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY, and their
58
+ * lowercase forms, which the codex binary reads, as curl, and so git, does). Nothing else: no key (CODEX_AUTH_JSON is
59
+ * none of these), no bearer, and none of the rest of the host's environment.
60
+ */
61
+ export declare const CODEX_APP_SERVER_HOSTED_ENV: readonly string[];
62
+ /**
63
+ * Environment for the spawned `codex app-server`, pinned to the account's own credentials: the per-account CODEX_HOME
64
+ * (when given), and none of the stray auth overrides (CODEX_AUTH_OVERRIDE_ENV), even with no per-account home, so an
65
+ * ambient key never hijacks the default ChatGPT login.
66
+ *
67
+ * The app-server runs the commands Codex's model asks for with this environment, and every program its own git runs
68
+ * with it too: a work tree's filter driver (a clean filter a tracked .gitattributes selects and .git/config names), which
69
+ * codex leaves on for its git as it turns fsmonitor and hooks off, ran with it when the model's only command was `pwd`
70
+ * (E1 round 13). So, for every user, it starts from a user subprocess's (buildUserSubprocessEnv: none of ZTC's own
71
+ * credentials or its host's effort policy, under any name) without any ZergAI platform or Zerg Router bearer, whatever
72
+ * it holds, or another name for one (PLATFORM_ROUTER_BEARER_ENV): Codex never needs one. On the person's own computer the
73
+ * rest is theirs, their SSH agent and toolchains among it, which their builds and git need. Where Codex's environment is
74
+ * allowlisted (config/hosted_runtime.ts codexEnvAllowlisted: its host runs ZTC, as ZTC_HOSTED=1, a host's thread or
75
+ * ZTC_PERMISSION_PROFILE_PINNED says, or asks for that alone, with ZTC_CODEX_ENV_ALLOWLIST=1, as a ZergCloud zerg's
76
+ * entrypoint does) it is only the allowlisted names (buildCredentialSafeSubprocessEnv's, and
77
+ * CODEX_APP_SERVER_HOSTED_ENV): the rest of the host's environment reaches neither Codex nor anything it runs.
59
78
  */
60
79
  export declare function buildCodexAppServerEnv(codexHome?: string, base?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
80
+ /**
81
+ * How ZTC starts a Codex pane (panes/agent_panes.ts openAgentPane: /codex, the chooser, the + menus, a resume, the
82
+ * workspace server's open_pane), over the environment its renderer gives each pane, SOURCE's, read as ZTC was started
83
+ * with it: it is given what the codex app-server is (buildCodexAppServerEnv), since Codex's own git runs a work tree's
84
+ * filter driver there too (E1 round 13). WITHHELD are the names the pane's environment blanks and its shell unsets
85
+ * before Codex starts:
86
+ *
87
+ * - for every user, every ZergAI platform and Zerg Router bearer (PLATFORM_ROUTER_BEARER_ENV), set or not, since a login
88
+ * file may export one, and every other variable of SOURCE holding one's value; the rest is the person's own, the
89
+ * sign-in methods their own Codex offers among it, since a pane runs on none of ZTC's accounts, where the app-server
90
+ * runs on the sign-in under its account's CODEX_HOME;
91
+ * - where Codex's environment is ALLOWLISTED (config/hosted_runtime.ts codexEnvAllowlisted), every name of SOURCE that
92
+ * the codex app-server isn't given there. Such a pane starts from no login shell, whose files are its host's, and with
93
+ * no workspace tools, whose pane relay would open a pane with the rest.
94
+ */
95
+ export declare function codexPaneEnv(source?: NodeJS.ProcessEnv): {
96
+ allowlisted: boolean;
97
+ withheld: string[];
98
+ };
99
+ /**
100
+ * What a Codex request says where Codex's environment is allowlisted (codexEnvAllowlisted) and the app-server finds no
101
+ * sign-in under its CODEX_HOME. Every Codex with none is refused before a thread starts, so nothing was sent; there,
102
+ * nothing from the environment stands in for the sign-in, since the app-server is given no key (buildCodexAppServerEnv),
103
+ * and ZTC looks for none, so this says what its host does about it.
104
+ */
105
+ export declare const CODEX_HOSTED_NO_SIGN_IN: string;
61
106
  export interface CodexTurnOptions {
62
107
  model: string;
63
108
  system: string;