fix: enforce L3 approval for Runtime workspace deletion - #801
Merged
Y1fe1Zh0u merged 2 commits intoJul 28, 2026
Conversation
Durable Runtime executed typed delete tools outside the legacy autonomy boundary, allowing Agent and Group Workspace files to be removed even when delete_files was L3. Route Runtime deletes through the existing autonomy service, preserve Group scope in approval details, and execute an approved Group deletion against the original workspace. Constraint: Reuse the existing approval_requests schema and resolution endpoints; no migration. Rejected: Call the legacy execute_tool wrapper from Durable Runtime | it returns untyped results and loses Group Workspace scope. Confidence: high Scope-risk: moderate Reversibility: clean Directive: Keep approved Group Workspace actions bound to their captured tenant, group, participant, session, and path scope. Tested: Backend pytest 2126 passed; targeted Runtime and Group suite 86 passed; Ruff; compileall; git diff --check. Not-tested: Live browser approval flow before try deployment.
Runtime-scoped L3 deletion approvals now preserve the pending tool call and place the originating Run in waiting_user. Resolving the approval writes an idempotent resume command for that same Run; approval replays the original tool call while rejection returns a typed tool result without executing the delete. Legacy approvals retain their direct-execution fallback. Constraint: No schema migration or new dependency is allowed for the v1.11.3 regression fix. Rejected: Execute approved Runtime deletes inside the approval endpoint | ends the original Agent Run before it can report the outcome. Confidence: high Scope-risk: moderate Reversibility: clean Directive: Runtime-scoped approvals must resume their stored run_id and correlation_id; do not add a second out-of-band executor. Tested: Backend pytest 2130 passed; targeted approval and Runtime tool-step tests; Ruff; compileall; git diff --check. Not-tested: Browser E2E on try will be performed after deployment.
Y1fe1Zh0u
marked this pull request as ready for review
July 28, 2026 13:35
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.
Summary
Why
Durable Runtime bypassed the delete_files autonomy check. The first fix blocked deletion, but it settled the tool call as failed and later executed approval out of band, so the original Agent Run could not continue or report the result. Runtime-scoped approvals now use the existing wait/resume protocol.
Verification
Data impact
No schema or migration changes. The fix reuses approval_requests plus AgentRunCommand, with deterministic approval and resume identities.
Compatibility
Legacy approvals without Runtime correlation metadata keep their existing direct-execution fallback.
Live verification
Try deployment and browser E2E are pending.