Skip to content

[Fix] Ordinary tasks can access environment management tools - #1109

Draft
roomote-community[bot] wants to merge 3 commits into
developfrom
fix/scope-environment-tools-0sm1g25hoe2sf
Draft

[Fix] Ordinary tasks can access environment management tools#1109
roomote-community[bot] wants to merge 3 commits into
developfrom
fix/scope-environment-tools-0sm1g25hoe2sf

Conversation

@roomote-community

@roomote-community roomote-community Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

  • Stamp trusted environment setup, repair, and verification tasks with an action-specific capability.
  • Omit manage_environments from ordinary tasks and restrict setup tasks to only their required create, update, or verification actions.
  • Enforce the same task-purpose capability at the API boundary so direct run-token requests cannot bypass MCP discovery.
  • Reject user-authenticated queue launches that carry environment-management markers or impersonate the trusted setup workflow.
  • Prevent manual tasks, snapshot resumes, deployment environment variables, and legacy markers outside setup workflows from granting environment-management access.

Why this change was made

Environment management was registered for every task even though only environment setup and verification flows need it. The admin authorization added in #1102 remains the identity boundary; this change adds least-privilege task-purpose scoping around that boundary.

Impact

Ordinary coding tasks no longer discover or invoke environment management and cannot self-grant it through taskRuns.enqueue. Creation setup can create, revise, and verify its environment; existing-environment setup can update and verify; verification retries can only record verification.

The focused worker, API, web, SDK, and shared-type checks pass, along with the repository pre-push suite. The full preview-status test file still times out in its pre-existing first database-backed test in this sandbox; the changed preview repair test passes when run directly.

Related PRs

@roomote-community

roomote-community Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

No new code issues found. See task

  • packages/types/src/environment-management.ts:55 treated environmentManagementMode as trusted solely because it appeared in the shared payload. taskRuns.enqueue now rejects environment-management markers and the setup workflow for user-authenticated callers before queueing.

Reviewed e45f569

@roomote-community

roomote-community Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the enqueue trust boundary in e45f569: user-authenticated launches now reject explicit environment-management markers, verification markers, and forged setup-workflow classification before queueing. Focused SDK tests, SDK typechecking, formatting, and the repository pre-push checks pass. See task.

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