Repository navigation
Conversation
Removes TypeSafe Jev review checkpoints, task routing, the Jev approval delegate, `qq jev setup|observe`, the jev_* config keys and QQ_JEV_* variables. Held calls now go to reviewer_model, then the human. Protocol 35 -> 36: routing_started/routing_completed/checkpoint_started/ checkpoint_reviewed are no longer written; recorded ones decode as `retired` so old stores replay. delegate "jev" and descriptor fields checkpoint/routing/approval_delegate stay decode-only. Configs that still set jev_* fail to parse with an error naming the key.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
- Forward retired events as their normalized `retired` envelope instead of the stored legacy bytes, so SSE subscribers whose cursor precedes a Jev event no longer get a malformed event. - Reject QQ_JEV_CHECKPOINTS, QQ_JEV_ROUTING and QQ_JEV_APPROVAL by name instead of ignoring them. - Remove ReviewVerdict::delegate and ::by; new verdicts, grants and events always name the reviewer, and `jev` only decodes. - Fix ADR-0047's status line and point retained ADRs at the deleted Jev docs by permalink. QQ-Allow-Revert: crates/qq-core/src/sessions/tests/accounting.rs QQ-Allow-Revert: src/output.rs
|
@codex review |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c53d5bbf77
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…andboxed rules, per-session proxy, ceilings, denial signals)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 913317946f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| The proxy evaluates only that session's resolved host policy (configuration, | ||
| `allow_hosts` grants, and the matched rule's extra hosts), so one session's |
There was a problem hiding this comment.
Keep existing host grants scoped to fetch
When a workspace already has allow_hosts, this proxy would silently turn a grant documented as permitting only fetch (docs/design/tools.md:1678-1679) into authority for arbitrary sandboxed shell programs to contact that host. Shell access can upload workspace contents or use protocols that the built-in fetch path never exposed, so enabling S6 would broaden existing users' saved grants without review. Introduce a separate shell-egress grant or require explicit migration and consent instead of feeding allow_hosts directly into the proxy policy.
Useful? React with 👍 / 👎.
| - Primary: **bubblewrap** (`bwrap`). Mount `/` read-only, bind writable | ||
| roots read-write, re-bind `.git`/`.qq` read-only, use a fresh `/tmp`, and | ||
| set `--unshare-user --unshare-pid --unshare-net` **always**, |
There was a problem hiding this comment.
Mask host Unix sockets in the Linux mount
On Linux hosts with a user-accessible control socket such as rootless Podman under /run/user/<uid>, mounting the entire host root preserves that socket inside the sandbox: a read-only bind prevents filesystem mutation but not connect(), and --unshare-net does not isolate AF_UNIX. A child could ask the container service to write host paths or reach the network, bypassing both advertised boundaries. The bubblewrap documentation confirms that the bind options expose the named host path; construct a filtered root or mask all host socket-bearing paths except the per-call proxy socket, and cover this in the escape suite.
Useful? React with 👍 / 👎.
| | Slice | Scope | Acceptance | | ||
| | --- | --- | --- | | ||
| | S0 | Threat model and policy types. `SandboxPolicy` (writable roots, denied reads, network mode, allowlist), `sandbox` field on `shell`/`exec`, typed `sandbox_denied` result, protocol and config additions, no enforcement. | Protocol fixtures; config round-trips; ADR for the model above, including the `unsafe` exception. | | ||
| | S1 | `qq-sandbox` crate and Linux bubblewrap + seccomp backend (always its own network namespace); per-session temp dir; process-group reaping; per-call PID/memory/CPU ceilings. | Escape suite (below) passes on Linux CI; no leaked process after cancel, timeout, shutdown, or crash recovery; launch overhead p50 ≤ 15 ms reported. | |
There was a problem hiding this comment.
Limit S1 acceptance to features delivered in S1
When S1 is implemented before S2 and S3, this acceptance cannot pass: the referenced escape suite requires proxy connectivity and cross-session endpoint isolation at lines 216-224, plus policy-rule confinement at lines 225-227, while S1 delivers neither the proxy nor rules. Because the plan says every slice lands with its acceptance tests, S1 is currently unshippable; restrict its gate to the filesystem/process subset or move the dependent functionality into S1.
Useful? React with 👍 / 👎.
| systemd scope or bwrap's cgroup on Linux, `RLIMIT_NPROC`/`RLIMIT_AS` | ||
| plus a supervising watchdog on macOS, Job Object process, memory and | ||
| CPU limits on Windows). |
There was a problem hiding this comment.
Use a true per-call process limit on macOS
On macOS, the newly added RLIMIT_NPROC mechanism still does not provide the promised per-call ceiling: Apple documents it as the maximum simultaneous process count for the entire user ID, so a low limit can reject normal forks because unrelated user processes consume it, while a higher limit lets the sandbox consume the remaining user-wide allowance; a supervising watchdog cannot prevent the transient fork storm before observing it. This leaves the fork-bomb acceptance unresolved. Use a kernel-enforced identity/container scoped to the call, or treat the macOS backend as unavailable until an equivalent hard boundary exists. Apple getrlimit(2) documentation
Useful? React with 👍 / 👎.
| credential stores, so it is not enough. The backend runs children either | ||
| as a **dedicated low-privilege sandbox user** (created by a one-time | ||
| elevated `qq sandbox setup`) or in an **AppContainer**, so that reads are | ||
| granted only where ACLs allow them. Readable roots (toolchains, the | ||
| workspace) get read/execute ACEs for that identity, writable roots get | ||
| modify ACEs, and denied paths get none. A restricted token with full (not |
There was a problem hiding this comment.
Use a per-call Windows identity for ACL grants
When the elevated setup creates one dedicated sandbox user and each workspace adds read or modify ACEs for that identity, those grants remain usable by every later call running as the same user. After QQ has visited two workspaces, a command whose current policy names only workspace A can therefore read or modify workspace B, violating the per-call writable-root boundary; cleanup cannot make this safe across crashes or concurrent calls. Windows access-allowed ACEs grant their rights to the named SID as described by Microsoft, so use a unique per-call SID/AppContainer capability or intersect the shared identity with a per-call restricting token.
Useful? React with 👍 / 👎.
| leaves the sandbox: it runs the command sandboxed with **explicit extra | ||
| resources** named in the rule (hosts for the proxy such as `github.com`, | ||
| a credential such as the git/`gh` token exposed to that call only, extra | ||
| writable paths). This matters because commands like `git push` or | ||
| `cargo publish` run repository-controlled hooks, helpers and build |
There was a problem hiding this comment.
Do not expose a reusable credential to repository hooks
When a durable rule supplies both github.com access and the raw git or gh token to a command such as git push, a repository-controlled pre-push hook inherits the same credential and allowed tunnel. The hook remains filesystem-sandboxed but can invoke the GitHub API with all of the token's authority, which is substantially broader than the exact push operation the user approved. Broker the intended authenticated operation through a helper that hooks cannot call, or issue a narrowly scoped one-shot capability instead of exposing the reusable credential to the command tree.
Useful? React with 👍 / 👎.
| - **Seatbelt** via `/usr/bin/sandbox-exec` with a generated `.sbpl` profile: | ||
| `(deny default)`, allow reads, allow writes under writable roots and the | ||
| session temp dir, deny writes to `.git`/`.qq` subpaths, and allow network | ||
| only to the proxy's loopback port. |
There was a problem hiding this comment.
Add kill-on-close containment for macOS
When a macOS child calls setsid and double-forks, the Seatbelt profile continues to restrict that child but provides no kill-on-close process container, and the plan names only a supervising watchdog for resource accounting. Apple documents that setsid creates a new session and process group, so killing the original group no longer reaches this daemon; a QQ crash also removes an in-process watchdog. This cannot satisfy the explicit daemonization and restart-recovery rows at lines 221-232. Add an OS-enforced containment or independent reaper that covers reparented descendants, or report the macOS backend unavailable. Apple setsid(2) documentation
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e74209e75b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| `cargo publish --dry-run` decide `allow` or `deny`. An `allow` rule never | ||
| leaves the sandbox: it runs the command sandboxed with **explicit extra | ||
| resources** named in the rule (hosts for the proxy such as `github.com`, | ||
| a credential such as the git/`gh` token exposed to that call only, extra | ||
| writable paths). This matters because commands like `git push` or |
There was a problem hiding this comment.
Keep credentials out of repository-controlled hooks
When a rule such as git push or cargo publish runs repository-controlled hooks or build scripts, exposing the git/gh token to the whole call lets that untrusted code read the token and use it against an allowed host such as github.com; blocking unnamed hosts therefore does not confine the credential's authority. Pass credentials through an operation-scoped broker/helper that descendants cannot query directly, or otherwise ensure repository code never receives the raw credential.
Useful? React with 👍 / 👎.
| - Landlock is a fallback only for hosts without unprivileged user | ||
| namespaces. It cannot isolate Unix sockets, so it is weaker and must be | ||
| reported as such. |
There was a problem hiding this comment.
Fail closed instead of selecting the Landlock fallback
On Linux hosts without unprivileged user namespaces, treating Landlock as a fallback despite its inability to isolate Unix sockets allows a sandboxed call to connect to another same-user call's proxy socket (or another authority-bearing local socket) and bypass its own host policy. Reporting that the backend is weaker does not satisfy the plan's fail-closed or cross-session isolation guarantees; count this backend as unavailable for affected auto and unattended calls unless it is paired with an enforcement layer that isolates socket endpoints.
Useful? React with 👍 / 👎.
| - Primary: **bubblewrap** (`bwrap`). Mount `/` read-only, bind writable | ||
| roots read-write, re-bind `.git`/`.qq` read-only, use a fresh `/tmp`, and | ||
| set `--unshare-user --unshare-pid --unshare-net` **always**, | ||
| `--die-with-parent`, and `--new-session`. The host network namespace is |
There was a problem hiding this comment.
Mount a fresh procfs in the PID namespace
With / recursively bind-mounted from the host, --unshare-pid alone leaves the inherited host procfs visible, so a same-UID child can inspect host process metadata and potentially read QQ's environment or reach files through /proc/<pid>/root and /proc/<pid>/fd, bypassing the denied-path policy. The bubblewrap manual documents --unshare-pid and --proc DEST as separate operations; replace the inherited /proc with a fresh procfs mounted from inside the new PID namespace.
Useful? React with 👍 / 👎.
| - Primary: **bubblewrap** (`bwrap`). Mount `/` read-only, bind writable | ||
| roots read-write, re-bind `.git`/`.qq` read-only, use a fresh `/tmp`, and |
There was a problem hiding this comment.
Prevent pre-existing hardlinks from crossing writable roots
If a workspace file is already hardlinked to a file outside the workspace, rebinding the workspace read-write does not separate their shared inode, so writing the in-workspace name also modifies the supposedly read-only external file and the hardlink escape-suite case cannot pass. Reject such files before launch or use a copy-up mechanism that ensures writable-root inodes are not shared with paths outside those roots.
Useful? React with 👍 / 👎.
|
|
||
| | Slice | Scope | Acceptance | | ||
| | --- | --- | --- | | ||
| | S0 | Threat model and policy types. `SandboxPolicy` (writable roots, denied reads, network mode, allowlist), `sandbox` field on `shell`/`exec`, typed `sandbox_denied` result, protocol and config additions, no enforcement. | Protocol fixtures; config round-trips; ADR for the model above, including the `unsafe` exception. | |
There was a problem hiding this comment.
Include the required protocol-version bump
S0 explicitly adds protocol fields and a typed result, but its acceptance lists only fixture updates. Shipping those wire changes under the existing version can leave clients interpreting a changed contract as compatible; add the required PROTOCOL_VERSION bump and retain the preceding fixtures for compatibility coverage.
AGENTS.md reference: AGENTS.md:L44-L45
Useful? React with 👍 / 👎.
| that `TMPDIR` points at, and configured extras. `.git` and `.qq` inside | ||
| the workspace stay read-only unless policy allows them (so a goal can | ||
| commit but cannot rewrite hooks or trust config). |
There was a problem hiding this comment.
Keep Git trust files read-only during commits
If a rule makes .git writable so that git commit can update the repository, the pre-commit and commit-msg hooks run inside that same call and inherit the write grant, allowing repository-controlled code to replace .git/hooks, edit .git/config, or install a credential helper for later calls. Define narrower writable Git state such as the intended index, object, ref, and reflog paths, or perform the Git mutation through a broker that never grants hooks write access to trust-bearing files.
Useful? React with 👍 / 👎.
| Approval modes collapse to: `read-only` (sandbox, no writable roots), | ||
| `auto` (sandbox plus rules plus refuse-on-escalation, the unattended | ||
| default), `ask` (sandbox plus human for escalations), and `full` (no sandbox, | ||
| explicit and logged). |
There was a problem hiding this comment.
Preserve stored supervised sessions during mode collapse
Existing write-child sessions persist supervised in sessions.approval_mode, and snapshot and claim paths parse that value back into ApprovalMode::Supervised; removing the mode as part of this collapse without a store migration or legacy decoder will make those durable sessions fail with a constraint error after upgrade. Map stored supervised rows to the new sandboxed behavior while retaining backward decoding, and add migration coverage.
Useful? React with 👍 / 👎.
…nreachable trust prompt (#476) * refactor(tui): delete the unreachable project trust prompt Since #446 every startup path ignores untrusted project configuration instead of failing with TrustRequired, so the TUI never received pending trust. Remove Mode::Trust and its resolver, RuntimeFactory::resolve_trust and process-scoped trust, and the ProcessTrust/TrustChanged/TrustDeclaration machinery that only served the prompt. qq trust, qq doctor, qq init and qq config sources keep their behaviour. crates/qq-tui/src/effect.rs returns to its pre-#161 contents because #161 added only the trust effect. QQ-Allow-Revert: crates/qq-tui/src/effect.rs * docs: describe unattended Auto, sandbox requirements and task tools Help text, the /approval picker, README and the user guide still described held Auto calls, the classifier as the gate, y/a/w prompts, and the TUI trust prompt. Rewrite them for the shipped behaviour, document what the shell sandbox needs on each OS and the task-workspace limits, list task_commit, task_push and task_pr, and fix stale design notes (tools.md, architecture.md PR #375 row, ADR-0050 status). Update the verify-qq skill in both copies.
Stacked on #374. Adds
docs/plans/sandbox.md: the plan for letting goals run for hours or days on Linux, macOS and Windows with no blocking approval prompts.Approach: commands run inside an OS sandbox without asking, with saved command-prefix rules for actions that need to leave it (push,
gh). An unruled escalation is refused back to the model as a typedsandbox_deniedresult, or queued as a non-blocking pending grant, so unattended runs never stall. If no sandbox is available, unattended runs refuse to start. No LLM sits in the default decision path;reviewer_modelmay answer escalations only.sandbox-exec).unsafe, so the plan names one exempt crate,qq-sandbox, as a#![forbid(unsafe_code)]exception.Also links the plan from
docs/plans/README.mdand from H10 inspeed-first.md.Verification: doc-only.
docs_truthtests andcargo xtask lintpass.