Repository navigation
Approver: only the person may let a call reach ~/.agent - #630
Merged
Merged
Conversation
The Monday rehearsal had the reviewer allow an escalated command that wrote ~/.agent/triggers/jobs/x, a job the scheduler runs outside every sandbox. --protect-path holds only inside the sandbox, and the judge's policy still called triggers under ~/.agent ordinary work, from before agents had the triggers tool. The policy now rates raw writes to the scheduler's jobs, the command rules and Sonny's scripts in ~/.agent as the approval channel, and changing config.toml or env directly as persistent weakening. And Sonny's approver never allows a call that reaches ~/.agent outside the folders the agent was given there on the judge's word: a write, edit or patch by the path it resolves to, or a command that would leave the sandbox by any path word holding .agent. What the judge would allow waits for the person, as Claude Code's --restricted keeps its own paths from its classifier; a denial stays one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFS1nm7W5mbwsNK4BH
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9630f1fb93
ℹ️ 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".
Each folder the agent was given in the home is kept as the daemon has it and as $HOME/.agent spells it, so a worktree named through a linked ~/.agent still counts as the agent's own; the command check matches the home by its real path too. The home is resolved in the blocking task with the per-call checks, so a slow mount can't hold up lease renewal. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFS1nm7W5mbwsNK4BH
lydakis
pushed a commit
that referenced
this pull request
Nov 1, 2026
…d tool Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg
lydakis
pushed a commit
that referenced
this pull request
Nov 1, 2026
…d tool Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg
lydakis
added a commit
that referenced
this pull request
Nov 1, 2026
* Sonny: triggers are automations, for the person and for agents The person's word for them is automation, so agents, who talk to the person, now read and say it too: the `automations` tool with `run`, the `~/.agent/automation` script, `sonny automation`, `/automations`, the `[automation NAME · ...]` headers, `origin: "automation"` and the automation_* error codes. Internal names (trigger.rs, request ids, --trigger-fire, scheduler labels) stay. Upgrade: the first 0.8.0 Sonny, scheduler or script to look moves ~/.agent/triggers to ~/.agent/automations, and Sonny's old ~/.agent/trigger script goes (migration automations-folder, retired in 0.10.0). History with origin "trigger" and old tool calls still read as an automation's. The memory cleanup schedules through the new script. The role eval gains an `automation` day (set up, list, run, remove) and accepts the old names so an arm of an older build compares. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: the runtime test adds from an agent's shell with the automation script Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: a broken --if fails the automation's run Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: an automation's turn cap says it counts the agent's history Agents set their own jobs caps of 4k to 12k tokens, and every first run failed on 29k to 42k of the agent's history. The tool and the skill now say what the cap counts and to set one only when the person asks for a spending limit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: the triggers folder moves only once nothing works in it A fire of the old Sonny keeps its paths to its end, so moving the folder under it lost its result and could run a one-off again (Codex review). Places::moved takes the folder's files lock, its scheduler's and every fire's first; while any is held, everything works in the old folder, and the scheduler, which holds its own, moves it within a minute of the last fire ending and runs again from the new place. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: #630's approver lines and tests name the automations folder and tool Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: the old triggers path links to the moved folder An add that chose ~/.agent/triggers before the scheduler moved it wrote there after the move, where nothing reads (Codex review). The move now leaves ~/.agent/triggers as a link to automations, made while the files' lock is held, and a writer that finds neither between the move and the link gets automations_moved rather than making the old folder again. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: a restore's list and the backup's list keep their pre-0.8.0 names readable restored-triggers.json, left by a restore for leads not opened yet, becomes restored-automations.json when next read; a backup's triggers.json is read when the copy has no automations.json and goes at its next sync (Codex review). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: the automations folder moves through upgrade::once, and a backup during a pending move keeps the old folder's list The folder's move and the restored list's rename are one migration run by upgrade::once wherever the folder is found, so its completion is recorded in ~/.agent/sonny/migrated; a HOME without ~/.agent gets no record (the scheduler's gone-HOME guard). Sonny's old ~/.agent/trigger script is its own migration, automation-script, at Sonny's start. home sync reads the active folder, so a sync while the move waits keeps triggers.json's replacement instead of deleting it. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: a restore's list is renamed without waiting for the automations folder to move Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg * Sonny: the background-command row reads as an automation's run Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGD7saFpzzSnMyV12Dg --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
In row 10 of the Monday rehearsal, the reviewer allowed an escalated command that wrote
~/.agent/triggers/jobs/x. The scheduler runs that job as the person, outside every sandbox.--protect-path ~/.agent(#587) holds only inside the sandbox, because an escalated command runs unconfined. The judge's policy also still listed "the agent's own … triggers … under~/.agent" as ordinarylowwork. That wording dates from before agents had thetriggerstool, so by its own rules the 2.6 s allow was correct.George picked option B from the options doc: https://claude.ai/artifact/1wczPNrRgGsFZG1HAJKTar
What changes
Judge policy (
client/src/approver.rs,policy!()):~/.agent".critical) now also covers writing, moving or deleting the scheduler's jobs (~/.agent/triggers), the command rules (~/.agent/rules), or the scripts Sonny writes in~/.agent, other than through Sonny's own tools.~/.agent/config.tomlor~/.agent/envdirectly. It is denied unless the person asked for that exact change.A rule over the verdict (
agent_client::approver::Home,own_home;sonny/src/approver.rs): the approver never allows a call that reaches~/.agenton the judge's word alone, unless the call stays inside a folder the agent was given in there (a task's worktree, the zen folder). If the judge would allow such a call, it becomes a doubt and waits for the person in/permissions. A denial stays a denial.write,edit,apply_patch: checked by the path the change resolves to, lexically and through links.shell: only a command that would run outside the sandbox (escalated, or the bot has no sandbox). The check matches any path word with.agentas a whole part, reading~,$HOMEand${HOME}as the home and resolving relative words fromworkdiror the turn's folder.$HOMEgets no pass: its folder holds the home, which its sandbox keeps read-only.No daemon or protocol change.
Differences from Codex and Claude Code (documented in docs/APPROVALS.md)
~/.codex. We hand those to the person.--restrictedbehaviour, where only the person may allow them.Tests
cargo fmt --all --check,cargo clippy -p sonny -p agent-client --all-targets -- -D warnings,cargo test -p sonny -p agent-client: all pass.~,$HOME,${HOME}, absolute, quoted,--config=,cd) and look-alikes (.agents,my.agent.name, a project's own./.agent); a sandboxed command that doesn't escalate is left alone; a write through a link into the home; a patch; Sonny'striggerstool left alone.