Skip to content

fix: enforce L3 approval for Runtime workspace deletion - #801

Merged
Y1fe1Zh0u merged 2 commits into
dataelement:mainfrom
Y1fe1Zh0u:fix/runtime-l3-delete-approval
Jul 28, 2026
Merged

fix: enforce L3 approval for Runtime workspace deletion#801
Y1fe1Zh0u merged 2 commits into
dataelement:mainfrom
Y1fe1Zh0u:fix/runtime-l3-delete-approval

Conversation

@Y1fe1Zh0u

@Y1fe1Zh0u Y1fe1Zh0u commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route Durable Runtime deletion through the existing delete_files autonomy policy
  • keep an L3 delete tool call pending and put the originating Run in waiting_user
  • resume that exact Run after approval or rejection instead of executing inside the approval endpoint
  • execute an approved delete once; return a typed rejection result without touching storage
  • preserve Agent and Group Workspace scope across the approval lifecycle

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

  • Backend full suite: 2130 passed
  • Runtime approval and tool-step suite: 60 passed
  • Ruff: passed
  • Python compileall: passed
  • git diff --check: passed

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.

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
Y1fe1Zh0u marked this pull request as ready for review July 28, 2026 13:35
@Y1fe1Zh0u
Y1fe1Zh0u merged commit a9ddeee into dataelement:main Jul 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant