Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
|
Codex review: ready, awaiting a maintainer decision. What this changesAdds command-specific denied flag values to baked safety profiles and tightens agent-safe against destructive Gmail labels and notification-producing operations. Example: An agent-safe binary receives
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⏳ Ready, awaiting maintainer decision Keep open: this PR supplies a useful capability absent from main, resolves the prior code findings, and still needs an owner decision on the new policy contract and preset restrictions. Priority: P2 Decision needed
Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherBuild-time YAML parsing generates immutable policy lookups; the CLI checks parsed command paths and flag values before handlers can invoke Google APIs. flowchart LR
A[Profile YAML] --> B[Parser and generator]
B --> C[Baked hash lookups]
D[CLI arguments and defaults] --> E[Kong parser]
E --> F[Command and flag policy]
C --> F
F --> G[Allowed Google API operation]
Technical reviewBest possible solution: Adopt the existing parser-generator-enforcement design with an explicitly approved denied-values contract and agent-safe scope. Do we have a high-confidence way to reproduce the issue? Current-main command grants and handler behavior establish the reported TRASH and notification paths; the contributor also supplies stable-versus-candidate CLI comparisons, without reviewer execution. Is this the best way to solve the issue? Command-specific value checks reuse the existing baked-policy owner and preserve permitted organizing operations, while broader preset removals remain a product choice. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6f910fffac0a. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (3 earlier review cycles)
Reviewed November 13, 2026, 4:09 PM ET / 21:09 UTC (Revision 4). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
62bdc9c to
c0df495
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
0.47.1 shipped on 2026-10-26 without this change, so the entry belongs in the open release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2aiSKKPHZ2qnjrALo2Y1A
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Add a denied-values profile key that refuses named values of string and list flags on a specific command. agent-safe uses it to refuse the TRASH and SPAM labels on the Gmail modify commands and --send-updates all|externalOnly on calendar create, update and move, which were reachable through allowed commands. agent-safe also blocks calendar propose-time and Drive and Docs comment writes, which notify other people. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
calendar focus-time defaults to --auto-decline all, and declining a conflicting invitation notifies its organizer. Deny all and new so agent-safe only creates focus time with an explicit --auto-decline none. Denied values are read from the parsed flag, so the default is refused too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
…gent-safe A denied-values list of ["*"] refuses any value typed for the flag. agent-safe uses it, plus the focus-time and out-of-office event-type aliases, to stop calendar create and update from making focus or OOO events whose auto-decline defaults to all and notifies organizers. Explicit --focus-auto-decline none and --ooo-auto-decline none still work on create. update infers the type from any supplied focus or OOO flag, even an empty one, so its auto-decline flags take ["*"]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
- codex: a denied value containing a comma never matched, because only the comma-separated parts of the input were compared. The whole trimmed value is now compared too (--add-label takes names literally, commas included). Test fails without the change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K1fj3CKEioe5f7QqomgCCv
An omitted flag is allowed under "*" only when its default is empty. calendar focus-time with auto-decline: ["*"] still refuses an omitted --auto-decline, whose default is all. Also say values are compared whole before comma splitting. The new test fails when the default branch of the check is removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2aiSKKPHZ2qnjrALo2Y1A
0.47.1 shipped on 2026-10-26 without this change, so the entry belongs in the open release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T2aiSKKPHZ2qnjrALo2Y1A
The generator hashed the command path and flag of a denied-values rule but emitted the refused values as string literals, so an equal-length edit of the binary (private,report.txt -> private,report.csv) could lift a denial without touching compiled code. That reopened the ASCII patching the Tamper Resistance section and openclaw#540 closed. Each refused value is now hashed with its path and flag (safetyprofile.DeniedValueKey, NUL before the value), and the runtime hashes the whole value and each comma part the same way before the switch. The rule case reports whether it refuses any value, so "*" is compiled control flow too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NAC67iQrvrvQdbbutzzLzg
c0df495 to
aef4aaa
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Summary
A baked
agent-safebinary blocksgmail trashand the send paths, but these effects can still be reached through commands it allows:gog gmail thread modify <id> --add TRASHtrashes the thread. The same works throughmessages modify,labels modifyandbatch modify, and through--add-labelon thread and batch.gog calendar create|update|move ... --send-updates allemails every guest.all), and every decline notifies the organizer. You reach them throughcalendar focus-time, or throughcalendar create|updatewith--event-type, or with any--focus-*/--ooo-*flag, which infers the type.Today a profile can allow or deny command paths and lock boolean flags. That means the only way to close these is to block the whole command, which takes label organizing and calendar writes away from agents.
This PR adds a
denied-valuesprofile key:gmail read editisgmail thread modify.trash,TrashandTRASH,INBOXare all refused, and so is a denied value that itself contains a comma. Splitting can only over-deny."*"refuses any value typed on the command line, including an empty one. It also refuses any non-empty default. Use it for free-text flags whose mere presence causes the effect.calendar focus-timewith no--auto-declineis refused, because the parsed default isall.--dry-runis refused too. A refusal is a usage error (exit 2):flag --add value "trash" is denied for "gmail thread modify" by baked safety profile "agent-safe".verifyLockedFlagsExist, so a typo can't claim a guarantee the binary doesn't give.safetyprofile.DeniedValueKey). The runtime hashes the value it was given, both whole and per comma part, before the switch. Whether a rule is"*"is compiled into the rule case.agent-safe changes
--add, and on--add-labelwhere it exists.--send-updates all|externalonlyon calendar create, update and move.--event-typealiases,--focus-auto-decline/--ooo-auto-declineall|new, and any--focus-chat-status,--focus-decline-messageor--ooo-decline-message. Explicit--focus-auto-decline nonestill works."*". Update infers the type from any supplied focus/OOO flag, even an empty one, and an empty mode defaults toall.calendar focus-time --auto-decline all|new, including the default.calendar propose-time. Its--declineand--comment(which implies decline) patch the event withSendUpdates("all"), and--commentis a string a flag lock can't reach.The preset changes are separable from the profile key. Happy to drop any of them.
Built-binary proof (head baf3d02, profile
safety-profiles/agent-safe.yaml)Forbidden runs use a fake account and no
--dry-run. The refusal comes before auth, so no request is built or sent. Permitted runs use--dry-run, which prints the request the handler would send. The comma case uses a second binary built from a one-rule profile (drive.upload: {name: ["private,report.txt"]}).Testing
I wrote the tests first and ran each one red before implementing:
go test ./internal/safetyprofile/ -run DeniedValuesexited 1 withParse: unsupported safety profile value at "denied-values.gmail.thread.modify.add"go test ./cmd/bake-safety-profile/exited 1 withgenerated output missing case for calendar.create send-updatesgo test ./internal/cmd/ -run "DeniedValues|AgentSafeProfile"exited 1. Example: the dry-run case returned{"dry_run": true, "op": "gmail.thread.modify" ...}instead of being refused. The focus/OOO cases reachedruntime service is required: calendar.TestDeniedValues_MatchesADeniedValueContainingACommaexited 1 against the split-only matcher.make fmt,make lintandmake testeach exit 0 at the head.Addressed from the ClawSweeper review of 085199d
--event-typeand type inference.Transport proof (head c0df495, profile
safety-profiles/agent-safe.yaml)Each run went through a local HTTPS proxy that logs one line per CONNECT (host and port only, nothing decrypted), against a real account. A refused run opened no connection at all. A permitted run reached the production client. The Gmail thread already carried
INBOX, so the permitted modify changed nothing, and its labels read the same afterwards. The calendar event was private, free, had no attendees, and was deleted afterwards. Account email and event link are redacted.The proxy and the driver script are short and available on request.
Addressed from the ClawSweeper review of aaae5d1
TestDeniedValues_AnyValueRefusesANonEmptyDefault. The test goes red when the default branch of the check is removed, because the dry run then emitsautoDeclineMode: declineAllConflictingInvitations.0.47.2 - Unreleased. The commit hashes above predate the rebase.make fmt,make lintandmake testeach exit 0 at the new head. The built-binary proof was captured at baf3d02; the enforcement code has not changed since, only docs, one test and the changelog.Addressed from the ClawSweeper review of c0df495
TestGenerateDeniedValuesEmitsHashedLookupran red against the old generator, whose output containedreturn []string{"private,report.txt"}, and passes now.TestSafetyProfileDeniedValueHashAgreementpins the runtime key to the generator's key. It went red (runtime=0x384a5e248733b5b2 codegen=0x9863ab7239c23808) when I changed the runtime separator, and passed again once I restored it.drive.upload: {name: ["private,report.txt"]}) at the new head:0.48.1 - Unreleased.Plan: none -- upstream contribution, the design is described in this PR body
🤖 Generated with Claude Code
https://claude.ai/code/session_01NAC67iQrvrvQdbbutzzLzg