Repository navigation
fix(media): honor sender tool policy for outbound file reads - #125950
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
f6363b4 to
0e702ce
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 6:39 PM ET / 22:39 UTC. ClawSweeper reviewWhat this changesThe PR makes outbound attachment reads honor sender-specific Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessNo blocking defect remains on the exact PR head. The prior gateway attachment-hydration gap is repaired; this maintainer-authored, security-boundary PR should receive normal owner review before merge. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherOutbound media access turns an agent-selected local path into an attachment before channel delivery. It receives trusted sender identity and policy context, then either permits scoped file access or retains only managed generated-media roots. flowchart LR
A[Inbound sender identity] --> B[Signed turn context]
B --> C[Sender tool policy]
D[Reply or message action] --> E[Outbound media access]
C --> E
E --> F[Attachment hydration]
F --> G[Channel delivery]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +61, Tests +289. Total +350 across 18 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical sender-policy decision in outbound media access, with signed aliases propagated only through the existing turn capability and managed artifacts remaining available after denial. Do we have a high-confidence way to reproduce the issue? Yes—current-main source leaves gateway attachment hydration outside the sender-alias policy, while the exact-head gateway and media tests define a focused denied-workspace versus managed-artifact path. Is this the best way to solve the issue? Yes—the patch repairs the owner boundary by deriving one scoped media-access object before hydration and dispatch rather than trusting request-supplied sender fields. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ed7317eeb954. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
5dadc35 to
f8450db
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…w#125950) * fix(media): enforce sender policy for outbound reads * fix(media): block denied attachment fallbacks * fix(gateway): preserve sender aliases for media policy * fix(media): scope wildcard and attachment actions * test(gateway): prove denied media stays unbuffered * fix(gateway): scope send attachment hydration
What Problem This Solves
Fixes an issue where operators using global or per-agent
toolsBySenderrules to deny file reads could still have a model-selected local file attached through final replies or message actions.Why This Change Was Made
Outbound media access now applies the same canonical requester policy used by ordinary tools before granting local-file access. Denied requesters retain only the established managed-artifact roots, while workspace-only filesystem policy continues to allow legitimate workspace attachments. The source session remains authoritative for channel-qualified rules, and the host-minted message-action capability carries all supported sender aliases without changing public configuration or protocol behavior.
User Impact
Sender-scoped file-read restrictions now apply consistently to outbound attachments. Allowed senders, workspace-only workflows, and managed generated media continue to work normally.
Evidence
Before the change, a focused probe showed the ordinary read tool denied while outbound media still exposed a reader and expanded the selected file's parent directory. Review of the real loader then identified a second path: an absent custom reader falls back to direct reads from retained baseline roots. After the change, an attachment-level regression proves that a denied workspace file is rejected with no disclosed bytes while a managed tool artifact remains loadable.
Validation completed locally:
pnpm check:changedpassed, including core/core-test typechecking, lint, import-cycle, policy, and database guards.