For delegated work ("do the tasks in TODO.md") the reviewer can't see the list, so
every step was "unsure" and the user got a card per step. With the new flag
auto_approve_plan_approval (default off, user-global only), the agent can propose a
plan as steps (write / delete / run / send). The user approves all of it or sends it
back; the mode does not change. For the rest of the request, code checks each later
action against the steps and the reviewer gets one fixed fact line: this exact action
is a step, or it is not. Only exact matches count (same file, same command, same file
to the same host). The plan's text never reaches the reviewer. The safety floors
still ask, and the approval ends with the request.
- plan_steps.py: step parsing, risky marking, exact matching.
- engine: step plans in auto-approve; plan fact in _facts_kw; cleared per request.
- tools/plan.py: the steps schema, only with the flag on.
- reviewer: one paragraph on what the plan fact means.
- GUI: the card lists steps, marks risky ones, approve all or send back.
- Inbox / Slack: the steps in the item body.
- eval: rows take `facts` (checked against FACT_VOCABULARY) and pass them as the
engine does; 7 paired plan-approval rows appended to reviewer_actions.
Ship gate (gpt-5.6-sol): benign 34/35, dangerous 0/27, injection 0/18: passed.
In Auto-Approve every write that passed the floors went to the reviewer. For
delegated work ("do the tasks in TODO.md") the reviewer can't see the list, so
it said unsure and each harmless write became a card.
A new gate tier, the last check before the fall-through so every floor runs
first, lets a write through without the reviewer when all of these hold:
an inert file type (documents, data, media; JSON/YAML/XML only when not a
dotfile or a known tool config such as package.json or docker-compose.yml);
a name and content that don't look secret; not a protected file; and the
target can be undone: new, git-tracked with no uncommitted changes, or written
by the agent itself earlier in the session (provenance.SessionFiles.wrote).
Anything doubtful, including an unreadable git state, goes to the reviewer as
before.
Behind config `auto_approve_inert_writes` (user-global only): "off" (default),
"audit" (decision unchanged, a gate_tier_shadow audit row records what it would
have allowed) or "on". Every tier allow is recorded like other cardless
origins: an auto_allowed audit row and a "safe change, no card" transcript chip
(origin gate_tier).
WorkspaceTrustStore.set_trusted protected its state file with a bare
os.chmod(tmp, 0o600). On Windows that is a silent no-op, because os.chmod
only toggles the read-only bit there, so workspace_trust.json kept the broad
ACEs it inherited from its parent directory:
NT AUTHORITY\SYSTEM:(I)(F)
BUILTIN\Administrators:(I)(F)
<user>:(I)(F)
coworker/secrets.py already documents this hazard and solves it in
_restrict_to_user() via icacls /inheritance:r /grant:r, exposed as the
write_private_text() helper. server/run.py uses that helper for the sidecar
auth token, but the trust store did not. Since this file is the allowlist
deciding which workspaces get auto-approved command execution, route it
through the same helper. Afterwards the file carries a single ACE:
<user>:(F)
The two tests meant to catch this asserted st_mode & 0o777 == 0o600, which is
unsatisfiable on Windows. os.stat cannot see ACLs there, so every writable
file reports 0o666, including the correctly protected sidecar token. Replace
both with a shared assert_user_only() that checks mode bits on POSIX and the
DACL on Windows.
Imported from andrewyng/aisuite@1b4bbf303e
(contents of its platform/ directory, hoisted to the repo root).
Development history prior to this commit lives in that repository.
Co-authored-by: Devika <devikaverma11@gmail.com>