@zergai/ztc 0.26.6-dev.202611240947 → 0.27.1-dev.202611290545
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 +629 -167
- package/RUST_THIRD_PARTY_LICENSES.txt +5 -5
- package/bin/zmux-darwin-arm64 +0 -0
- package/bin/zmux-linux-x64 +0 -0
- package/bin/ztc-audio-darwin-arm64 +0 -0
- package/bin/ztc-capture-darwin-arm64 +0 -0
- package/bin/ztc-llm-darwin-arm64 +0 -0
- package/bin/ztc-tts-darwin-arm64 +0 -0
- package/bin/ztc-tui-darwin-arm64 +0 -0
- package/bin/ztc-tui-linux-x64 +0 -0
- package/bin/zterm-darwin-arm64 +2 -2
- package/dist/App.js +6 -1
- package/dist/agent/agent.d.ts +21 -15
- package/dist/agent/agent.js +389 -163
- package/dist/agent/backends/codex_app_server.d.ts +7 -1
- package/dist/agent/backends/codex_app_server.js +11 -1
- package/dist/agent/backends/gemini.js +22 -8
- package/dist/agent/commands/batch.js +8 -0
- package/dist/agent/commands/config.js +10 -0
- package/dist/agent/commands/environment.js +5 -5
- package/dist/agent/commands/goal.d.ts +1 -0
- package/dist/agent/commands/goal.js +2 -1
- package/dist/agent/commands/index.js +2 -1
- package/dist/agent/commands/manifest.js +4 -0
- package/dist/agent/commands/optimize.js +5 -2
- package/dist/agent/commands/pane_cli.d.ts +29 -0
- package/dist/agent/commands/pane_cli.js +303 -0
- package/dist/agent/commands/settings.js +13 -3
- package/dist/agent/commands/shannon.js +8 -0
- package/dist/agent/commands/update.js +15 -3
- package/dist/agent/commands/zerg.js +31 -1
- package/dist/agent/commands/ztc_pane.js +3 -1
- package/dist/agent/factory.d.ts +4 -0
- package/dist/agent/factory.js +11 -1
- package/dist/agent/loop_policy.d.ts +42 -5
- package/dist/agent/loop_policy.js +206 -3
- package/dist/agent/runtime/command_jobs.d.ts +5 -0
- package/dist/agent/runtime/command_jobs.js +241 -31
- package/dist/agent/runtime/command_wait.d.ts +2 -0
- package/dist/agent/runtime/command_wait.js +1 -0
- package/dist/agent/runtime/done_report.d.ts +18 -0
- package/dist/agent/runtime/done_report.js +130 -0
- package/dist/agent/runtime/execution_context.js +4 -1
- package/dist/agent/runtime/failure_cause.d.ts +2 -0
- package/dist/agent/runtime/failure_cause.js +35 -0
- package/dist/agent/runtime/policy.d.ts +14 -2
- package/dist/agent/runtime/policy.js +104 -12
- package/dist/agent/runtime/quiet_job.d.ts +18 -0
- package/dist/agent/runtime/quiet_job.js +48 -0
- package/dist/agent/runtime/recovery.d.ts +1 -5
- package/dist/agent/runtime/recovery.js +2 -44
- package/dist/agent/runtime/tool_runtime.d.ts +1 -0
- package/dist/agent/runtime/tool_runtime.js +2 -0
- package/dist/agent/subagent.js +6 -1
- package/dist/agent/tools/deferred.js +1 -0
- package/dist/agent/tools/index.d.ts +2 -0
- package/dist/agent/tools/index.js +1 -0
- package/dist/agent/tools/outcome.d.ts +15 -0
- package/dist/agent/tools/outcome.js +107 -0
- package/dist/agent/tools/pane.d.ts +2 -1
- package/dist/agent/tools/pane.js +21 -3
- package/dist/agent/tools/registry.js +2 -0
- package/dist/agent/tools/shell.d.ts +1 -0
- package/dist/agent/tools/shell.js +128 -17
- package/dist/agent/tools/sim_domain_tools.js +4 -2
- package/dist/agent/tools/supervision.js +4 -2
- package/dist/agent/tools/types.d.ts +3 -0
- package/dist/app/command_context.js +5 -9
- package/dist/app/conversation_compaction.d.ts +4 -2
- package/dist/app/conversation_compaction.js +16 -5
- package/dist/app/headless_shell_mode.d.ts +14 -0
- package/dist/app/headless_shell_mode.js +7 -0
- package/dist/app/hosted_resident.d.ts +356 -0
- package/dist/app/hosted_resident.js +677 -0
- package/dist/app/restart.js +11 -2
- package/dist/app/session_manager.d.ts +5 -0
- package/dist/app/session_manager.js +21 -6
- package/dist/app/session_messages.js +6 -6
- package/dist/app/workspace_layout_controller.js +7 -0
- package/dist/batch/worktree.d.ts +10 -0
- package/dist/batch/worktree.js +15 -0
- package/dist/bench/registry.js +4 -2
- package/dist/cli_args.js +1 -1
- package/dist/cli_main.js +80 -10
- package/dist/cli_ratatui.d.ts +75 -0
- package/dist/cli_ratatui.js +485 -84
- package/dist/components/InputArea.js +4 -4
- package/dist/config/execution.d.ts +10 -0
- package/dist/config/execution.js +10 -0
- package/dist/config/hosted_runtime.d.ts +4 -1
- package/dist/config/hosted_runtime.js +4 -1
- package/dist/config/permission_pin.d.ts +34 -2
- package/dist/config/permission_pin.js +52 -2
- package/dist/config/person_command_policy.d.ts +38 -0
- package/dist/config/person_command_policy.js +11 -0
- package/dist/config/profiles.d.ts +21 -0
- package/dist/config/profiles.js +56 -2
- package/dist/config/types.d.ts +4 -1
- package/dist/config.js +34 -19
- package/dist/desktop/daily/codex_exec_adapter.js +7 -2
- package/dist/desktop/daily/desktop_wiring.d.ts +7 -1
- package/dist/desktop/daily/desktop_wiring.js +11 -3
- package/dist/desktop/daily/recipes.js +20 -4
- package/dist/desktop/health.d.ts +24 -0
- package/dist/desktop/health.js +151 -0
- package/dist/desktop/native_dialogs.d.ts +37 -0
- package/dist/desktop/native_dialogs.js +105 -0
- package/dist/diagnostics/session_export.d.ts +1 -0
- package/dist/diagnostics/session_export.js +28 -0
- package/dist/embedded/registry.js +4 -2
- package/dist/emulation/tool_adapters.js +9 -4
- package/dist/emulation/ztc_addendum.js +3 -0
- package/dist/headless.d.ts +11 -4
- package/dist/headless.js +99 -34
- package/dist/headless_approval.d.ts +6 -0
- package/dist/headless_cli.js +1 -1
- package/dist/hooks/runner.js +7 -6
- package/dist/library.d.ts +4 -0
- package/dist/library.js +3 -0
- package/dist/mcp/client.js +3 -3
- package/dist/modes/registry.js +13 -4
- package/dist/onboarding/setup_environment.js +13 -1
- package/dist/optimize/adapters/kernelbench.js +88 -10
- package/dist/optimize/adapters/types.d.ts +5 -0
- package/dist/optimize/executor.js +21 -0
- package/dist/panes/cli_install.d.ts +54 -0
- package/dist/panes/cli_install.js +157 -0
- package/dist/panes/model_catalog.js +3 -0
- package/dist/panes/new_pane_choices.d.ts +6 -2
- package/dist/panes/new_pane_choices.js +24 -12
- package/dist/panes/pane_cli_launch.d.ts +50 -0
- package/dist/panes/pane_cli_launch.js +124 -0
- package/dist/panes/pane_clis.d.ts +171 -0
- package/dist/panes/pane_clis.js +325 -0
- package/dist/panes/person_only_panes.d.ts +45 -0
- package/dist/panes/person_only_panes.js +117 -0
- package/dist/plugin/simulation_living.js +0 -2
- package/dist/plugin/simulation_living_engine.d.ts +1 -0
- package/dist/plugin/simulation_living_engine.js +1 -0
- package/dist/plugin/simulation_living_labels.d.ts +3 -0
- package/dist/plugin/simulation_living_labels.js +2 -0
- package/dist/router_auth.js +12 -1
- package/dist/session.js +26 -1
- package/dist/simulation/art/gemini_image.js +11 -5
- package/dist/simulation/domains/loader.js +25 -3
- package/dist/simulation/living/cold.d.ts +23 -0
- package/dist/simulation/living/cold.js +41 -0
- package/dist/simulation/living/context.d.ts +591 -1283
- package/dist/simulation/living/context.js +378 -244
- package/dist/simulation/living/contradictions.d.ts +14 -0
- package/dist/simulation/living/contradictions.js +282 -0
- package/dist/simulation/living/core/ids.d.ts +53 -0
- package/dist/simulation/living/core/ids.js +39 -0
- package/dist/simulation/living/core/kind.d.ts +20 -0
- package/dist/simulation/living/core/kind.js +15 -0
- package/dist/simulation/living/core/laws.d.ts +179 -0
- package/dist/simulation/living/core/laws.js +184 -0
- package/dist/simulation/living/core/ops.d.ts +257 -0
- package/dist/simulation/living/core/ops.js +34 -0
- package/dist/simulation/living/definer.d.ts +17 -1
- package/dist/simulation/living/definer.js +130 -51
- package/dist/simulation/living/definition.d.ts +174 -65
- package/dist/simulation/living/definition.js +287 -180
- package/dist/simulation/living/director.d.ts +80 -0
- package/dist/simulation/living/director.js +363 -0
- package/dist/simulation/living/frame.d.ts +108 -21
- package/dist/simulation/living/frame.js +111 -66
- package/dist/simulation/living/identifiers.d.ts +0 -1
- package/dist/simulation/living/identifiers.js +0 -3
- package/dist/simulation/living/index.d.ts +18 -9
- package/dist/simulation/living/index.js +18 -9
- package/dist/simulation/living/inference.d.ts +92 -50
- package/dist/simulation/living/inference.js +319 -175
- package/dist/simulation/living/knowledge.d.ts +28 -0
- package/dist/simulation/living/knowledge.js +73 -0
- package/dist/simulation/living/library.json +1177 -0
- package/dist/simulation/living/mechanics.d.ts +31 -34
- package/dist/simulation/living/mechanics.js +222 -138
- package/dist/simulation/living/model-input.d.ts +6 -3
- package/dist/simulation/living/model-input.js +18 -26
- package/dist/simulation/living/open-world.d.ts +74 -94
- package/dist/simulation/living/open-world.js +151 -30
- package/dist/simulation/living/phrases.d.ts +3 -0
- package/dist/simulation/living/phrases.js +37 -0
- package/dist/simulation/living/phrases.json +560 -0
- package/dist/simulation/living/projection.d.ts +316 -2
- package/dist/simulation/living/projection.js +50 -2
- package/dist/simulation/living/prompts/example-spec.json +11 -0
- package/dist/simulation/living/prompts/role-text.json +14 -0
- package/dist/simulation/living/prompts.d.ts +5 -0
- package/dist/simulation/living/prompts.js +275 -0
- package/dist/simulation/living/recall.d.ts +2 -2
- package/dist/simulation/living/reduce.d.ts +51 -14
- package/dist/simulation/living/reduce.js +941 -579
- package/dist/simulation/living/replay.d.ts +5 -4
- package/dist/simulation/living/replay.js +10 -9
- package/dist/simulation/living/runtime.d.ts +135 -25
- package/dist/simulation/living/runtime.js +1641 -583
- package/dist/simulation/living/scale.d.ts +96 -0
- package/dist/simulation/living/scale.js +124 -0
- package/dist/simulation/living/script.d.ts +5 -0
- package/dist/simulation/living/script.js +115 -0
- package/dist/simulation/living/shared-kinds.d.ts +4 -11
- package/dist/simulation/living/shared-kinds.js +11 -81
- package/dist/simulation/living/space.d.ts +14 -0
- package/dist/simulation/living/space.js +132 -0
- package/dist/simulation/living/state.d.ts +100 -0
- package/dist/simulation/living/state.js +393 -0
- package/dist/simulation/living/types.d.ts +829 -512
- package/dist/simulation/living/types.js +162 -187
- package/dist/simulation/living/world-rules.d.ts +100 -0
- package/dist/simulation/living/world-rules.js +267 -0
- package/dist/simulation/plugins/loader.js +11 -0
- package/dist/skills/loader.js +4 -0
- package/dist/tools.d.ts +1 -0
- package/dist/tools.js +1 -0
- package/dist/ui/ratatui/headless_pane_manager.d.ts +4 -1
- package/dist/ui/ratatui/headless_pane_manager.js +13 -9
- package/dist/ui/ratatui/pane_relay.js +29 -0
- package/dist/ui/ratatui/pane_type.d.ts +10 -0
- package/dist/ui/ratatui/pane_type.js +11 -0
- package/dist/ui/ratatui/process.d.ts +30 -0
- package/dist/ui/ratatui/process.js +133 -19
- package/dist/ui/ratatui/protocol.d.ts +124 -2
- package/dist/ui/ratatui/protocol.js +35 -0
- package/dist/ui/ratatui/relay_policy.js +3 -0
- package/dist/ui/ratatui/ztc_launch_trust.d.ts +2 -1
- package/dist/ui/ratatui/ztc_launch_trust.js +8 -1
- package/dist/ui/terminal_image.d.ts +12 -0
- package/dist/ui/terminal_image.js +21 -1
- package/dist/utils/codex_project_trust.d.ts +19 -0
- package/dist/utils/codex_project_trust.js +37 -0
- package/dist/utils/compaction.js +103 -20
- package/dist/utils/git_program_files.d.ts +19 -12
- package/dist/utils/git_program_files.js +411 -83
- package/dist/utils/host_shell.d.ts +10 -1
- package/dist/utils/host_shell.js +14 -1
- package/dist/utils/mid_turn_compaction.d.ts +2 -0
- package/dist/utils/mid_turn_compaction.js +2 -0
- package/dist/utils/models.js +6 -1
- package/dist/utils/sandbox.d.ts +109 -8
- package/dist/utils/sandbox.js +981 -187
- package/dist/utils/shell.d.ts +2 -0
- package/dist/utils/shell.js +10 -4
- package/dist/utils/subprocess_env.d.ts +47 -11
- package/dist/utils/subprocess_env.js +107 -15
- package/dist/utils/system_ps.d.ts +8 -0
- package/dist/utils/system_ps.js +39 -7
- package/dist/utils/unattended_compaction.d.ts +9 -0
- package/dist/utils/unattended_compaction.js +13 -0
- package/dist/utils/ztc_own_state.d.ts +8 -5
- package/dist/utils/ztc_own_state.js +17 -11
- package/dist/web/mirror_client.js +1 -0
- package/dist/web/mirror_stream.d.ts +50 -6
- package/dist/web/mirror_stream.js +160 -15
- package/dist/workflows/registry.js +3 -1
- package/dist/workspace/controller.js +12 -0
- package/dist/workspace_collision.d.ts +3 -0
- package/dist/workspace_collision.js +14 -1
- package/dist/workspace_session_context.js +2 -1
- package/dist/zlm-embed.mjs +3823 -1970
- package/node_modules/@zerg/model-contracts/README.md +16 -4
- package/node_modules/@zerg/model-contracts/index.js +6 -1
- package/npm-shrinkwrap.json +1 -1
- package/package.json +28 -51
- package/packages/model-contracts/README.md +16 -4
- package/packages/model-contracts/index.js +6 -1
package/README.md
CHANGED
|
@@ -90,6 +90,13 @@ LM Studio, or a custom server, configure `/config openai-compat` and select
|
|
|
90
90
|
`/model local [model]`. Switching providers selects an appropriate default model;
|
|
91
91
|
selecting the same provider preserves your current model.
|
|
92
92
|
|
|
93
|
+
`/model gemini gemini-4-neon` runs Gemini 4 Neon on your Google API key (`/config key
|
|
94
|
+
gemini`; Google offers it on the paid tier only): a 1,048,576-token window that input,
|
|
95
|
+
thinking and output share, 65,536 output tokens a request, and reasoning `low`,
|
|
96
|
+
`medium`, `high` or `xhigh`, with Google's default, `high`, when you choose none. ZTC
|
|
97
|
+
sends a Gemini key in the `x-goog-api-key` header, never in a URL, and withholds it
|
|
98
|
+
from an error that echoes the request.
|
|
99
|
+
|
|
93
100
|
Type `/model ` to search providers and current-provider models by ID, name, or alias.
|
|
94
101
|
Search is fuzzy, so `/model dskfl` finds DeepSeek Flash. Use Up/Down to select,
|
|
95
102
|
Tab or Enter to complete a provider and continue to its models. Enter on a model
|
|
@@ -377,32 +384,69 @@ When ZTC leaves without quitting (an uncaught exception or an unhandled
|
|
|
377
384
|
rejection, after which ZTC saves the session and leaves the window running, a
|
|
378
385
|
SIGKILL, running out of memory or a native crash), the window and every pane
|
|
379
386
|
stay under a banner, "ZTC (the agent runtime) stopped. Your panes keep
|
|
380
|
-
running.", with **
|
|
387
|
+
running.", with **Restart ZTC** (spawns a fresh ZTC harness that authenticates
|
|
388
|
+
over `owner_reattach_v1` using a rotating `0600` token file beside the socket
|
|
389
|
+
and takes back live pane ownership without interrupting a single running pane or
|
|
390
|
+
detached OS window), **Wait** (hides it), **Copy diagnostics** and **Quit (ends
|
|
381
391
|
panes)**. ZTC pings the desktop app every 2 seconds from its own event loop, so
|
|
382
392
|
when it hangs, the app notices within about 10 seconds (or once it has read
|
|
383
393
|
nothing the app wrote for 30 seconds) and shows "ZTC (the agent runtime) isn't
|
|
384
394
|
responding. Your panes keep running." with **End ZTC (keeps panes)** as well:
|
|
385
395
|
ZTerm closes its side of the connection, sends ZTC SIGTERM and, 3 seconds
|
|
386
396
|
later, SIGKILL, and keeps the panes. **Wait** hides that banner for 10 seconds.
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
397
|
+
ZTerm also publishes bounded 2-second renderer telemetry (`desktop_health_v1`)
|
|
398
|
+
and displays an interactive title-bar health chip with diagnostics and recovery
|
|
399
|
+
actions whenever UI frame latency, IPC stalls, FD pressure, or memory usage cross
|
|
400
|
+
warning/critical thresholds. In-situ updates also preserve your session without
|
|
401
|
+
losing a beat: `/update` hot-restarts the CLI via `execve --resume` (unless
|
|
402
|
+
`--no-restart` is passed), and `/restart` or `/update` in `ztc --desktop`
|
|
403
|
+
detaches cleanly from ZTerm without sending `shutdown` and reattaches the new
|
|
404
|
+
ZTC harness over `owner_reattach_v1` while every terminal, agent pane, and
|
|
405
|
+
detached window keeps running. A quit still closes the window and every pane:
|
|
406
|
+
Ctrl+C on an empty composer, `/exit`, closing the window or a SIGTERM to ZTC.
|
|
391
407
|
|
|
392
408
|
#### Native tool panes
|
|
393
409
|
|
|
394
410
|
In `ztc --desktop`, open the new-pane menu (Ctrl+Cmd+N at the focused pane, or
|
|
395
411
|
the ▾ beside the tab strip's +, or a right-click on +) and choose **More…** (or
|
|
396
|
-
press M)
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
412
|
+
press M), or open the native **Command Palette** (`Shift+Cmd+K`), to choose a
|
|
413
|
+
new pane. On ZTC Desktop (`desktop_native_dialogs_v1`), the **New pane**
|
|
414
|
+
chooser, desktop prompts, and delegated worker approvals render as native
|
|
415
|
+
non-blocking ZTerm modal dialogs directly over the active viewport without
|
|
416
|
+
stealing focus back to Main (#0) or blocking behind an open prompt in Main
|
|
417
|
+
(terminal renderers such as `zmux` keep the Main TUI picker fallback). The
|
|
418
|
+
chooser offers Claude Code, Codex, and ZTC interactive panes, plus delegated
|
|
419
|
+
Codex and ZTC workers. The existing **bash**, **ZTC**, and custom choices remain
|
|
420
|
+
available. **Shell (native, leased)** is a separate choice. If native support
|
|
421
|
+
cannot start, the existing desktop stays usable and omits these native choices.
|
|
422
|
+
The + and Cmd+T still open a ZTC tab at once, and Cmd+D and Shift+Cmd+D split a
|
|
423
|
+
shell. A pane you choose splits the pane you opened the menu at (a delegated
|
|
424
|
+
worker opens in its own tab), and Escape cancels without moving focus.
|
|
425
|
+
|
|
426
|
+
Non-Main tabs can also be torn off into separate native OS windows
|
|
427
|
+
(`desktop_multi_window_v1`) by dragging a tab out of the window (or
|
|
428
|
+
Option-dragging it vertically out of the tab strip), choosing **Move Tab to New
|
|
429
|
+
Window** from a tab's context menu or the Command Palette, or pressing
|
|
430
|
+
`Option+Shift+Cmd+N`. Detached windows share the live workspace and GPU texture
|
|
431
|
+
atlas, can be reattached back into the primary tab strip at any time, and close
|
|
432
|
+
their own tabs without quitting the app.
|
|
433
|
+
|
|
434
|
+
ZTerm also includes native GPU workspace surfaces and polish directly in the
|
|
435
|
+
desktop shell:
|
|
436
|
+
- **File Tree, Fuzzy File Picker & Diff Viewer** — open the fuzzy file picker
|
|
437
|
+
(`Cmd+P` / `Ctrl+Shift+O` or `Command::OpenFilePicker`), toggle the collapsible
|
|
438
|
+
file-tree sidebar (`Cmd+B` / `Ctrl+Shift+B` or `Command::OpenFileTree`), and
|
|
439
|
+
inspect files or unified `git diff` hunks side-by-side without blocking
|
|
440
|
+
terminal input.
|
|
441
|
+
- **Native Preferences & Keybindings Editor** — press `Cmd+,` (`Ctrl+Shift+,` on
|
|
442
|
+
Linux/Windows) or open **Preferences & Keybindings…** from the Command Palette
|
|
443
|
+
to edit theme, font size, scrollback, Option-as-Alt, tab close/drag behavior,
|
|
444
|
+
automatic updates, and all 33 keyboard shortcuts (with live chord capture,
|
|
445
|
+
conflict detection, atomic `settings.json` persistence, and full non-colliding
|
|
446
|
+
defaults on macOS, Linux, and Windows).
|
|
447
|
+
- **Redacted Session Share (`desktop_session_share_v1`)** — click **Share** in
|
|
448
|
+
the title bar to preview, copy, or save a redacted session checkpoint directly
|
|
449
|
+
in ZTerm.
|
|
406
450
|
|
|
407
451
|
Native choices offer a new isolated Git worktree or the current worktree.
|
|
408
452
|
Interactive panes accept human terminal input. A native ZTC pane joins the
|
|
@@ -495,12 +539,15 @@ for Status recovery, resume refusals, receipt handling, and verification limits.
|
|
|
495
539
|
- **TTS synthesis** — multiple backends (macOS say, Parler, OpenAI, ElevenLabs)
|
|
496
540
|
- **Image support** — paste from clipboard (Ctrl+I), screenshot compression
|
|
497
541
|
- **Images in the transcript** — pasted images, image files the agent reads and
|
|
498
|
-
tool screenshots appear under their message.
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
542
|
+
tool screenshots appear under their message. ZTC Desktop (ZTerm), Ghostty, and
|
|
543
|
+
Kitty render full-resolution images inline: ZTC transmits zlib-compressed RGBA
|
|
544
|
+
pixels once with Kitty Unicode placeholders so images scroll cleanly into
|
|
545
|
+
history like text, and ZTerm uploads them as native GPU textures (`wgpu`/egui)
|
|
546
|
+
painted directly over the placeholder cells—both in Main (`ZtcSurface`) and in
|
|
547
|
+
terminal / child ZTC panes (`TerminalSurface`, which streams Kitty graphics
|
|
548
|
+
APCs from PTY output when `TERM_PROGRAM=zterm`). Other terminals and tmux show
|
|
549
|
+
a 24-bit half-block preview.
|
|
550
|
+
`ZTC_IMAGE_PROTOCOL=kitty`, `=blocks`, or `=none` overrides the detection.
|
|
504
551
|
- **Images tools return reach the model** — Anthropic, Bedrock, the ZergAI
|
|
505
552
|
platform and the Responses API carry a tool's image in its result. A Zerg
|
|
506
553
|
Router model whose model list says it takes images, and Gemini, get it right
|
|
@@ -871,12 +918,16 @@ has exited, so it can't take messages until it's started again."), until a ZTC
|
|
|
871
918
|
starts in it again with a fresh credential, as a ZTC pane's Resume starts one,
|
|
872
919
|
when messages wait for it again; started again without one, it is answered as
|
|
873
920
|
above. `create_supervised_ztc_pane` says whether its child's task waits for the
|
|
874
|
-
pane to join, or wasn't sent and why. The browser mirror's own ZTC
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
pane
|
|
921
|
+
pane to join, or wasn't sent and why. The browser mirror's own ZTC chat panes
|
|
922
|
+
join no bus and read their input, and get a message there as before. Under
|
|
923
|
+
`ZTC_PERMISSION_PROFILE_PINNED` the mirror types nothing into a pane that runs
|
|
924
|
+
no ZTC: `/pane-input` answers `403` with `ok: false` and the refusal, and
|
|
925
|
+
`/mux/command`'s `write_pane` answers `ok: false` with it; a message the browser
|
|
926
|
+
sends such a pane on the bus gets `403 refused`, in the same words. A Claude
|
|
927
|
+
Code or Codex pane's credential sits
|
|
928
|
+
in its environment. ZTC keeps its own panes and agents within these rules, but
|
|
929
|
+
it can't stop other programs running as you: one that reads that environment
|
|
930
|
+
can act as that pane, within what the pane's credential reaches.
|
|
880
931
|
|
|
881
932
|
The pane relay, the socket every pane's programs reach through
|
|
882
933
|
`$ZTC_PANE_RELAY`, forwards only a pane's reports on itself and its pane tools
|
|
@@ -1024,6 +1075,8 @@ ZTC sends each hook approval and each question with `POST <url>` and `Content-Ty
|
|
|
1024
1075
|
```
|
|
1025
1076
|
|
|
1026
1077
|
An approval uses `toolName`, `args`, `capabilities`, and an optional `reason`.
|
|
1078
|
+
An approval whose call starts a program outside `run_command`'s OS sandbox (an LSP tool's language server, `run_and_capture`'s command, a Claude Code or Codex pane) also carries `"startsProgramsOutsideSandbox": true`, whether the permission profile asked or a `PreToolUse` hook answered `ask`.
|
|
1079
|
+
An approval whose call starts none, a first-run hook approval and a question carry no such field.
|
|
1027
1080
|
A first-run hook approval names the hook command in `toolName`.
|
|
1028
1081
|
A question uses `kind: "question"`, `question`, and `options` instead of the tool fields.
|
|
1029
1082
|
Each option contains a `label`, a `description`, and optional `recommended` and `preview` fields.
|
|
@@ -1056,10 +1109,11 @@ JSON output includes `approval_requested` and `approval_resolved` for hook decis
|
|
|
1056
1109
|
Questions emit `ask_user` and `question_resolved`.
|
|
1057
1110
|
Their `data` contains the request fields; resolved events also contain the decision fields.
|
|
1058
1111
|
Use `requestId` to pair events, and `sessionId` to associate the run.
|
|
1112
|
+
With `--no-auto-accept`, an approval's events carry only its `requestId`, `tool` and `capabilities` (and the resolved one its `decision`), with `startsProgramsOutsideSandbox` where the request has it.
|
|
1059
1113
|
Only `approved` allows the requested hook or tool; questions require `answered` with a string `answer`.
|
|
1060
1114
|
Without a remote URL, headless mode keeps automatic approvals and selects each question's first option.
|
|
1061
1115
|
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
|
-
|
|
1116
|
+
A resident (`--headless --mirror`) asks its mirror's controller instead: its `hook_approval_request` event carries `starts_programs_outside_sandbox: true` for a call that starts a program outside the OS sandbox, as a ZTC pane's request to its parent's mirror does, and a library host's approver is told in `HookApprovalRequest`'s `startsProgramsOutsideSandbox`.
|
|
1063
1117
|
|
|
1064
1118
|
### Environment-only sandboxes
|
|
1065
1119
|
|
|
@@ -1357,6 +1411,10 @@ ZTC separates the official OpenAI Codex App Server integration from the older di
|
|
|
1357
1411
|
|
|
1358
1412
|
Use `ztc --provider codex_app_server` for the documented OpenAI App Server path. It launches `codex app-server` over JSONL stdio and uses App Server auth, model discovery, and dynamic tool calls. Run `codex login status` before starting ZTC if the machine-default login is unclear.
|
|
1359
1413
|
|
|
1414
|
+
ZTC's Codex threads load no project-local Codex config. The App Server trusts the folder a thread runs in when nothing has decided about it and the thread can write there, as ZTC's `workspace-write` threads can, and saves that trust in `CODEX_HOME` for the repository's root, or the main checkout's root for a linked worktree. A trusted folder's `.codex/config.toml` then starts its MCP servers, with the environment variables they ask for, and its hooks and exec rules, outside ZTC's OS sandbox. So each thread ZTC starts marks its folder and every folder above it `untrusted`, under the path given and the one it resolves to through links, a decision Codex never overrides. No `.codex/config.toml` in or above the folder loads, even one your own `codex` trusted before, and ZTC's threads save no trust in `CODEX_HOME`. The `config.toml` in `CODEX_HOME` still applies, so settings ZTC's threads should use belong there.
|
|
1415
|
+
|
|
1416
|
+
Earlier ZTC versions' threads did save that trust, and it stays: ZTC can't tell it from trust you gave, so it removes none. For the root of each repository a `codex_app_server` thread ran in, or the main checkout's root for a linked worktree, which covers every worktree of that repository (and, with codex 0.147, for a folder outside any repository itself), the `config.toml` of the `CODEX_HOME` the thread ran with holds `trust_level = "trusted"` under `[projects."<folder>"]`: `~/.codex` for the machine-default login unless you set `CODEX_HOME`, or an account's under `~/.ztc/accounts/`. A `codex` started with that `CODEX_HOME` still trusts those folders without asking and loads their `.codex/config.toml`: your own, and a Codex pane (`/codex`), which runs your own `codex` and decides by what its `CODEX_HOME` holds. Where a host runs ZTC, a Codex pane is given the `CODEX_HOME` the App Server used. Review the `[projects]` entries there and remove those you didn't make.
|
|
1417
|
+
|
|
1360
1418
|
To keep several ChatGPT accounts signed in for manual switching, add each as a separate `codex_app_server` profile:
|
|
1361
1419
|
|
|
1362
1420
|
```text
|
|
@@ -1465,6 +1523,32 @@ Optional App Server config:
|
|
|
1465
1523
|
| `/swarm-stop` | Exit conductor mode |
|
|
1466
1524
|
| `/mirror [port]` | Start browser mirror |
|
|
1467
1525
|
|
|
1526
|
+
### Optimization
|
|
1527
|
+
| Command | Description |
|
|
1528
|
+
|---------|-------------|
|
|
1529
|
+
| `/optimize <request>` | Compile a conversational optimization request into a typed plan; `--run` hands it on for execution. With no request it shows its flags |
|
|
1530
|
+
|
|
1531
|
+
#### KernelBench targets
|
|
1532
|
+
|
|
1533
|
+
A KernelBench run (`--eval kernelbench`) evaluates the CUDA path unless the request names one of the harness's other
|
|
1534
|
+
targets (`ztc/benchmarks`). Name it as `target=NAME`, in the request or in the evaluator's selector, and the harness gets
|
|
1535
|
+
`--target NAME`, on `run kernelbench` and on the layered stack (`kernelbench-stack`, for MPE) alike:
|
|
1536
|
+
|
|
1537
|
+
```sh
|
|
1538
|
+
/optimize kernelbench level 1 5 tasks target=NAME --eval kernelbench --run
|
|
1539
|
+
/optimize kernelbench level 2 with mpe then tge --eval kernelbench:target=NAME --run
|
|
1540
|
+
```
|
|
1541
|
+
|
|
1542
|
+
`NAME` starts with a letter or digit and holds letters, digits, `-` and `_`; punctuation or a quote right after it
|
|
1543
|
+
(`.` `,` `;` `:` `)` `!` `?`, quotes) ends it, as at the end of a sentence, so `(target=NAME).` names `NAME`. ZTC passes
|
|
1544
|
+
it lowercased. A `target=` that names no target that way (`target=`, `target=-x`, `target=x;y`, `target=x.y`) and two
|
|
1545
|
+
targets that differ stop the run with a note saying so: nothing runs on the CUDA path in place of a target asked for.
|
|
1546
|
+
The harness takes `--target NAME` as its own target flag `--NAME`, and refuses, exiting 2, a name it has no target flag
|
|
1547
|
+
for: `python3 -m benchmarks run --help` lists the ones it has. PTX keeps its own word: a request that says `ptx` passes
|
|
1548
|
+
`--ptx`. `/optimize`'s own `--target` names what to optimize, never a KernelBench target. The native candidate path (a
|
|
1549
|
+
file target with a task selector such as `--eval kernelbench:level1/22`) evaluates the CUDA/structural path only, so a
|
|
1550
|
+
`target=` beside a file target stops the run with a note; PTX and the harness's other targets remain legacy-backed.
|
|
1551
|
+
|
|
1468
1552
|
### Meta
|
|
1469
1553
|
| Command | Description |
|
|
1470
1554
|
|---------|-------------|
|
|
@@ -1871,6 +1955,10 @@ checks that the installed mutation runner still catches changes in a covered
|
|
|
1871
1955
|
simulation module. See [the migration contract](../docs/vitest-migration.md#ztc-terminal-harness-2026-10-02)
|
|
1872
1956
|
for the qualified versions and scope.
|
|
1873
1957
|
|
|
1958
|
+
While you work, `npm run test:affected` runs the unit tests your changes can
|
|
1959
|
+
reach; `npm run test:unit:ci` runs them all once before you push. See
|
|
1960
|
+
[docs/testing.md](docs/testing.md) for the tiers and when to run each.
|
|
1961
|
+
|
|
1874
1962
|
```bash
|
|
1875
1963
|
npm run build # Compile TypeScript + copy assets
|
|
1876
1964
|
npm run build:rust # Build native Rust binaries
|
|
@@ -2304,6 +2392,106 @@ and a headless or piped run says on stderr which of them holds it. `/status`,
|
|
|
2304
2392
|
`/model` and ZTC's notices count such a value as not set and name the key that
|
|
2305
2393
|
is sent instead.
|
|
2306
2394
|
|
|
2395
|
+
### Other coding-agent CLIs in panes
|
|
2396
|
+
|
|
2397
|
+
ZTC opens more coding-agent CLIs the way it opens Claude Code and Codex: your
|
|
2398
|
+
own installed, unmodified CLI, signed in with your own account through its own
|
|
2399
|
+
sign-in, in a new pane in this pane's folder. ZTC never reads, stores or
|
|
2400
|
+
forwards those sign-ins. Panes need zmux (plain `ztc`) or the desktop app.
|
|
2401
|
+
|
|
2402
|
+
| Command | CLI | Runs | Opening prompt | Signs in with |
|
|
2403
|
+
| --- | --- | --- | --- | --- |
|
|
2404
|
+
| `/antigravity` | [Antigravity](https://antigravity.google/docs/getting-started/) | `agy` | `--prompt-interactive=<prompt>` | its own Google sign-in, in the browser |
|
|
2405
|
+
| `/pi` | [Pi](https://pi.dev/) | `pi` | `-- <prompt>` | its own `/login` (a subscription or an API key) |
|
|
2406
|
+
| `/opencode` | [OpenCode](https://opencode.ai/docs/) | `opencode` | none: type it in the pane | its own `/connect`, per provider |
|
|
2407
|
+
| `/gemini` | [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `gemini` | `--prompt-interactive=<prompt>` | Sign in with Google (a Gemini Code Assist license), a Gemini API key or Vertex AI |
|
|
2408
|
+
| `/copilot` | [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli) | `copilot` | `--interactive=<prompt>` | its own `/login` with your GitHub account |
|
|
2409
|
+
| `/cursor` | [Cursor CLI](https://cursor.com/docs/cli/installation) | `cursor-agent` (its installer also links it as `agent`) | `<prompt>`, last | `agent login` in the browser, or a Cursor API key |
|
|
2410
|
+
|
|
2411
|
+
Gemini CLI's unpaid tier and Google One users moved to Antigravity CLI on June
|
|
2412
|
+
18, 2026 ([Gemini CLI's terms](https://www.geminicli.com/docs/resources/tos-privacy)):
|
|
2413
|
+
on such an account, use `/antigravity`.
|
|
2414
|
+
|
|
2415
|
+
Plain text after the command is the opening prompt (`/pi fix the flaky test`);
|
|
2416
|
+
text that starts with a flag is the CLI's own arguments, split as a shell would
|
|
2417
|
+
(`/gemini --model gemini-3-pro`); a leading `--` makes the rest the prompt, word
|
|
2418
|
+
for word. ZTC passes none of its own permission flags: each CLI asks before it
|
|
2419
|
+
runs commands, or doesn't, as its own settings say (Pi, for one, doesn't ask
|
|
2420
|
+
before each tool call).
|
|
2421
|
+
Ctrl+B c offers each one that is installed. ZTC looks for the CLI on your
|
|
2422
|
+
`PATH`, then in the folder its installer uses (`~/.local/bin`; OpenCode's
|
|
2423
|
+
`~/.opencode/bin`; Pi's `~/.pi/agent/bin` too) and the shared bin folders, and never in the
|
|
2424
|
+
project: a `PATH` entry that is relative, in a `node_modules` folder or inside
|
|
2425
|
+
the folder ZTC works in is skipped, so a repository can't put a program of its
|
|
2426
|
+
own in the CLI's place.
|
|
2427
|
+
|
|
2428
|
+
Only GitHub Copilot CLI takes ZTC's workspace server for one run without ZTC
|
|
2429
|
+
editing your configuration, through its own `--additional-mcp-config`, which
|
|
2430
|
+
adds to `~/.copilot/mcp-config.json` for that session: the server's command,
|
|
2431
|
+
and the names of the variables it reads, which Copilot fills from the pane's
|
|
2432
|
+
environment, never their values. A Copilot pane can then list, open, read, type
|
|
2433
|
+
into and message the other panes; Main doesn't yet answer its messages by itself
|
|
2434
|
+
as it does a Claude Code or Codex pane's. Antigravity, Pi, OpenCode, Gemini CLI
|
|
2435
|
+
and Cursor CLI read MCP servers only from their own settings files, so they get
|
|
2436
|
+
none.
|
|
2437
|
+
|
|
2438
|
+
An agent may open Pi, OpenCode, Gemini CLI, Copilot or Cursor with
|
|
2439
|
+
`ztc_command`, which its permission profile governs as it does a shell, and
|
|
2440
|
+
with a prompt alone: a flag of the CLI's own is yours to pass, and a one-word
|
|
2441
|
+
task a CLI that reads its prompt as words could take for one of its own commands
|
|
2442
|
+
(`/cursor update`) is refused.
|
|
2443
|
+
|
|
2444
|
+
**Antigravity is yours alone.** Google's [Antigravity
|
|
2445
|
+
FAQ](https://antigravity.google/docs/faq/) says that wrapping `agy` inside
|
|
2446
|
+
third-party coding agents or applications isn't supported on consumer plans,
|
|
2447
|
+
and that third-party software accessing Antigravity can get an account
|
|
2448
|
+
suspended. So `/antigravity` opens `agy` for you to use, as a terminal would,
|
|
2449
|
+
and ZTC drives it no other way: an agent's `/antigravity` (`ztc_command` doesn't
|
|
2450
|
+
offer it), a relayed one (another pane's message, a ZTC pane's input, a `/loop`
|
|
2451
|
+
tick), and an agent's pane (`create_terminal_pane`, or another pane's
|
|
2452
|
+
`create_pane` or `replace_pane` through the relay) whose program, or the script
|
|
2453
|
+
a shell or interpreter in it is handed (`sh -c 'agy …'`), starts `agy`, are
|
|
2454
|
+
refused. No agent, ZTC's or another pane's, can type into its pane, restart or
|
|
2455
|
+
replace it, or message it; the mirror's `/broadcast` passes it by, and what
|
|
2456
|
+
ZTC's own process token posts to the mirror (`/pane-input`, `/mux/command`, a
|
|
2457
|
+
bus message) is refused. Each refusal says why. What you type into the pane,
|
|
2458
|
+
at the keyboard or in your own browser mirror, is yours. A headless ZTC, whose
|
|
2459
|
+
input is the program's that runs it, doesn't open Antigravity at all.
|
|
2460
|
+
`/antigravity` never starts `agy` with its headless mode (`-p`, `--print`,
|
|
2461
|
+
`--prompt` and the print-mode flags) or its Agent Client Protocol (`agy acp`),
|
|
2462
|
+
whoever asks; ZTC never signs in to Antigravity for you, doesn't run `agy` to
|
|
2463
|
+
ask its version, and never starts its pane through MotSi. These refusals cover
|
|
2464
|
+
what ZTC opens, types and relays, not every command line: an agent your
|
|
2465
|
+
permission profile lets run commands could still run `agy` from its own shell
|
|
2466
|
+
tools, as it could any program on your `PATH`.
|
|
2467
|
+
|
|
2468
|
+
#### Installing a CLI
|
|
2469
|
+
|
|
2470
|
+
When the CLI isn't installed, `/pi` (and the others) offers its vendor's own
|
|
2471
|
+
install commands for your platform, verbatim, with the page each is from, and
|
|
2472
|
+
"Don't install" first; `/agents install <cli>` offers the same for any CLI,
|
|
2473
|
+
Claude Code and Codex included (`/claude` and `/codex` say how to install
|
|
2474
|
+
themselves as before). Only commands whose first program (`curl`, `npm`, `brew`)
|
|
2475
|
+
is found, outside the project, are offered, and the chooser shows the highlighted
|
|
2476
|
+
one whole, wrapped, however narrow the terminal. The one you pick runs in a new
|
|
2477
|
+
pane, from your login shell in your home folder, so a project's own `.npmrc`
|
|
2478
|
+
configures nothing, with a `PATH` of the folders ZTC looked in, so a project's
|
|
2479
|
+
bin folder on your `PATH` (from direnv or a virtualenv) runs nothing there; you
|
|
2480
|
+
see its output and answer anything it asks, and when it exits, press Enter
|
|
2481
|
+
there. If it exited 0 and ZTC finds the CLI, ZTC opens it with the prompt you
|
|
2482
|
+
typed; otherwise it says why and how. No command ZTC offers runs `sudo`, though
|
|
2483
|
+
a vendor's own script may ask for your password itself, there in the pane (Pi's
|
|
2484
|
+
does on Linux, to install Node.js or xz). ZTC never runs a command you or an
|
|
2485
|
+
agent typed, and never one without asking: only your own input starts an
|
|
2486
|
+
install. An agent's, a relayed input's, and where a host runs ZTC or pins its
|
|
2487
|
+
permissions (`ZTC_HOSTED`, `ZTC_PERMISSION_PROFILE_PINNED`) its controllers',
|
|
2488
|
+
are refused, and where ZTC can't ask (a headless run) it shows the commands
|
|
2489
|
+
instead. Installs run in a pane on macOS and Linux; on Windows ZTC shows the
|
|
2490
|
+
PowerShell, WinGet or npm commands to run.
|
|
2491
|
+
|
|
2492
|
+
`/agents` lists every CLI: its command, where it is installed and the version it
|
|
2493
|
+
prints (`--version`, briefly), or its install command for your platform.
|
|
2494
|
+
|
|
2307
2495
|
### Upgrading from the claude_code provider
|
|
2308
2496
|
|
|
2309
2497
|
ZTC no longer offers the `claude_code` and `claude_code_direct` providers, which
|
|
@@ -2447,8 +2635,8 @@ preserves normal interactive discovery.
|
|
|
2447
2635
|
| `ANTHROPIC_API_KEY` | Anthropic API key for direct API billing |
|
|
2448
2636
|
| `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)) |
|
|
2449
2637
|
| `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)) |
|
|
2638
|
+
| `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 on your own computer ZTC's children keep it, but for a command bubblewrap runs (Linux's OS sandbox), which starts with the allowlisted environment alone (`PATH`, `HOME`, `TMPDIR`, the locale variables and the like) and so keeps neither it nor your own settings, where macOS's sandbox keeps them (see [A profile that limits the agent](#a-profile-that-limits-the-agent)). Where its host runs ZTC (`ZTC_HOSTED=1`, a host's `--session-file` thread, `ZTC_PERMISSION_PROFILE_PINNED`), no program ZTC starts that is not a ZTC is given it, whatever it holds, nor, where its value is 12 characters or more, another variable holding that value, whole or inside a longer one (an `Authorization: Bearer …` header, a URL's `user:…@`): a command the agent or you run, a hook, an MCP server, the git ZTC runs and the clean filter or hook a work tree's config names, `/setup`'s checks and installs, a resident's pane shells and the panes the agent opens (what their `create_pane` hands them included), a native helper, the Shannon runner and the Zerg service `/zerg launch` starts. On a host's `--session-file` thread whose file is there, this holds from startup, before its MCP servers or its first `git status` start. A hook's or MCP server's `passEnv` naming it, or such a copy, is refused there, and the hook's result or the server's startup notice says so. There `/zerg launch` (and `/zerg serve`) starts no Zerg service that would route through Zerg Router (`ZERG_LLM_AUTH_MODE=zrouter`, or a `ZERG_PROXY_URL` under any mode but `direct`), which would have no credential to route with, and says so; one that infers directly (`ZERG_LLM_AUTH_MODE=direct`, or `auto`, the default, with no `ZERG_PROXY_URL`) still starts, but under `ZTC_PERMISSION_PROFILE_PINNED`, which starts none. A ZTC pane or colony cell is a ZTC, and keeps what it routes with (see the Limits under [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, for anyone ([Codex's environment](#codexs-environment)) |
|
|
2639
|
+
| `ZERG_AUTH_TOKEN` | The required Router's credential, with `ZERG_PROXY_URL`, when `ZTC_ROUTER_REQUIRED=1`. A headless run keeps it from its tools as a credential it routes with, and an MCP server is started without it unless its `passEnv` names it. Where its host runs ZTC (see `ZERG_API_TOKEN`), no program ZTC starts that is not a ZTC is given it or a copy: a `passEnv` naming it is refused there, and a model client (the Shannon runner, the Zerg service) isn't given it back; a ZTC pane, which routes with it, still is. No Codex ZTC starts is given it, whatever it holds, nor another variable holding its value ([Codex's environment](#codexs-environment)) |
|
|
2452
2640
|
| `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)) |
|
|
2453
2641
|
| `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 |
|
|
2454
2642
|
| `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 |
|
|
@@ -2459,13 +2647,13 @@ preserves normal interactive discovery.
|
|
|
2459
2647
|
| `ZTC_DOCKER_CONTAINER` | Route file tools through Docker |
|
|
2460
2648
|
| `ZTC_TODO_STORE` | Override path to the todo JSON file (defaults to `~/.ztc/todos/<projectHash>.json`) |
|
|
2461
2649
|
| `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 |
|
|
2650
|
+
| `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)). There, as on a host's `--session-file` thread and under `ZTC_PERMISSION_PROFILE_PINNED`, no program ZTC starts that is not a ZTC is given a ZergAI platform or Zerg Router bearer (`ZTC_AUTH_TOKEN`, `ZERG_API_TOKEN`, `ZERG_AUTH_TOKEN`, `ZTC_ROUTER_RUNTIME_GRANT`, `ZTC_ROUTER_RUNTIME_GRANT_FILE`), whatever it holds, nor another variable holding a bearer's value, whole or inside a longer one (the grant file's path is none), and a hook's or MCP server's `passEnv` naming one is refused (see `ZERG_API_TOKEN`); so `/zerg launch` there starts no Zerg service that would route through Zerg Router, which would have no credential to route with. 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 |
|
|
2651
|
+
| `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, the platform and Router bearers it keeps from every other program ZTC starts that is not a ZTC), 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 |
|
|
2464
2652
|
| `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) |
|
|
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 |
|
|
2653
|
+
| `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, where no folder lies between it and the root for a command to rename away with it (so a root that is your home folder, holding `~/.ztc`, and `workspace_autonomous` started there, start; a command can still reach it there by other means, so a host keeps it outside every root: see the Limits under [A profile that limits the agent](#a-profile-that-limits-the-agent)), 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 and the commands `/optimize` runs, in the native and the Ink interface alike, a `/job` command pane's and an `/environment` service's), 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: ..." (an `/environment` service's receipt says so as its failure). These, which would run your program or the work tree's code outside the OS sandbox, are refused, whoever asks: `/shannon-runner start`; `/zerg launch` and `/zerg serve`; an `/embedded` or `/bench` workspace and its workflows (`open`, `start`, `run`, and a launch that opens one); `/layout run` of a saved shell or command pane (a saved Claude Code or Codex pane is still resumed on its session); `/batch`, whose git runs the work tree's hooks and filters, and session isolation, for the same reason; a shell or command pane from the new-pane chooser (Shell, a custom option), the desktop app or a mirror's controller (`create_shell_pane`, `create_command_pane`); the editor Ctrl+G opens on a plan; a controller's `restart_pane`; and what a controller types into a pane that runs no ZTC (`write_pane`, which answers `ok: false` with the refusal, `/pane-input`, which answers `403` with it, and a message the browser sends such a pane on the bus, which `/bus/send` answers `403` with code `refused`). Each refusal says what wasn't started and what to do instead ("No Shannon runner was started: the runner would run outside the OS sandbox, and ZTC runs none of your programs outside it while its host pins this session's permission profile and sandbox (ZTC_PERMISSION_PROFILE_PINNED). Run it with !cmd, which runs inside the sandbox."); a refusal to type into a shell or command pane says to use `!cmd`, and one for any other pane names the panes that are typed into. A ZTC pane or colony cell, and a Claude Code or Codex pane, which asks before each of its commands under the pin, are still typed into, in a resident with panes (`--mux`) as in zmux and the desktop app. 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. On a hosted resident (the shell stubbed, `ZTC_HEADLESS_SHELL_MODE=stub`, as ZergCloud starts a ZeP service zerg), whose controllers run only `/clear`, `/compact`, `/context`, `/help`, `/status` and `/usage`, a controller's or a relayed line's `/permissions`, shown or used, is refused before the pin is asked ("/permissions is not available from this mirror. ..."), and the pin holds all the same: `/status` names the pinned profile, and the agent's commands run in the OS sandbox. 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)). Nor is any other program ZTC starts that is not a ZTC given a ZergAI platform or Zerg Router bearer, or a copy of one, and a hook's or MCP server's `passEnv` naming one is refused (see `ZERG_API_TOKEN`); a ZTC pane it opens is still handed the host's grant, and routes on it. 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 |
|
|
2466
2654
|
| `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 |
|
|
2467
2655
|
| `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)" |
|
|
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)) |
|
|
2656
|
+
| `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)), and where its host runs ZTC a hook's or MCP server's `passEnv` naming the variable is refused, as one naming any platform or Router bearer is (see `ZERG_API_TOKEN`). Its path is no bearer: a variable that holds the path, or a longer path that starts with it (a temp folder or a CA bundle beside the file), is kept wherever ZTC runs |
|
|
2469
2657
|
| `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 |
|
|
2470
2658
|
| `ZTC_PLUGIN_PATHS` | Explicit plugin roots (platform-delimited) |
|
|
2471
2659
|
| `ZTC_MODE_PATHS` | Explicit mode YAML roots (platform-delimited) |
|
|
@@ -2511,11 +2699,17 @@ under one wider than 24 columns, or beside a right-hand border is not withheld.
|
|
|
2511
2699
|
|
|
2512
2700
|
**What a child gets.** ZTC keeps these credentials out of every child's own environment: the commands and tools its
|
|
2513
2701
|
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
|
|
2514
|
-
server's `passEnv`), ZTC's native helpers,
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
[
|
|
2518
|
-
|
|
2702
|
+
server's `passEnv`), ZTC's native helpers, the programs `/setup` starts to check and install your tools, `git`, image
|
|
2703
|
+
helpers, the renderers it starts and the shells you open beside ZTC get your environment without them, but for a
|
|
2704
|
+
command bubblewrap runs (Linux's OS sandbox), which gets only an allowlisted environment, none of your own settings
|
|
2705
|
+
either (see [A profile that limits the agent](#a-profile-that-limits-the-agent)); macOS's sandbox keeps yours. Codex, which ZTC
|
|
2706
|
+
starts as the codex app-server or in a Codex pane, gets less still: no platform or Router bearer at all, and where its
|
|
2707
|
+
host runs ZTC only an allowlisted environment (see [Codex's environment](#codexs-environment)). Where its host runs ZTC
|
|
2708
|
+
(`ZTC_HOSTED=1`, a host's `--session-file` thread, `ZTC_PERMISSION_PROFILE_PINNED`), no program ZTC starts that is not a
|
|
2709
|
+
ZTC gets one either, yours included (a `ZERG_API_TOKEN` or `ZERG_AUTH_TOKEN` ZTC doesn't hold), nor a copy of one, and
|
|
2710
|
+
no `passEnv` can name one (see `ZERG_API_TOKEN` under [Environment Variables](#environment-variables)); its renderers
|
|
2711
|
+
keep yours (see Limits below). That keeps them out of what a child inherits, not out of reach of every program (see
|
|
2712
|
+
Limits below). ZTC hands a child what it needs explicitly, and only these:
|
|
2519
2713
|
|
|
2520
2714
|
- A ZTC pane or colony cell ZTC opens (yours, its agent's, a split) gets the grant with the Router it names, explicit
|
|
2521
2715
|
extension discovery and the host's effort policy, since it routes on them, and keeps them from its own children the
|
|
@@ -2537,7 +2731,11 @@ its panes without zmux, and starts them again otherwise (see Limits below).
|
|
|
2537
2731
|
**MCP servers and native helpers.** A stdio MCP server and ZTC's native helpers (dictation, speech, ML, computer use,
|
|
2538
2732
|
the zlicky overlay) also start without the credentials ZTC routes models with: `ZERG_AUTH_TOKEN`, `ZTC_API_KEY`, each
|
|
2539
2733
|
provider's key, a variable your profile names in `apiKeyEnv`, and any variable holding a copy of one, in the terminal
|
|
2540
|
-
app as in a headless run.
|
|
2734
|
+
app as in a headless run. The programs `/setup` starts to check and install your tools (git, gh, python3, curl, ssh,
|
|
2735
|
+
your shell, the package manager) start as a command you run does, so on your own computer they keep your keys:
|
|
2736
|
+
`gh auth status` signs in with a GitHub token that is also your model key (GitHub Models through `openai_compatible`,
|
|
2737
|
+
`OPENAI_COMPAT_API_KEY` holding it or `apiKeyEnv` naming `GITHUB_TOKEN`). If an MCP server needs a credential ZTC routes
|
|
2738
|
+
models with, list it in the entry's `passEnv`:
|
|
2541
2739
|
|
|
2542
2740
|
```json
|
|
2543
2741
|
"mcpServers": {
|
|
@@ -2546,13 +2744,15 @@ app as in a headless run. If an MCP server needs one, list it in the entry's `pa
|
|
|
2546
2744
|
```
|
|
2547
2745
|
|
|
2548
2746
|
`passEnv` never gives a server ZTC's own credentials or variables (those above, the mirror's port, the pane relay) or a
|
|
2549
|
-
variable holding a copy of one
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2747
|
+
variable holding a copy of one, nor, where its host runs ZTC, a ZergAI platform or Zerg Router bearer (`ZERG_AUTH_TOKEN`
|
|
2748
|
+
and `ZERG_API_TOKEN` among them) or a copy of one: the server starts without it, and its startup notice says so. The
|
|
2749
|
+
servers that start without a route credential you have set, and whose entries have no `passEnv`, are named in one line
|
|
2750
|
+
at startup, with the variables and never their values; the terminal app shows that line in its transcript too, and
|
|
2751
|
+
`/mcp` shows it under each. An entry with a `passEnv` of its own says what its server needs, and isn't named:
|
|
2752
|
+
`"passEnv": []` says it needs none. An entry's `env` still applies on top. A `passEnv` that isn't a list of variable
|
|
2753
|
+
names keeps the server from starting. `/mcp`, which an agent may run, shows an HTTP server's scheme, host and port,
|
|
2754
|
+
never its URL's userinfo, path or query, and a stdio server's command line with the value after a credential flag
|
|
2755
|
+
(`--token`, `--api-key` and the like) withheld.
|
|
2556
2756
|
|
|
2557
2757
|
**Under a grant.** A ZTC that holds a grant, one it can use or not, also:
|
|
2558
2758
|
|
|
@@ -2605,6 +2805,21 @@ start takes them all.
|
|
|
2605
2805
|
pane on a sign-in profile comes back on the default account.
|
|
2606
2806
|
- ZTC used as a library takes nothing out of its environment, so a renderer it starts still inherits what a ZTC pane
|
|
2607
2807
|
infers and routes with.
|
|
2808
|
+
- Where its host runs ZTC, a ZTC pane or colony cell is a ZTC: it keeps what it routes with (the host's grant, a
|
|
2809
|
+
required Router's `ZERG_AUTH_TOKEN`), and a colony cell inherits the rest of its parent's environment,
|
|
2810
|
+
`ZERG_API_TOKEN` included. Each keeps them from the programs it starts where it is the host's itself (`ZTC_HOSTED` and
|
|
2811
|
+
`ZTC_PERMISSION_PROFILE_PINNED` pass to it). Where only a host's `--session-file` thread makes a session the host's, a
|
|
2812
|
+
ZTC pane or colony cell it starts isn't: a colony cell's tool children keep the `ZERG_API_TOKEN` it inherits, and a
|
|
2813
|
+
ZTC pane's hooks and MCP servers can be given the `ZERG_AUTH_TOKEN` it routes with through their `passEnv`.
|
|
2814
|
+
- ZTC's renderers (zmux, ZTerm) hold none of ZTC's credentials, but keep your environment, your own bearers among it (a
|
|
2815
|
+
`ZERG_API_TOKEN` or `ZERG_AUTH_TOKEN` ZTC doesn't hold), wherever ZTC runs: a pane they start with their own
|
|
2816
|
+
environment has them, a shell or command pane you open in zmux or the desktop app under `ZTC_HOSTED=1` (the pin opens
|
|
2817
|
+
none) and one started with `replace_pane` or from a saved workspace (above) among them. A resident's panes and the
|
|
2818
|
+
panes the agent opens don't.
|
|
2819
|
+
- An MCP server entry's own `env` gives the server what it names, a bearer included, wherever ZTC runs.
|
|
2820
|
+
- The desktop app's daily driver (desktop mode only) starts its native panes and the CLIs' version checks with ZTC's own
|
|
2821
|
+
environment, your own bearers among it. `--branch` builds a Conductor branch's ZTC (`npm install`, `npm run build`)
|
|
2822
|
+
with the environment ZTC was started with, before that ZTC starts.
|
|
2608
2823
|
|
|
2609
2824
|
#### Codex's environment
|
|
2610
2825
|
|
|
@@ -2683,6 +2898,15 @@ with none it runs no commands. Under one:
|
|
|
2683
2898
|
`ZTC_PERMISSION_PROFILE_PINNED`, nor as a headless start its host runs under `ZTC_HOSTED=1` (below). A profile whose
|
|
2684
2899
|
sandbox block turns the network off (`sandbox.network: false`) asks for the OS sandbox for its commands, as one that
|
|
2685
2900
|
turns its `network` capability off does.
|
|
2901
|
+
- **Under bubblewrap a command starts with an allowlisted environment alone.** On Linux, bubblewrap starts a command
|
|
2902
|
+
it runs (the agent's, and your own where they run in the sandbox, `!cmd` under `ZTC_PERMISSION_PROFILE_PINNED`) with
|
|
2903
|
+
only these of ZTC's environment: `PATH`, `HOME`, `SHELL`, `USER`, `LOGNAME`, `TERM`, `COLORTERM`, `LANG` and the
|
|
2904
|
+
`LC_` variables, `TZ`, `TMPDIR`, `TMP`, `TEMP`, `CI`, `FORCE_COLOR` and `NO_COLOR` (`--clearenv`, then a `--setenv`
|
|
2905
|
+
for each, so no other value is in its argv). So such a command keeps nothing else of yours: no credential, a
|
|
2906
|
+
`ZERG_API_TOKEN` ZTC doesn't hold included, and no setting of your own (`NODE_OPTIONS`, a build's own variables). Set
|
|
2907
|
+
what a command needs in the command itself. macOS's sandbox keeps your environment, without the credentials ZTC keeps
|
|
2908
|
+
from every child (see [Credentials a host hands over](#credentials-a-host-hands-over)). A hook bubblewrap runs keeps
|
|
2909
|
+
the environment its runner gives it.
|
|
2686
2910
|
- **ZTC's own files must be its own, with one name.** ZTC doesn't start while `config.json` (or a backup of it),
|
|
2687
2911
|
`router-auth.json`, `~/.ztc/hooks_approved.json`, `~/.ztc/plugin.yaml` or a pooled account's credential file in its
|
|
2688
2912
|
config folder (a Codex `auth.json`, a Kimi Code `kimi-code.json`) is a hard link, a symbolic link or not a file:
|
|
@@ -2729,30 +2953,39 @@ with none it runs no commands. Under one:
|
|
|
2729
2953
|
built-in one that limits the agent does. It doesn't start either where ZTC's own state (`ZTC_CONFIG_DIR`, `~/.ztc`,
|
|
2730
2954
|
`ZTC_SESSIONS_DIR`, `ZTC_WORKSPACE_LAYOUT_DIR`) lies inside a folder that profile lets the agent write (its relative
|
|
2731
2955
|
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
|
-
|
|
2733
|
-
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
and a
|
|
2755
|
-
|
|
2956
|
+
where no folder lies between it and the root for a command to rename away with it, so a root that is your home
|
|
2957
|
+
folder, and `workspace_autonomous` started there, start; it isn't kept from every command there, though: under
|
|
2958
|
+
bubblewrap one that changes a folder's mode, and on macOS one that clones the root into another root, still reaches
|
|
2959
|
+
it (see the Limits), so a host keeps it outside every root. Nor does it start where `TMPDIR` or `/tmp`, where ZTC's
|
|
2960
|
+
runtime keeps its credential hand-offs, lies inside one or is one. A command there could rename a folder above it and
|
|
2961
|
+
carry it off under another name, forging the `config.json` the pin is taken from or reading a credential ZTC hands
|
|
2962
|
+
over. It exits 2, naming each and the root that holds it, and says to keep them outside the profile's `allowedPaths`
|
|
2963
|
+
(own state may be a root of its own or a folder directly in one that is no link) or to unset the variable; a profile
|
|
2964
|
+
that writes nothing isn't checked. Nor does it start on a profile that writes and runs the agent's commands but names
|
|
2965
|
+
no `allowedPaths`, whose commands write wherever they run, `TMPDIR` among it: it says to name the folders the profile
|
|
2966
|
+
may write in its `allowedPaths` (`.` for the folder ZTC starts in). Your own
|
|
2967
|
+
commands (`!cmd` and `/shell`, `/diff`'s git and the commands `/optimize` runs, in the native and the Ink interface
|
|
2968
|
+
alike, a `/job` command pane's and an `/environment` service's), yours or a controller's, then run only inside the OS
|
|
2969
|
+
sandbox too, as the agent's do, under the pinned profile's roots with ZTC's own state hidden, even under one that runs
|
|
2970
|
+
none of the agent's (`safe_edits`), so they reach neither that state nor the `config.json` the pin is taken from, and
|
|
2971
|
+
where no OS sandbox is usable they are refused ("OS sandbox enforcement required but unavailable: ..."); your hooks
|
|
2972
|
+
under a profile that runs no command run outside it (see the Limits). These, which would run your program or the work
|
|
2973
|
+
tree's code outside the OS sandbox, are refused, whoever asks, saying what wasn't started and what to do instead:
|
|
2974
|
+
`/shannon-runner start`, `/zerg launch` and `/zerg serve`, an `/embedded` or `/bench` workspace and its workflows,
|
|
2975
|
+
`/layout run` of a saved shell or command pane, `/batch` and session isolation (whose git runs the work tree's hooks
|
|
2976
|
+
and filters), a shell or command pane from the new-pane chooser, the desktop app or a mirror's controller, the editor
|
|
2977
|
+
Ctrl+G opens, a controller's `restart_pane`, and what a controller types into a pane that runs no ZTC. A ZTC pane, a
|
|
2978
|
+
colony cell and a Claude Code or Codex pane, which asks before each of its commands there, are still opened and typed
|
|
2979
|
+
into. A pinned headless run (`ztc --headless` or `-p`, `zerg-ztc-headless`) with no approval service approves by
|
|
2980
|
+
itself no call that starts a program outside the OS sandbox, which a pinned profile that asks before one
|
|
2981
|
+
(`tests_allowed`, `ask_before_mutation`) left it to approve (an LSP tool's language server, `run_and_capture`'s
|
|
2982
|
+
command, a Claude Code or Codex pane): it refuses the call, saying to give the run an approval service
|
|
2983
|
+
(`--approval-url` or `ZTC_APPROVAL_URL`) to decide it or to use `run_command`, which is still approved; so does a
|
|
2984
|
+
headless run its host runs under `ZTC_HOSTED=1` without the pin (below). You, a controller, a relayed line and the
|
|
2985
|
+
agent are all refused `/permissions use` and `set`, a `/profile` switch to a config profile that holds other ones, the
|
|
2986
|
+
settings panel's rows for them, a factory reset (it would remove `config.json`; `ztc config reset` from a shell takes
|
|
2987
|
+
no pin), and a restart in place (your `/restart` too) while `config.json` holds an edit to them. The host is refused a
|
|
2988
|
+
thread revision that names another profile than the session started on (its thread's then, or, where its thread had no
|
|
2756
2989
|
settings yet, the pinned one), and nothing of the revision is taken; one it takes leaves the pinned profile and
|
|
2757
2990
|
sandbox as they are. A session whose thread had no settings yet as it started, pinned on a profile no revision can
|
|
2758
2991
|
name (a resident's own), takes none. Each refusal names the variable, never the profile, and `/permissions` and
|
|
@@ -2860,13 +3093,30 @@ with none it runs no commands. Under one:
|
|
|
2860
3093
|
the command runs. Under a profile that names `allowedPaths`, the folder a `run_command` names as its `cwd` is no root
|
|
2861
3094
|
of its own, so a command there can't write outside the workspace (`.` used to name that folder); one that names none
|
|
2862
3095
|
keeps the folder a command runs in as its write root, while its relative `deniedPaths` are the session's folder's. The
|
|
2863
|
-
sandbox audit's `allowed_paths` and `denied_paths` name the roots so.
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
3096
|
+
sandbox audit's `allowed_paths` and `denied_paths` name the roots so. ZTC looks at each root once for a plan, or for a
|
|
3097
|
+
file tool's call, folder by folder from `/`, and everything after that look takes the root by the real path it found,
|
|
3098
|
+
resolving it no more (a root that changed as ZTC looked is no root for that plan or call, and says so), the look for
|
|
3099
|
+
the repositories whose programs the sandbox protects and its pins above them included (below). Both sandboxes hold
|
|
3100
|
+
every root by that real path: macOS's matches only real paths, and allows each root by its real path alone (a rule
|
|
3101
|
+
naming the root's link itself let a command remove the link and point it elsewhere, for the next command to follow),
|
|
3102
|
+
and bubblewrap binds a root named through a link as named and by its real path, and hides, or holds read-only, at both
|
|
3103
|
+
spellings what the plan keeps from a command in it (a denial, ZTC's own state, a hook's own files, where its
|
|
3104
|
+
repository names the programs git starts). A root inside another root, by those real paths, is that root's (below). A
|
|
3105
|
+
denial not made yet gets a placeholder at each spelling (below), on one folder of the host's, which ZTC makes and
|
|
3106
|
+
holds once however many spellings show it, under two roots that name one folder or a root that links into another too.
|
|
3107
|
+
So with the session's folder named through a link (a `/cd` to it by another name) a command still writes in the
|
|
3108
|
+
workspace, and a relative denial, one not made yet included, still keeps it out of the denied folder. That holds for a
|
|
3109
|
+
link no root the command writes holds: `~/link -> ~/real` where your home folder is no root, a `HOME` or a drive that
|
|
3110
|
+
is itself a link, a folder beside the workspace that links into it, and macOS's `/tmp` and `/var/folders`; a root
|
|
3111
|
+
named through a link in one of the roots is refused (below). bubblewrap enters a working directory named through a
|
|
3112
|
+
link into the workspace by its real path. Neither sandbox gives a command a working directory that a link in one of
|
|
3113
|
+
its roots leads outside them, as a command left running in the background can swap one in after the policy admitted
|
|
3114
|
+
the folder (`cwd: 'sub'`): macOS's reads such a folder only through the roots, so nothing where the link leads, and
|
|
3115
|
+
bubblewrap binds nothing through such a link and refuses to start the command there ("Permission denied: working
|
|
3116
|
+
directory is named through a link in a folder a command may write, which a command could have made, to a folder
|
|
3117
|
+
outside this profile's roots (<folder>), and bubblewrap binds no folder through such a link. ..."); macOS's read the
|
|
3118
|
+
folder by its real path as the plan resolved it again, after the policy's check, and its command read where the link
|
|
3119
|
+
led. One outside the roots and the system's folders every command reads (`/usr`, `/bin`, `/etc`), which a profile not
|
|
2870
3120
|
requiring the sandbox lets a command run in, it binds read-only, so the command starts, only where a filter refuses
|
|
2871
3121
|
the command Unix sockets (a profile without network, on x86-64 and arm64). Where none does, a read-only bind would
|
|
2872
3122
|
leave a host service's socket in that folder, or below it, in the command's reach, so bubblewrap binds no such folder:
|
|
@@ -2876,21 +3126,95 @@ with none it runs no commands. Under one:
|
|
|
2876
3126
|
it one there as its working directory, or none to run it in the session's folder.", the last words only where a root
|
|
2877
3127
|
holds the session's folder (under `allowedPaths: ['./build']` none does, and a command in the session's folder is
|
|
2878
3128
|
refused too). Without network, on an architecture ZTC has no such filter for (anything but x86-64 and arm64), the
|
|
2879
|
-
refusal says "for a command no filter keeps from Unix sockets, as ZTC has none for this architecture" in place of
|
|
2880
|
-
|
|
3129
|
+
refusal says "for a command no filter keeps from Unix sockets, as ZTC has none for this architecture" in place of "for
|
|
3130
|
+
a command that may use the network". Whatever the network, a working directory that is a folder where the host's
|
|
2881
3131
|
services keep their sockets (`/tmp`, `/var/tmp`, `/dev/shm`, `/run`, `/var/run`, `/run/user`, the session's
|
|
2882
3132
|
`XDG_RUNTIME_DIR`), lies in one (tmux's `/tmp/tmux-<uid>`; a drive the host mounts for you in `/run/media` lies in
|
|
2883
|
-
none, below) or holds one (`/var`, or `/`, which holds them all) is never bound so, since a read-only
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
3133
|
+
none, below) or holds one (`/var`, or `/`, which holds them all) is never bound so, since a read-only bind would put
|
|
3134
|
+
those sockets in reach (tmux's, the session bus, `docker.sock`): the command doesn't start, and is refused with
|
|
3135
|
+
`Permission denied: working directory is a folder where the host's services keep their sockets (<folder>)` (or `lies
|
|
3136
|
+
in <folder>, where ...`, `holds <folder>, where ...`, and for `/` `holds the folders where ...`), followed by where to
|
|
3137
|
+
run it instead: a folder inside the profile's roots, or none, to run it in the session's folder.
|
|
3138
|
+
- **A root named through a link a command could have made is refused.** A root a profile names that is, or is named
|
|
3139
|
+
through, a symbolic link in a folder lying, by its real path, in one of the profile's roots (its own included) is one
|
|
3140
|
+
a command could have made there, or pointed elsewhere, as it can any link in a root it writes (`ln -s ~ build`, with
|
|
3141
|
+
`./build` in `allowedPaths [., ./build]`), or one an earlier command made under a profile that writes. That holds
|
|
3142
|
+
under every profile that names `allowedPaths`, one whose commands write nothing included, which read through such a
|
|
3143
|
+
link before. ZTC judges it by its one look at each root (above), which nothing after it resolves again, so a link
|
|
3144
|
+
swapped in for the root, or for a folder above it, after that look (a command left running in the background can swap
|
|
3145
|
+
one in and out, over and over) changes no rule and no bind: ZTC follows no such link, and refuses that root alone. The
|
|
3146
|
+
file tools are refused a path in it, as the link names it or where it leads, that no other root holds: "Permission
|
|
3147
|
+
denied: path build/.bashrc is in /workspace/build, a root this profile names that is a link in a folder a command may
|
|
3148
|
+
write, which a command could have made, to /home/you: ZTC follows no such link. Remove the link, or name the folder
|
|
3149
|
+
you meant by its real path in the profile's allowedPaths: the link leads to /home/you now, where a command could have
|
|
3150
|
+
pointed it, so check that it is that folder first." (for a root named through one, "that is named through
|
|
3151
|
+
/workspace/a,"; for a root that is the session's own folder, as `.` is in a session at `~/proj-link` with
|
|
3152
|
+
`allowedPaths [~, .]`, "..., or start the session from it: the link leads to /data/proj now, ..."; and where the link
|
|
3153
|
+
leads into another root, "What it leads to is in /workspace, a root of this profile, and reachable through it."), and,
|
|
3154
|
+
where the agent's commands run only inside an OS sandbox, `run_command` is refused a working directory there the same
|
|
3155
|
+
way ("working directory <folder> is in ..."). Neither sandbox binds or allows it: the link stays a plain link in the
|
|
3156
|
+
root that holds it, so a command that follows it reaches nothing it couldn't reach without it (under bubblewrap, a
|
|
3157
|
+
link to `/tmp` or `/dev/shm` reaches the sandbox's own), and commands elsewhere in the roots still run. The first
|
|
3158
|
+
command whose plan leaves the root out says why in its result, once in each ZTC, as every such plan's notes and
|
|
3159
|
+
sandbox audit do: "ZTC's sandbox gives this command no root at /workspace/build, which its permission profile names:
|
|
3160
|
+
it is a link in a folder a command may write, which a command could have made, to /home/you. Remove the link, or name
|
|
3161
|
+
the folder you meant by its real path in the profile's allowedPaths: the link leads to /home/you now, where a command
|
|
3162
|
+
could have pointed it, so check that it is that folder first."; the audit's `allowed_paths` leaves the root out. A
|
|
3163
|
+
profile whose every root is such a link allows nothing. To work in the folder you meant such a link to lead to, name
|
|
3164
|
+
it by its real path in `allowedPaths`, once you have checked where the link leads: a command could have pointed it
|
|
3165
|
+
anywhere. A profile that names no `allowedPaths` refuses no root for a link, and under bubblewrap a `deniedPaths`
|
|
3166
|
+
entry named through such a root keeps every command from starting, saying first that the root is such a link ("ZTC did
|
|
3167
|
+
not start this command: its permission profile denies ./build/secret (/workspace/build/secret), named through
|
|
3168
|
+
/workspace/build, and names /workspace/build as a root, which is a link in a folder a command may write, which a
|
|
3169
|
+
command could have made, to /data/x. Remove the link, or name that root and the denial by their real paths in the
|
|
3170
|
+
profile's allowedPaths and deniedPaths."). A root ZTC can't look at, below a folder it can't look into (`chmod 000
|
|
3171
|
+
locked`, with `./locked/build` in `allowedPaths`), is refused alone the same way, so the other roots, and every tool,
|
|
3172
|
+
still work, where every call of the profile failed with "EACCES: permission denied, realpath": the file tools are
|
|
3173
|
+
refused a path in it ("Permission denied: path locked/build/x is in /workspace/locked/build, a root this profile names
|
|
3174
|
+
that ZTC couldn't look at: ZTC can't look into /workspace/locked to find it (EACCES). Give the folder back its mode
|
|
3175
|
+
(chmod u+rx /workspace/locked), or remove the root from the profile's allowedPaths."), and a plan says so in its
|
|
3176
|
+
notes. One ZTC can't look at for another reason is refused alone too, its notice saying what to do about that reason,
|
|
3177
|
+
not to give a folder back its mode: a link on the way to it that leads round in a loop ("... a link on the way to it,
|
|
3178
|
+
in /workspace, leads round in a loop (ELOOP). Remove that link, or remove the root from the profile's allowedPaths."),
|
|
3179
|
+
or a name on the way longer than the filesystem allows (to name it by a shorter path, ENAMETOOLONG). A `deniedPaths`
|
|
3180
|
+
entry ZTC can't look up refuses every call, as it must not guess what the denial covers, saying which folder and why
|
|
3181
|
+
("Permission denied: this profile denies ./config/prod/secrets.json (/workspace/config/prod/secrets.json), and ZTC
|
|
3182
|
+
can't look into /workspace/config to find it (EACCES), so it can't tell what the denial covers. Give the folder back
|
|
3183
|
+
its mode (chmod u+rx /workspace/config), or remove the denial from the profile's deniedPaths.").
|
|
3184
|
+
- **A root inside another root is that root's.** A root a profile names that lies, by the real paths ZTC's look found,
|
|
3185
|
+
inside another root it names (`./build` in `allowedPaths [., ./build]`, there or not made yet, or `./a/b` below a
|
|
3186
|
+
folder `a` of yours) gives a command nothing the root that holds it doesn't: bubblewrap binds nothing of its own
|
|
3187
|
+
there, and ZTC makes nothing for it, so a command makes it, writes in it, renames or removes it through the root that
|
|
3188
|
+
holds it, as without the root (`mkdir build`, `git clone … build`, `cp -r src build` leaving `build/a.txt`, `[ -e
|
|
3189
|
+
build ]`, and `rm -rf build`, which a mount point refused). A command that makes it a link makes it no root (above),
|
|
3190
|
+
so nothing follows the link, under either sandbox; a folder above it swapped for a link has bwrap bind nothing outside
|
|
3191
|
+
the roots there, since nothing is bound there by its path. ZTC made such a root on the host before bwrap started and
|
|
3192
|
+
bound it plainly, as a mount point, with a hold of the plan's in it that every command saw: `mkdir build` failed
|
|
3193
|
+
(`File exists`), a clone into it failed, `cp -r src build` nested the copy, and a root below a folder ZTC couldn't
|
|
3194
|
+
write stopped every command of the profile; and the bind, made by its path as bwrap started, followed a link the
|
|
3195
|
+
agent's own background command swapped in for a folder above it. Where the sandbox protects the programs a repository
|
|
3196
|
+
names (below) it is no root of its own either: ZTC looks for repositories, and pins the folders above them, from the
|
|
3197
|
+
outermost root, by the real path its look found, so a nested root that holds a repository, or a folder in it above
|
|
3198
|
+
one, is pinned as any folder above a repository is (`mv proj proj.old`, with `./proj` in `allowedPaths [., ./proj]`,
|
|
3199
|
+
is refused: a command renamed it away and made a repository of its own in its place, whose `core.fsmonitor` your git
|
|
3200
|
+
then ran), and a folder above a nested root swapped for a link after ZTC's look leads that look nowhere outside the
|
|
3201
|
+
roots (it found the repository where the link led, outside every root, and pinned it, bound read-write, recorded it
|
|
3202
|
+
and acted on it after the command); each work tree its walk finds it takes by its real path, so a folder swapped for a
|
|
3203
|
+
link while the walk reads leads it nowhere outside them either. Under bubblewrap a spelling of such a root outside
|
|
3204
|
+
every root (`../sub-link`, a link beside the workspace that leads into `./sub`, in `allowedPaths [., ../sub-link]`) is
|
|
3205
|
+
no folder in the command's sandbox, and the command's result says so (see the Limits); the file tools and macOS's
|
|
3206
|
+
sandbox take it by its real path. A root not made yet outside every other root (`../cache`) bubblewrap binds only if
|
|
3207
|
+
it is there as a command starts (`--bind-try`, read-only under a profile whose commands write nothing), so the command
|
|
3208
|
+
starts, and the root is out of its reach until it exists, when the next command's plan binds it (a plain bind of a
|
|
3209
|
+
root that isn't there would stop bwrap, "Can't find source path", and with it every command of the profile); where the
|
|
3210
|
+
plan hides a path in it, or ZTC can't look it up for another reason than its absence (below a file), it is left
|
|
3211
|
+
unbound. macOS's sandbox allows such a root as before.
|
|
2889
3212
|
- **Where the agent's commands keep the network, bubblewrap binds no root that would put the host's services' sockets in
|
|
2890
3213
|
their reach**, as no filter refuses them Unix sockets there: it plans no command whose root is `/`, is or holds one of
|
|
2891
3214
|
the folders above, or lies in one of the host's runtime folders (`/run`, `/var/run`, `/run/user`, the session's
|
|
2892
3215
|
`XDG_RUNTIME_DIR`) but on a drive the host mounts for you in `/run/media` (below), judged as named and by where a link
|
|
2893
|
-
leads
|
|
3216
|
+
leads (a root that is, or is named through, a link a command could have made it leaves unbound instead, above), and
|
|
3217
|
+
its refusal says what to do instead. A root the profile names is refused with "Permission denied: this
|
|
2894
3218
|
profile's root is a folder where the host's services keep their sockets (/tmp), which bubblewrap keeps out of a
|
|
2895
3219
|
command's reach. Name a project's folder in its allowedPaths instead, to run commands under it." (or
|
|
2896
3220
|
`holds <folder>, where ...`,
|
|
@@ -2919,23 +3243,59 @@ with none it runs no commands. Under one:
|
|
|
2919
3243
|
`ZTC_WORKSPACE_LAYOUT_DIR`), doesn't exist when a command starts, in a root the command writes, it stands an empty
|
|
2920
3244
|
read-only folder over it for the command's run: the command can make neither it nor anything in it
|
|
2921
3245
|
(`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).
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
3246
|
+
and no command can rename a folder above it away to make it anew (below). ZTC makes the folder it stands on, on the
|
|
3247
|
+
host, as you, before it starts bwrap, with a hold in it: an empty folder of the command's plan's own
|
|
3248
|
+
(`.ztc-hold-<pid namespace>-<pid>-<nonce>`), which the placeholder hides from every command; a plan puts one hold in
|
|
3249
|
+
a folder however many spellings its placeholders stand at there (above). The folder stands there
|
|
3250
|
+
for the whole of the command's run, a background command's too; every command a ZTC plans meanwhile, this ZTC or
|
|
3251
|
+
another running commands in the same workspace, stands one there again and puts its own hold in it, and no ZTC
|
|
3252
|
+
removes the folder, or one above it, while another's hold is in it: the last of those commands to end removes it,
|
|
3253
|
+
keeping one that something was put in. Meanwhile your other programs see a folder there that holds only those empty
|
|
3254
|
+
folders: writing `.env`, or reading it as dotenv and `docker compose` do, gets `Is a directory`, and a file watcher
|
|
3255
|
+
sees the folder come and go around each command. A file
|
|
2927
3256
|
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
3257
|
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,
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
(
|
|
2933
|
-
`.github/
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
3258
|
+
mount, under a profile that writes nothing, inside another one, in a folder you can't write, or below a file that
|
|
3259
|
+
stands where a folder above the path would; a command can't make the path in such a folder until it changes the
|
|
3260
|
+
folder's mode, which it can in a folder of yours, nor below such a file until it removes it, and then nothing stops it
|
|
3261
|
+
(see the Limits). On both, a folder above a denied path that doesn't exist either (`.github`, for a denied
|
|
3262
|
+
`.github/workflows`) is made by ZTC before the command starts, as you and only inside the roots the command writes,
|
|
3263
|
+
and pinned as every folder above a denial is (below); under bubblewrap too, since bwrap looks up every folder it pins
|
|
3264
|
+
before it does anything else, and can make none of them itself. It stays writable, so `.github/dependabot.yml` and
|
|
3265
|
+
`.github/ISSUE_TEMPLATE/` land beside the denied `.github/workflows`, and a checkout adds `.github/CODEOWNERS` there,
|
|
3266
|
+
but no command can remove it or rename it away. It is an ordinary folder on the host meanwhile, and ZTC removes it
|
|
3267
|
+
once the commands it was made for have ended, if nothing was put in it. Under bubblewrap a command can take its mode
|
|
3268
|
+
through the pin (`chmod 555 .github`), and ZTC gives it its write and search back after the command, then removes it
|
|
3269
|
+
where it is left empty; where the command put something in it, it stays, writable to you. Under bubblewrap, where ZTC
|
|
3270
|
+
can't make one, or something that is no folder stands there by then, the command doesn't start: "ZTC did not start
|
|
3271
|
+
this command: bubblewrap pins each folder above what its permission profile denies, and ZTC's own state, and ZTC
|
|
3272
|
+
could not make /workspace/.github, one that doesn't exist yet (ENOSPC), for it to pin. Make the folder, or remove what
|
|
3273
|
+
stands at that path." (for the placeholder's own folder, that it "could not make and hold the folder it stands on"),
|
|
3274
|
+
saying what stands in the way where ZTC can tell: "A file stands at /workspace/dist, where a folder above it would be:
|
|
3275
|
+
move or remove the file.", "ZTC may not make a folder in /workspace/a: give it back its write and search permission
|
|
3276
|
+
(chmod u+wx /workspace/a).", "Something that is no folder stands at /workspace/.github: move or remove it.", or, for a
|
|
3277
|
+
name too long, to name a shorter path in `deniedPaths`.
|
|
3278
|
+
Nor does it start where ZTC can't look for a path it hides in a root the command writes, below a folder there that
|
|
3279
|
+
can't be searched, as a command can leave one (`chmod 600 config`): "ZTC did not start this command: bubblewrap hides
|
|
3280
|
+
what its permission profile denies, and ZTC's own state, by a mount at each path, and ZTC can't look into
|
|
3281
|
+
/workspace/config (EACCES) to find /workspace/config/prod/secrets.json, which it hides there. The folder is there:
|
|
3282
|
+
give it back its mode (chmod u+x /workspace/config)." That holds while no command runs alongside: one left running in
|
|
3283
|
+
the background that takes a folder's mode away and gives it back can leave a later plan without the hide, with no
|
|
3284
|
+
refusal (see the Limits). ZTC makes each folder it makes for a plan on the host (the folders above a denial, under
|
|
3285
|
+
bubblewrap the folder a placeholder stands on and each hold) only where the folder that holds it is, by its real path,
|
|
3286
|
+
as the plan found it, inside the roots, and looks at it again once made, on both: under bubblewrap, where a folder on
|
|
3287
|
+
the way to it is a link, or became one as ZTC made it, the command doesn't start ("ZTC did not start this command: ZTC
|
|
3288
|
+
makes /workspace/.github for it on the host, where the plan found it, and it led to /data/x/.github when ZTC looked
|
|
3289
|
+
again: a folder on the way to it is a link, or became one while ZTC made it, and ZTC makes nothing through a link. Run
|
|
3290
|
+
the command again once nothing alongside moves the folders in its roots."); on macOS the folder stays unmade, and
|
|
3291
|
+
denied as one; and on both a folder its `mkdir` made through the link is removed, where it is still that one. After
|
|
3292
|
+
the command, on both, ZTC removes a folder or hold, and under bubblewrap gives back a mode, only on or in a folder
|
|
3293
|
+
that is still the one its plan made or took over, by its device and inode at the real path it had, so it follows no
|
|
3294
|
+
link swapped in meanwhile (see the Limits for what is left of both); on macOS that step removed by path, and followed
|
|
3295
|
+
a link swapped in for a folder above one to remove an empty folder outside every root.
|
|
3296
|
+
- **No command renames a folder above what the sandbox hides to carry it off.** Both sandboxes hide a denied path, ZTC's
|
|
3297
|
+
own state and its runtime's hand-offs by their paths, and a rename of a folder above one moved it out from under that:
|
|
3298
|
+
a command renamed `config` above a denied `config/prod/secrets.json` and read the file under its new name (on macOS in
|
|
2939
3299
|
the same command, under bubblewrap in the next, whose plan hides the path by its old name), renamed a folder above a
|
|
2940
3300
|
denial away and made the denied path anew, or built it elsewhere and renamed a folder into its place; ZTC's
|
|
2941
3301
|
`config.json` two levels inside a root could be forged so, and a hand-off read in a `TMPDIR` inside one. Now every
|
|
@@ -2945,7 +3305,12 @@ with none it runs no commands. Under one:
|
|
|
2945
3305
|
denies removing or making each as itself, so a `mv` of it, or of another folder into its place, gets
|
|
2946
3306
|
`Operation not permitted`, exchange and exclusive renames included. It stays writable: a command writes in it as
|
|
2947
3307
|
before, and on macOS `touch`, `chmod`, extended attributes and `tar`'s or `cp -p`'s restore of its times still work on
|
|
2948
|
-
it.
|
|
3308
|
+
it. The pins close the rename only, and only to the commands whose plans pin the folder: a process outside the
|
|
3309
|
+
command's sandbox (another ZTC's command under a profile that doesn't deny the path, a program of yours) can still
|
|
3310
|
+
rename a pinned folder, under bubblewrap a command that changes the mode of a folder in its roots (`chmod`) can leave
|
|
3311
|
+
the next command's plan without the hide and the pins there, and on macOS one that clones a folder above what is
|
|
3312
|
+
hidden whole (`clonefile(2)`) reads it in the clone (see the Limits). macOS's sandbox pins a link among
|
|
3313
|
+
those folders as itself. bubblewrap can stand no mount on a link, so it plans no
|
|
2949
3314
|
command whose `deniedPaths` entry is named through a symbolic link in a folder the command may write, the path itself
|
|
2950
3315
|
included (`./secrets` a link to `.vault`), nor, under a profile that limits the agent, one whose ZTC's own state is:
|
|
2951
3316
|
the command doesn't start, and the refusal names the link and what to name instead ("ZTC did not start this command:
|
|
@@ -2973,7 +3338,10 @@ with none it runs no commands. Under one:
|
|
|
2973
3338
|
nothing changes there, unless the sandbox settings require one. bubblewrap, on Linux, leaves such a command the
|
|
2974
3339
|
sockets in its roots (see the Limits).
|
|
2975
3340
|
- **The file tools open only the file the profile admitted**: a link swapped in between the check and the open is
|
|
2976
|
-
refused, and nothing is read or written through it
|
|
3341
|
+
refused, and nothing is read or written through it, and the roots each check holds a path to are those ZTC's one look
|
|
3342
|
+
at them found (above): a link swapped in for a root, or a folder above one, after that look changes none of them
|
|
3343
|
+
(with a command running alongside that swapped one in and out, read_file returned a file outside every root 26 times
|
|
3344
|
+
in 300). A unified diff, which `git apply` writes, and `search` open files
|
|
2977
3345
|
themselves (see the Limits).
|
|
2978
3346
|
- **A sandboxed command can't write where a repository names programs.** Where the agent's commands write inside an OS
|
|
2979
3347
|
sandbox (`workspace_autonomous`, `ask_before_mutation`, `tests_allowed`, a resident's own profile), it commits,
|
|
@@ -2983,25 +3351,25 @@ with none it runs no commands. Under one:
|
|
|
2983
3351
|
submodule's `.git` file, the hooks folder and an untracked `core.hooksPath` folder are read-only to it, on macOS
|
|
2984
3352
|
missing ones included. On Linux, of the missing ones, only the common config and the hooks folders are: a `commondir`
|
|
2985
3353
|
or `config.worktree` the command creates, or a link among them it replaces, stands until the command ends. Everywhere,
|
|
2986
|
-
`.git` and the folders above it
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
for repositories at one of its limits, the command's result says where. When a
|
|
2992
|
-
repositories one git takes for none (its `HEAD` removed or rewritten, its `refs` or
|
|
2993
|
-
back what it broke as soon as the command ends, before anything reads its result, and
|
|
2994
|
-
back: from then on your git there finds that repository again, not one the command made in
|
|
2995
|
-
the command runs, it doesn't: see the Limits). It may still start repositories (`git init`,
|
|
2996
|
-
`git worktree add`, `git submodule update` of an initialized submodule), on macOS as on Linux: a
|
|
2997
|
-
is its own in that command and protected from its next command on. A checkout, a commit, a branch
|
|
2998
|
-
`HEAD` is never undone. On Linux, ZTC undoes a `commondir` or `config.worktree` a command made in
|
|
2999
|
-
directory, and a protected link it replaced, when the command ends, and the command's result says so.
|
|
3000
|
-
refuse the `core.hooksPath` folder and a `.git/config` link's target as they refuse `.git`. So `git
|
|
3001
|
-
`git remote add`, `git branch -m`, `git submodule init` and `git submodule update --init`, hook installers,
|
|
3002
|
-
`rm -r` of a folder that holds one of these repositories fail there, and `git push -u`, `git switch` to a branch
|
|
3003
|
-
the remote has and `git checkout --track` say they set up tracking but record no upstream: run those yourself.
|
|
3004
|
-
command's result says so in its sandbox notes: which file the sandbox kept, and the command to run. Hooks your
|
|
3354
|
+
`.git` and the folders above it, up to the outermost root that holds it (a root inside another root is that root's),
|
|
3355
|
+
can't be moved away or removed. A repository ZTC has found stays protected in that ZTC, even after a command removes
|
|
3356
|
+
its `HEAD`, moves its refs or objects aside, removes what it may of it, or fills the folders ZTC looks through, and in
|
|
3357
|
+
every one started after it while the record holds it (ZTC keeps the 512 found last in
|
|
3358
|
+
`~/.ztc/sandbox/known-repositories.json`: see the Limits), and a `.git` that git takes for no repository is protected
|
|
3359
|
+
where ZTC looks; when ZTC stops looking for repositories at one of its limits, the command's result says where. When a
|
|
3360
|
+
command leaves one of these repositories one git takes for none (its `HEAD` removed or rewritten, its `refs` or
|
|
3361
|
+
`objects` moved aside), ZTC puts back what it broke as soon as the command ends, before anything reads its result, and
|
|
3362
|
+
the result says what it put back: from then on your git there finds that repository again, not one the command made in
|
|
3363
|
+
a folder above it (while the command runs, it doesn't: see the Limits). It may still start repositories (`git init`,
|
|
3364
|
+
`git clone`, `git worktree add`, `git submodule update` of an initialized submodule), on macOS as on Linux: a
|
|
3365
|
+
repository it makes is its own in that command and protected from its next command on. A checkout, a commit, a branch
|
|
3366
|
+
switch or a detached `HEAD` is never undone. On Linux, ZTC undoes a `commondir` or `config.worktree` a command made in
|
|
3367
|
+
a protected git directory, and a protected link it replaced, when the command ends, and the command's result says so.
|
|
3368
|
+
The file tools refuse the `core.hooksPath` folder and a `.git/config` link's target as they refuse `.git`. So `git
|
|
3369
|
+
config`, `git remote add`, `git branch -m`, `git submodule init` and `git submodule update --init`, hook installers,
|
|
3370
|
+
and `rm -r` of a folder that holds one of these repositories fail there, and `git push -u`, `git switch` to a branch
|
|
3371
|
+
only the remote has and `git checkout --track` say they set up tracking but record no upstream: run those yourself.
|
|
3372
|
+
The command's result says so in its sandbox notes: which file the sandbox kept, and the command to run. Hooks your
|
|
3005
3373
|
repository tracks (a `.githooks` folder, husky's) are its code, which the agent may change like any file: the first
|
|
3006
3374
|
command in that repository is told so, and you review them as you review code.
|
|
3007
3375
|
- **ZTC's own git in the work tree starts no program the repository's config names** where the agent's commands can
|
|
@@ -3047,13 +3415,54 @@ programs.
|
|
|
3047
3415
|
let the user create user namespaces, as Ubuntu 24.04's AppArmor doesn't by default), every sandboxed command fails
|
|
3048
3416
|
with bubblewrap's error, and none runs outside the sandbox, a profile's that only asks for it included; `/status`
|
|
3049
3417
|
says so (above).
|
|
3050
|
-
- ZTC
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3418
|
+
- Under bubblewrap, ZTC plans a command's hides and pins from what it finds in the roots as it plans it, so a command
|
|
3419
|
+
that changes the mode of a folder in its roots can leave a later command's plan without them. Where ZTC can't look
|
|
3420
|
+
into a folder above a path it hides in a root the command writes (`chmod 000 config`), it starts no command (above),
|
|
3421
|
+
but only while nothing gives the folder its mode back as ZTC plans: a command left running in the background that
|
|
3422
|
+
takes the mode away and gives it back, over and over (`chmod 000 config` and `chmod 755 config`, or the same on the
|
|
3423
|
+
root itself), can have a plan miss what lies below the folder while it can't look into it, and find nothing to refuse
|
|
3424
|
+
once it can again, so that plan hides nothing there and pins nothing above it. Its command then reads a denied file
|
|
3425
|
+
that exists, at any depth, a `.env` directly in the root included, or ZTC's own state where it lies directly in a
|
|
3426
|
+
root: in tests on real bubblewrap such a toggle had 3 commands in 14 read a nested denied file, 3 in 50 a `.env` in
|
|
3427
|
+
the root, and 1 in 48 a pinned resident's denied file. And where a command takes the write permission from a folder
|
|
3428
|
+
of yours that a denied path not made yet, or ZTC's own state not made yet, would be made in (`chmod 555 .github` on a
|
|
3429
|
+
`.github` you made, or on the root itself), a later command's plan stands no placeholder there and pins nothing above
|
|
3430
|
+
it, so a command running alongside (one left in the background, which can change the mode back) can make the path: a
|
|
3431
|
+
denied `.github/workflows`, or a `~/.ztc` it would forge `config.json` in. Until that is fixed, name no `deniedPaths`
|
|
3432
|
+
in a root the agent's commands write where what they hide matters, whether the path exists yet or not, and keep ZTC's
|
|
3433
|
+
own state outside every root.
|
|
3434
|
+
- Under bubblewrap, a denied path not made yet gets no placeholder, and nothing above it is pinned, where the folder it
|
|
3435
|
+
would be made in is one of yours you can't write (a read-only checkout or tar extract) or a file stands where a folder
|
|
3436
|
+
above it would (a `.github` that is a file, for a denied `.github/workflows`): a command can change the folder's mode,
|
|
3437
|
+
or remove the file, and then make the denied path. Make such a folder writable, or remove the file, before you deny a
|
|
3438
|
+
path below it.
|
|
3439
|
+
- On macOS, a command can clone a folder above what the sandbox hides (a denied path, ZTC's own state, a hand-off in a
|
|
3440
|
+
`TMPDIR` inside a root), whole, to a new name in a root it writes (`clonefile(2)`), and read what the clone holds: the
|
|
3441
|
+
sandbox checks the clone against the folder and its new name, not against what lies below them. With two roots, ZTC's
|
|
3442
|
+
own state directly in one (your home folder as a root) is cloned into the other so. Until that is fixed, keep what
|
|
3443
|
+
you deny, and ZTC's own state, outside the roots on macOS.
|
|
3444
|
+
- ZTC removes the empty folders it makes for a denied path not made yet (above) once the command ends, the folder the
|
|
3445
|
+
placeholder stands on and the folders above it under bubblewrap, the folders above it on macOS: one can stay where ZTC
|
|
3446
|
+
is killed while the command runs, and where it exits or starts again in place then, since it stops a running command
|
|
3447
|
+
without waiting for it to end. Under bubblewrap the placeholder's folder then holds the killed plan's hold, an empty
|
|
3448
|
+
`.ztc-hold-…` folder: the next command a ZTC plans with that denial takes it over and removes it after it ends, or
|
|
3449
|
+
remove it with `rm -r`; on macOS remove it with `rmdir`. (A ZTC before this one made a root not made yet inside
|
|
3450
|
+
another root, with a hold in it, `build/.ztc-hold-…`: one left by a killed ZTC stays, as any folder of yours does;
|
|
3451
|
+
remove it with `rm -r`.) Under bubblewrap ZTCs count each other's holds, through those hold folders: the end of one
|
|
3452
|
+
ZTC's command no longer takes away the placeholder and pins of another's running command (it did: Linux lets a process
|
|
3453
|
+
remove a folder that is a mount point only in another's namespace, and that command could then make the denied path),
|
|
3454
|
+
but a hold of a process ZTC can't see (another container's, sharing the workspace) is taken to stand until that
|
|
3455
|
+
process removes it, and where two ZTCs plan the same path at once a folder above it can stay behind, empty. On macOS
|
|
3456
|
+
one ZTC doesn't count another's: where two run commands in one workspace at once with the same denied path not made
|
|
3457
|
+
yet, the end of one's command can remove a folder above it that the other's command was made for, which that command
|
|
3458
|
+
can then no longer make. Under bubblewrap, a placeholder's folder in a folder of yours that a command took the write
|
|
3459
|
+
permission from (`chmod 555 src`) stays behind too, empty: ZTC gives its write back only to a folder it made. The
|
|
3460
|
+
holds, pins and placeholders keep a folder from the commands whose plans make them, not from a process outside their
|
|
3461
|
+
sandbox: a second ZTC whose profile doesn't deny the path, or a program of yours, can rename `.github` away while a
|
|
3462
|
+
command runs (`mv .github gh`) under a profile that denies `.github/workflows`, not made yet, and that command then
|
|
3463
|
+
has no pin at `.github` nor placeholder at `.github/workflows`, and can make `.github/workflows/ci.yml`. Where what a
|
|
3464
|
+
profile denies matters, run no other ZTC under another profile, and nothing of yours that moves its folders, in that
|
|
3465
|
+
workspace while its commands run.
|
|
3057
3466
|
- Under bubblewrap each pinned folder (above) is a mount of its own, and a rename works within one mount only: a rename
|
|
3058
3467
|
into or out of a pinned folder fails with `Invalid cross-device link`, as
|
|
3059
3468
|
`git mv config/prod/app.yml config/staging/app.yml` does beside a denied `config/prod/secrets.json`, and so does a
|
|
@@ -3072,10 +3481,56 @@ programs.
|
|
|
3072
3481
|
handed) is in its reach, and a `TMPDIR` that holds none when the command is planned isn't pinned, so that command can
|
|
3073
3482
|
rename it. macOS's sandbox denies the hand-offs by pattern, now or later. `ZTC_PERMISSION_PROFILE_PINNED` keeps
|
|
3074
3483
|
`TMPDIR` out of the agent's commands' roots (above).
|
|
3075
|
-
- bubblewrap binds each pinned folder by its path, which bwrap looks up again
|
|
3076
|
-
|
|
3077
|
-
a link in between, and bwrap would bind where the link leads.
|
|
3078
|
-
|
|
3484
|
+
- bubblewrap binds each pinned folder, and each root outside every other root, by its path, which bwrap looks up again
|
|
3485
|
+
as it starts the command: a process for which a folder on that path wasn't pinned, and which can write the folder that
|
|
3486
|
+
holds it, could replace it with a link in between, and bwrap would bind where the link leads. For a pinned folder that
|
|
3487
|
+
can be a command still running from an earlier plan (one left in the background), for which that folder wasn't pinned
|
|
3488
|
+
(a plan pins the folders above the repositories it finds, and an earlier one may not have found one: a repository a
|
|
3489
|
+
command made after it, or one past its walk), or a process outside the sandbox (a command left running under another
|
|
3490
|
+
profile, another ZTC's under one that doesn't deny the path, a program of yours). For such a root it is only a process
|
|
3491
|
+
outside the sandbox: the folders above it lie in no root a command writes. A root inside another root is bound by
|
|
3492
|
+
nothing of its own unless it holds a repository (which is pinned as a git folder from the outermost root, so the pin
|
|
3493
|
+
limit above applies to it too), so no command's swap of a folder above a non-repository nested root reaches anything
|
|
3494
|
+
outside the roots; where bwrap
|
|
3495
|
+
bound such a root by its path, the agent's own background command, exchanging the folder above it with one whose link
|
|
3496
|
+
led outside every root, had 8 commands in 200 write there in a test, and through ZTC's look at the root and the plan's
|
|
3497
|
+
real path after it, read_file 26 calls in 300. ZTC checks the folders as it plans the command, not as bwrap binds
|
|
3498
|
+
them. ZTC's own work on the host around a command acts by path too, after a look: its `mkdir` of the folders a plan
|
|
3499
|
+
stands on, before bwrap starts, and its `chmod` and `rmdir` of them after the command (the next two).
|
|
3500
|
+
- Under bubblewrap, a root a profile names by a spelling outside every root that leads into another root (`../sub-link`,
|
|
3501
|
+
a link beside the workspace that leads into `./sub`, in `allowedPaths [., ../sub-link]`) is no folder in a command's
|
|
3502
|
+
sandbox at that spelling: it is a root inside another root, for which bwrap binds nothing of its own (above), as a
|
|
3503
|
+
bind at that spelling would bind `./sub` by its path again as bwrap starts, which a command left running in the
|
|
3504
|
+
background could swap for a link to a folder outside every root. A command that reads it there finds nothing (`No such
|
|
3505
|
+
file or directory`), and one that makes it and writes there exits 0 and loses what it wrote when it ends. The first
|
|
3506
|
+
command whose plan has such a root says so in its result, once in each ZTC, as the plan's notes and sandbox audit do:
|
|
3507
|
+
"ZTC's sandbox shows this command nothing at /work/sub-link, which its permission profile names as a root: it leads to
|
|
3508
|
+
/work/ws/sub, inside /work/ws, another of the profile's roots, and bubblewrap binds nothing of its own for a root
|
|
3509
|
+
inside another root. The command reaches that folder by its real path (/work/ws/sub); at /work/sub-link it finds
|
|
3510
|
+
nothing, and what it writes there is lost when it ends." Name the folder by its real path in commands, or drop that
|
|
3511
|
+
root, which the root holding it covers already; the file tools, and macOS's sandbox, take it by its real path.
|
|
3512
|
+
- ZTC makes each folder a plan stands on (a folder above a denial, under bubblewrap the folder a placeholder stands on
|
|
3513
|
+
and a hold) by its path. It makes it only where the folder that holds it is by its real path, as the plan found it,
|
|
3514
|
+
looks again once it is made, refuses the plan where it isn't there by its real path (under bubblewrap; on macOS the
|
|
3515
|
+
folder stays unmade), and removes one its `mkdir` made through a link, where it is still that one (above). A process
|
|
3516
|
+
no pin keeps from the folder (a command left running under another profile, a program of yours) that swaps a folder on
|
|
3517
|
+
the way for a link in the instant between ZTC's look and its `mkdir`, and back before ZTC looks again, still leaves an
|
|
3518
|
+
empty folder, or a hold, where the link led, perhaps outside the roots, which ZTC doesn't see and leaves; the plan is
|
|
3519
|
+
refused, or binds the folder now in the roots, unless the link is back as bwrap starts (above). Before ZTC looked
|
|
3520
|
+
again after each `mkdir`, such a racer had 1 plan in 1,144 make a folder and a hold outside the roots in a test (its
|
|
3521
|
+
bwrap failed, and the step after the command removed them); had the link stayed until bwrap started, bwrap would have
|
|
3522
|
+
bound where it led (through a relative link to `/tmp`, the host's `/tmp`), which the look after each `mkdir` now
|
|
3523
|
+
refuses. What is left, making each folder from a descriptor of the folder above opened without following links, is to
|
|
3524
|
+
come with the fix of the `chmod` Limit above. A profile that names no `deniedPaths`, with ZTC's own state and `TMPDIR`
|
|
3525
|
+
outside its roots, has ZTC make none of these folders.
|
|
3526
|
+
- The step after a command removes a folder ZTC made (`rmdir`), and under bubblewrap gives it its owner's write and
|
|
3527
|
+
search back first (`chmod`), by its path, where it has just found it still the folder its plan made or took over, by
|
|
3528
|
+
its device and inode at the real path it had: a link swapped in for a folder above it while the command ran no longer
|
|
3529
|
+
leads that step outside the roots (it did: under bubblewrap it gave a `0500` folder outside them its owner's write,
|
|
3530
|
+
`0700`, and removed an empty one; on macOS it removed an empty one), but one swapped in between that look and its
|
|
3531
|
+
`chmod` or `rmdir` still could. And Linux reuses inodes: an empty folder
|
|
3532
|
+
removed and made again at the same path inside the roots while the command ran can take the old one's, and is then
|
|
3533
|
+
removed as the plan's.
|
|
3079
3534
|
- bubblewrap's cap counts the folders a plan pins, not the bytes of bwrap's arguments: a profile with many long
|
|
3080
3535
|
`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
3536
|
default), and then bwrap starts no command (`Argument list too long`).
|
|
@@ -3090,23 +3545,25 @@ programs.
|
|
|
3090
3545
|
- Under `ZTC_PERMISSION_PROFILE_PINNED`, ZTC takes the pin as its startup ends, after it has started the MCP servers
|
|
3091
3546
|
`config.json` names: one that then doesn't start (the profile it would pin limits nothing, doesn't require an OS
|
|
3092
3547
|
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.
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3548
|
+
the pinned settings changed after a restart's check) has started them by then. Its startup `git status`, which runs
|
|
3549
|
+
the clean filter and hooks a work tree's git config names, waits for the pin, so such a start has run none of them. A
|
|
3550
|
+
ZTC started again in place takes what it was handed (`ZTC_PERMISSION_PIN_SOURCE`) out of its environment before any of
|
|
3551
|
+
them starts, so none holds it, but the environment the process was started with (`/proc/<pid>/environ` on Linux) still
|
|
3552
|
+
does, which a program running as the same user can read, as it can read `config.json`.
|
|
3097
3553
|
- 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
3554
|
refuses has done what its startup does first: it has started the MCP servers `config.json` names (which it closes
|
|
3099
3555
|
again before it exits), `zerg-ztc-headless` has loaded and built the handlers an `--agent-domain` names and, for
|
|
3100
3556
|
`--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.
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3557
|
+
plugins ZTC discovers. Its startup `git status`, which runs the clean filter and hooks a work tree's git config names,
|
|
3558
|
+
waits for the check, so a refused start has run none of them. It checks a start whose settings are its launch's: a run
|
|
3559
|
+
with a prompt or a Voyager task on its command line, one on a `--session-file` thread, a headless mirror without mux,
|
|
3560
|
+
and one that names a prompt or a thread where `ZTC_HEADLESS_MUX` is set. The mux workbench started with neither a
|
|
3561
|
+
thread nor a prompt on its command line, whose threads get their settings from its host once it runs (a prompt a
|
|
3562
|
+
controller sends before then runs on the profile it started on), a ZTC pane (zmux's `--pane`, or the pane child a
|
|
3563
|
+
headless mux opens, which names neither), the terminal app and a headless run that takes its prompts on stdin with no
|
|
3564
|
+
`--session-file` (`--json-stream`, `ztc -p` with no prompt after it, or a prompt piped to `ztc --headless`) start on
|
|
3565
|
+
whatever profile they hold, as before. Without `ZTC_PERMISSION_PROFILE_PINNED` nothing holds the profile once the run
|
|
3566
|
+
has started: your own `/permissions use`, or a controller's, can still change it.
|
|
3110
3567
|
- The zerg service's one-shot run (`run_headless_ztc`, `zerg/zerg/agent/core/workflows/ztc_headless/runtime.py`)
|
|
3111
3568
|
doesn't set `ZTC_HOSTED` yet: the environment it gives the ZTC it starts (`zerg-ztc-headless`) keeps an allowlist of
|
|
3112
3569
|
names that holds neither it nor `ZTC_PERMISSION_PROFILE_PINNED`, whatever the service's own holds, so that run starts
|
|
@@ -3118,19 +3575,24 @@ programs.
|
|
|
3118
3575
|
- Under `ZTC_PERMISSION_PROFILE_PINNED`, the Ink interface, which ZTC runs where its native interface isn't built
|
|
3119
3576
|
(Windows, say), still installs a newer release with npm as it starts, for the next start to run (it starts nothing in
|
|
3120
3577
|
place); `ZTC_DISABLE_UPDATE=1` keeps it from checking, and the `ztc` command the npm package installs sets it.
|
|
3121
|
-
-
|
|
3122
|
-
any OS sandbox, under every profile,
|
|
3123
|
-
sandbox the profile asks for
|
|
3578
|
+
- Without `ZTC_PERMISSION_PROFILE_PINNED`, the Ink interface runs your own commands (`!cmd` and `/shell`, `/diff`'s git,
|
|
3579
|
+
the commands `/optimize` runs) outside any OS sandbox, under every profile, while the native interface runs them in
|
|
3580
|
+
the sandbox the profile asks for; under the pin both run them only inside one.
|
|
3124
3581
|
- Under `ZTC_PERMISSION_PROFILE_PINNED`, a pinned profile that runs none of the agent's commands (`safe_edits`, or one
|
|
3125
3582
|
that turns `shell_exec` off) requires no OS sandbox, so your hooks run outside one there, as under `read_only`: a hook
|
|
3126
3583
|
reaches ZTC's own state, and the `config.json` the pin is taken from, as any program of yours does, and where the
|
|
3127
3584
|
profile lets the agent write, a hook that runs the workspace's code (`npm run lint`) runs what the agent may have
|
|
3128
3585
|
written there.
|
|
3129
|
-
- Under `ZTC_PERMISSION_PROFILE_PINNED`,
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3586
|
+
- Under `ZTC_PERMISSION_PROFILE_PINNED`, some of what you start still runs outside the OS sandbox. A Claude Code or
|
|
3587
|
+
Codex pane does, asking before each of its commands, and is still opened, resumed and typed into; so do the programs
|
|
3588
|
+
the agent's tools start outside it (the LSP tools' language server, `run_and_capture`'s command, the pane tools'
|
|
3589
|
+
panes) where a pinned profile that asks before each command (`tests_allowed`, `ask_before_mutation`) has you or a
|
|
3590
|
+
controller approve the call, which a headless run with no approval service refuses (below). The stdio MCP servers
|
|
3591
|
+
`config.json` names run outside any sandbox, as under every profile (a pinned ZTC takes no edit to them while it
|
|
3592
|
+
runs). The desktop app's daily driver (desktop mode only) starts its native panes and the CLIs' version checks outside
|
|
3593
|
+
any sandbox, with ZTC's own environment. And what you start from your shell runs before ZTC takes the pin: `--branch`
|
|
3594
|
+
builds a Conductor branch's ZTC with `npm install` and `npm run build`, with the environment ZTC was started with, and
|
|
3595
|
+
`--new-window` opens a terminal (below).
|
|
3134
3596
|
- `--new-window` in Terminal or iTerm starts the new window's ZTC in a shell of its own, which ZTC hands neither
|
|
3135
3597
|
`ZTC_PERMISSION_PROFILE_PINNED` nor `ZTC_MODEL_PINNED`: that ZTC pins neither.
|
|
3136
3598
|
- Settings that name programs ZTC runs when you ask aren't kept as ZTC started with them: the Codex app server's
|
|
@@ -3141,12 +3603,11 @@ programs.
|
|
|
3141
3603
|
skill or workflow written into a folder it already reads while it runs. Set `ZTC_EXTENSION_DISCOVERY=explicit` to
|
|
3142
3604
|
load only the roots you name.
|
|
3143
3605
|
- Your own `/zerg launch` still runs Poetry in the working directory's `zerg/` project, which the agent may have
|
|
3144
|
-
written, as `make` there would.
|
|
3606
|
+
written, as `make` there would, but under `ZTC_PERMISSION_PROFILE_PINNED`, which refuses it (above).
|
|
3145
3607
|
- A headless run with no approval client approves what a profile that asks would ask you (`--approval-url` hands those
|
|
3146
|
-
decisions to a service
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
`startsProgramsOutsideSandbox`). Under `--computer-use`, the computer-control tools can type into any window.
|
|
3608
|
+
decisions to a service, which is told when a call starts a program outside the OS sandbox), so there the tools above
|
|
3609
|
+
that start one can run, but under `ZTC_PERMISSION_PROFILE_PINNED`, or where its host runs it (`ZTC_HOSTED=1`), which
|
|
3610
|
+
refuse each such call there (above). Under `--computer-use`, the computer-control tools can type into any window.
|
|
3150
3611
|
- A mirror you start in the terminal UI (`ztc --mirror`, `/mirror`) with sign-in off, the default outside production,
|
|
3151
3612
|
answers anyone on this computer (see the mirror's section) and takes their input as yours: under a profile that
|
|
3152
3613
|
leaves the agent's commands the network (`workspace_autonomous`), a command of the agent's could post
|
|
@@ -3196,13 +3657,14 @@ programs.
|
|
|
3196
3657
|
ZTC protects a `.git` that git takes for none by where it is, where it looks, but not such a repository's
|
|
3197
3658
|
`core.hooksPath` folder outside `.git` (an untracked `.githooks`, husky 9's `.husky/_`) until a plan asks git about
|
|
3198
3659
|
the repository while it is whole.
|
|
3199
|
-
- The walk stops 4 folders below
|
|
3200
|
-
512 folders of a `.git/modules` and 256 linked
|
|
3201
|
-
|
|
3202
|
-
config and hooks, unless it is the session's or the
|
|
3203
|
-
`core.hooksPath` folder writable. A command can keep a repository
|
|
3204
|
-
filling the folders it reads first; one already found stays protected
|
|
3205
|
-
while the record holds it. A plan that stops at a limit says so in the
|
|
3660
|
+
- The walk stops 4 folders below each named writable root (pins and protections still run from the outermost root) and
|
|
3661
|
+
after 2,000 folders, and enters no `node_modules`; a plan reads 512 folders of a `.git/modules` and 256 linked
|
|
3662
|
+
worktrees at most, and asks git about 48 repositories at most. A repository, submodule or worktree past those that
|
|
3663
|
+
no plan of this ZTC or of one before it found keeps a writable config and hooks, unless it is the session's or the
|
|
3664
|
+
command's, and one past the 48 git runs keeps its `core.hooksPath` folder writable. A command can keep a repository
|
|
3665
|
+
no plan has found out of the walk's reach by filling the folders it reads first; one already found stays protected
|
|
3666
|
+
in this ZTC, and in those started after it while the record holds it. A plan that stops at a limit says so in the
|
|
3667
|
+
command's result and its audit, naming where.
|
|
3206
3668
|
- Each command's plan asks git about the repositories it knows, every time: in a workspace that holds many, a trivial
|
|
3207
3669
|
command takes longer under such a profile (about a second with 40 repositories, on a busy Mac).
|
|
3208
3670
|
- Hooks a repository tracks are its code (a `core.hooksPath` folder it tracks, and the tracked scripts husky 9's
|