Repository navigation
Command rules as data: Sonny runs Codex's Starlark rules files, the daemon applies what each bot is given - #577
Conversation
A SigV4 refusal is told as clock skew when the error names it, or when the response's Date is more than four minutes from when the request was signed, the AWS SDK for Java's rule. A machine that slept with a signed request in flight now re-signs instead of failing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
The `history` tool's view already dropped reasoning items' encrypted content. It now also drops a thinking block's signature, a redacted thinking block's data, and a web search result's encrypted content: bytes the provider hands back only to be replayed, which no agent can read. Thinking text stays; stored items, raw reads, forks and replay are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
The history view's READING_ITEM now matches quoted JSON keys, and the planner's constant pattern stopped at its first escaped quote. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…ent/rules replace a bot's unsandboxed list The daemon reads every *.rules file in the folder it is started with (`serve --rules DIR`; the CLI passes ~/.agent/rules) and decides each shell call by the strictest rule its commands match, as Codex's execpolicy does: allow runs outside the sandbox without asking, prompt waits on the gate even when confined (or fails command_needs_approval with no gate), forbidden fails command_forbidden with the justification. A turn pins its rules when its rounds begin; the folder is read again when its files change, keeping the last good rules, and a folder broken before any read fails every shell call with rules_invalid. The folder is read-only in every sandbox. The files are read by a small reader of Codex's documented form (literal prefix_rule and host_executable calls, comments), not a Starlark runtime. `agent rules check -- COMMAND...` shows what the rules decide. The unsandboxed bot setting is gone (schema 75 strips it from stored bots; protocol 39). Sonny's "always allow" writes an allow rule to default.rules, and an existing [sonny] unsandboxed list moves there once at start. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…s no force Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
… the runtime thread, linked rules files refused A planned call keeps what the rules made of it (tools.ruling, schema 75), and its run reads that, so a park, restart or edit between announcement and run can't gate a call no request was made for. The rules folder is read on a blocking thread. A rules file that is a symlink or has another hard link is rules_invalid: the sandbox keeps only the folder itself read-only. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
… and linked files Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…nreadable rules file is refused A fresh round runs by the rules the turn read, which its announcement used, so it needs no store read; only a resumed park reads the rulings its round recorded, in the resume's own store job. A rules file whose metadata can't be read is refused rather than skipped, so the rules last read stay. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…fig.toml `configure` gains `settings`, a map with create's names: a value given replaces the setting, null resets it to its default, and the rest stay. Naming `sandbox` resets writable, network and unix_sockets unless they are named too. `fallback`, `compaction_instructions` and `compaction_model` take null to remove. The old top-level sandbox, writable, network, unix_sockets, cache_ttl and speed fields are gone. `changed` names each setting key, with the sandbox's four reported as `sandbox`. Protocol 41. Sonny's tool host checks config.toml every five seconds and configures its agents to a changed [fallbacks] entry or senders setting. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…s no force Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…ders only when the sandbox changes A setting named with null was dropped before the names were checked, so a misspelled reset passed silently. And every settings change resolved the writable folders again, so one deleted since failed an unrelated change. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
# Conflicts: # client/src/lib.rs
…aemon applies what each bot is given The daemon no longer reads rules files. A bot's `rules` setting holds its command rules as Codex's execpolicy shape in JSON (prefix_rules, host_executables, or invalid with why), and the daemon matches each shell call against them as before. A bot made by another always goes by its creator's rules and follows their changes; configuring rules on it is invalid_setting. Sonny reads ~/.agent/rules as Codex does: Starlark in its extended dialect with f-strings, prefix_rule and host_executable (now with effect), examples checked after the file runs. network_rule is refused until a proxy can filter a sandbox's network by host. Sonny gives the rules to every agent it makes and keeps them current from its tool host. `sonny rules check` replaces `agent rules check`, and `serve --protect-path` replaces `serve --rules`, so the folder stays read-only in every sandbox. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…s no force Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ 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: ba3f7812c9
ℹ️ 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".
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: ba3f7812c9
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
… bot whose creator is gone own its own A create reply repeats the bot's settings, now with its command rules, which admission reserves room for: what the command gives, or the cap for a bot that takes its creator's. inspect and the create reply show `rules` with the other settings. A bot whose creator is deleted keeps the rules it had and may be given its own, as no creator's sandbox holds it either; Sonny's tool host gives such an agent its rules as it gives a root one. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
…st_executable names Codex matches a program run by any absolute path by its name's rules when no host_executable names it. For an allow rule, which runs the command outside the sandbox, that lets a sandboxed bot write /tmp/rg and run it unasked. Such a path is still asked about or refused by the name's rules, but only a listed path is allowed by them. Examples still match by pattern alone. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGGxFkGajbntA1atiYT
#577 took 43, so this branch's protocol moves to 44. The turn test's rules are a policy given as data, as Sonny now passes them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGF9fn2EXiBvzYrQtaA
The last PR of the day-5 review: command rules at full Codex fidelity, with the language kept out of the daemon.
What changes
rulessetting holds Codex's execpolicy shape as JSON:prefix_rules,host_executables, orinvalidwith why the client couldn't read them. The daemon matches each shell call against them as Command rules: Codex-style allow, prompt and forbidden rules replace a bot's unsandboxed list #572 did, now withhost_executablein effect: a command run by an absolute path is matched by its program's name when that path is listed for it, or none is.ruleson it isinvalid_setting.~/.agent/rulesas Codex does. The files are Starlark in its extended dialect with f-strings and the standard globals, so variables, loops and functions work.prefix_ruleandhost_executableare ported from Codex, and each rule's examples are checked once the file has run, as Codex checks them.network_ruleis refused: it needs a proxy that filters a sandbox's network by host, which is its own feature.config.tomlfollower from configure takes every setting create takes; Sonny's agents follow config.toml #574.sonny rules check [--pretty] -- COMMAND...replacesagent rules check.serve --protect-path PATH(repeatable) replacesserve --rules DIR. It keeps a path read-only in every sandbox and stops it being created there. The CLI passes~/.agent/rules.Sonny's
Cargo.tomladds three crates:starlark(Meta's crate, which Codex uses),shlexandanyhow. The daemon's dependencies stay the same.Tests
host_executable.sonny rules check.test_command_rules_let_a_command_out_ask_about_it_or_forbid_itnow passes rules as data. It addsrules_invalidand an invalid setting.configure.agent rules checkCLI test moved to Sonny.cargo test --workspaceand clippy-D warningsare clean.AGENT_TEST_SANDBOX=1passes.bots_maker.No screenshots: nothing on screen changes.