hx in -p mode never prompts (no permission hook = every call allowed), so orch enforces the policy itself. Details in docs/safety.md.
allow list per profile: TOOL, *, or bash:GLOB (simple commands only, path-like words must stay in the worktree or read_roots). Hard rules even for *: no git push, no credential-looking paths, file tools stay in the worktree, no writes to .git / .hx. A denied call ends the run as needs-human (policy: ...), the branch keeps the work so far.
Enforced twice: orch guard runs inside hx as an extension (generated .hx/config.toml, removed after each attempt, never committed, rewritten before the next attempt) and orch re-checks every tool_call event and kills the run, because hx treats a dead or slow extension as "continue". A repo with its own .hx/config.toml is refused instead of silently running unguarded.
Credential separation: hx gets a cleared environment (PATH, HOME, USER, LANG, LC_, TMPDIR, CARGO_, RUST*, NIX_* plus the profile's env patterns). HX_HOME of orch is dropped when the profile sets its own home, so the work profile never inherits the private auth file.
Audit: append-only <state>/audit.log (run_start, one tool line per allow/deny with rule and args, run_end), orch audit [ID]. Warning on stderr for profiles with neither allow nor sandbox.
yolo without sandbox was already refused at profile load (O1).
Verification: sh tests/all.sh exit 0 (fmt, clippy -D warnings, 15 unit tests, e2e, spike check, real-hx e2e). The acceptance test: a work-profile run asking hx to read the private profile's auth.json is blocked (fake hx speaking the real extension protocol AND with the guard disabled, via the stream check), the token never appears in the repo or log, env dump shows no HX_HOME/AWS_*/GITEA_*. tests/real_hx.py drives the REAL hx binary (/opt/data/hx debug build) against its fake Anthropic API: hx starts orch guard itself and the Read of the secret is denied by the guard (audit by: ['guard']). e2e flake loop 8/8 idle, 6/6 under 6 CPU hogs.
Deviations from the issue text: "block pushes to protected branches" is implemented as "agents never push" (stricter; the sink pushes). Not done: confining plain bash (needs sandbox = true; bwrap is not installed on this box, so sandbox mode is untested here), network policy, per-command timeouts.
Closes #6
hx in `-p` mode never prompts (no permission hook = every call allowed), so orch enforces the policy itself. Details in `docs/safety.md`.
- `allow` list per profile: `TOOL`, `*`, or `bash:GLOB` (simple commands only, path-like words must stay in the worktree or `read_roots`). Hard rules even for `*`: no `git push`, no credential-looking paths, file tools stay in the worktree, no writes to `.git` / `.hx`. A denied call ends the run as `needs-human` (`policy: ...`), the branch keeps the work so far.
- Enforced twice: `orch guard` runs inside hx as an extension (generated `.hx/config.toml`, removed after each attempt, never committed, rewritten before the next attempt) and orch re-checks every `tool_call` event and kills the run, because hx treats a dead or slow extension as "continue". A repo with its own `.hx/config.toml` is refused instead of silently running unguarded.
- Credential separation: hx gets a cleared environment (PATH, HOME, USER, LANG, LC_*, TMPDIR, CARGO_*, RUST*, NIX_* plus the profile's `env` patterns). `HX_HOME` of orch is dropped when the profile sets its own `home`, so the work profile never inherits the private auth file.
- Audit: append-only `<state>/audit.log` (`run_start`, one `tool` line per allow/deny with rule and args, `run_end`), `orch audit [ID]`. Warning on stderr for profiles with neither `allow` nor `sandbox`.
- `yolo` without `sandbox` was already refused at profile load (O1).
Verification: `sh tests/all.sh` exit 0 (fmt, clippy -D warnings, 15 unit tests, e2e, spike check, real-hx e2e). The acceptance test: a work-profile run asking hx to read the private profile's `auth.json` is blocked (fake hx speaking the real extension protocol AND with the guard disabled, via the stream check), the token never appears in the repo or log, env dump shows no `HX_HOME`/`AWS_*`/`GITEA_*`. `tests/real_hx.py` drives the REAL hx binary (/opt/data/hx debug build) against its fake Anthropic API: hx starts `orch guard` itself and the Read of the secret is denied by the guard (`audit by: ['guard']`). e2e flake loop 8/8 idle, 6/6 under 6 CPU hogs.
Deviations from the issue text: "block pushes to protected branches" is implemented as "agents never push" (stricter; the sink pushes). Not done: confining plain `bash` (needs `sandbox = true`; bwrap is not installed on this box, so sandbox mode is untested here), network policy, per-command timeouts.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #6
hx in
-pmode never prompts (no permission hook = every call allowed), so orch enforces the policy itself. Details indocs/safety.md.allowlist per profile:TOOL,*, orbash:GLOB(simple commands only, path-like words must stay in the worktree orread_roots). Hard rules even for*: nogit push, no credential-looking paths, file tools stay in the worktree, no writes to.git/.hx. A denied call ends the run asneeds-human(policy: ...), the branch keeps the work so far.orch guardruns inside hx as an extension (generated.hx/config.toml, removed after each attempt, never committed, rewritten before the next attempt) and orch re-checks everytool_callevent and kills the run, because hx treats a dead or slow extension as "continue". A repo with its own.hx/config.tomlis refused instead of silently running unguarded.envpatterns).HX_HOMEof orch is dropped when the profile sets its ownhome, so the work profile never inherits the private auth file.<state>/audit.log(run_start, onetoolline per allow/deny with rule and args,run_end),orch audit [ID]. Warning on stderr for profiles with neitherallownorsandbox.yolowithoutsandboxwas already refused at profile load (O1).Verification:
sh tests/all.shexit 0 (fmt, clippy -D warnings, 15 unit tests, e2e, spike check, real-hx e2e). The acceptance test: a work-profile run asking hx to read the private profile'sauth.jsonis blocked (fake hx speaking the real extension protocol AND with the guard disabled, via the stream check), the token never appears in the repo or log, env dump shows noHX_HOME/AWS_*/GITEA_*.tests/real_hx.pydrives the REAL hx binary (/opt/data/hx debug build) against its fake Anthropic API: hx startsorch guarditself and the Read of the secret is denied by the guard (audit by: ['guard']). e2e flake loop 8/8 idle, 6/6 under 6 CPU hogs.Deviations from the issue text: "block pushes to protected branches" is implemented as "agents never push" (stricter; the sink pushes). Not done: confining plain
bash(needssandbox = true; bwrap is not installed on this box, so sandbox mode is untested here), network policy, per-command timeouts.