Repository navigation
fix(core): classify agent_poll as Risk::Write (consumes the mailbox) - #301
Merged
Merged
Conversation
A settled agent_poll forgets the uteke mailbox and persists mailbox_consumed, so a ReadOnly tier bypassed the approval gate and plan mode. Reclassify as Write, allowlist agent_poll by exact name in the internal trust preset, pin the tier with a test, and update docs. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Reclassify
agent_pollfromRisk::ReadOnlytoRisk::Write(option A) and allowlist it by exact name in--trust internal.Why
A settled
agent_pollcallsclean_mailbox(uteke forget) andwrite_meta(persistsmailbox_consumed) viaconsume_mailbox. A ReadOnly tier let that mutation skip the Approver and run under plan mode, violating AGENTS.md section 6 and the invariantjob_polldocuments (a ReadOnly poll must never mutate).Why A over B (pure ReadOnly poll, consumption elsewhere): consume-once semantics (#243/#260/#287) are load-bearing, and there is no other legitimate Write path that observes a child settling (the child is detached; agent_start has returned long before). Option B would need a new host-side mechanism or leave mailboxes uncleaned, i.e. more code and weaker behavior. Option A keeps
consume_mailboxuntouched (consume-once, mark consumed only after successful recall, retry on recall error).Plan mode: Write tools are dropped, but
agent_start(already Write) is dropped too, so no child can exist for a plan-mode parent to poll. Nothing regresses.Unattended friction:
--trust internalpreviously coveredjob_*but notagent_*. I added the exact nameagent_poll(notagent_*), so the poll loop stays prompt-free whileagent_startstill prompts. Theread_onlypreset is unchanged: it holds no agent_start, and adding a mutating tool to it would contradict its name. Destructive layers are untouched.Changes
AgentPollTool::risk()->Risk::Writewith a doc comment explaining why.internaltrust preset gainsagent_poll; preset test asserts it and thatagent_*/agent_startare not allowlisted.agent_tools_are_write_tier_because_poll_mutatespins the tier (verified failing against the old ReadOnly code: left ReadOnly, right Write).docs/threat-model.md(child agents section) state the tier.Testing
🤖 Generated with Claude Code