Skip to content

feat(mothership): expose owner entitlements to the workbench as SIM_ENTITLEMENTS - #10218

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/sandbox-entitlements
Nov 19, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
feat/sandbox-entitlements

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The Mothership sandbox session now sets SIM_ENTITLEMENTS (comma-separated) from the turn owner's entitlements, computed fresh on every execution. The worker's workbench bootstrap reads it (simstudioai/mothership#986), so a turn granted workflow-code can run sim workflows source * / sim workspaces source * in the workbench terminal. With no grant, or if the lookup fails, the variable is omitted and the execution continues; enforcement is unchanged (the source use cases re-check the flag).
  • Drops unused imports and two string concatenations biome flags in workspace-source files from feat(workflow-code): workflows and workspace as code #10129.

Type of Change

  • New feature

Testing

  • sandbox-session.test.ts: per-execution values, the org-chat owner, and omission when nothing is granted or the lookup throws. The value tests fail with the source change reverted; the throw test fails with the guard removed. With execute-request.test.ts: 142/142.
  • apps/sim and workspace-code type-check, check:audits, biome.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…NTITLEMENTS

The worker's workbench bootstrap reads SIM_ENTITLEMENTS so entitlement-gated
CLI commands (workflows/workspaces source on workflow-code) appear in the
workbench terminal. buildMothershipSandboxSession now takes the execution's
principal and computes the turn owner's entitlements fresh per execution,
in parallel with the scoped endpoint. Visibility only: gated use cases still
re-check their flags, and a failed read omits the variable.
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 19, 2026 9:36pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 8 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects entitlement-based command visibility in Mothership workbench sessions.

Fix the principal passed to the entitlement checks before merging.

Findings

  1. P1 Workspace commands stay hidden ▶

Summary

Adds fresh owner entitlements to the workbench environment as SIM_ENTITLEMENTS, with a fallback when lookup fails.

  • Mothership workbench commands now reflect the chat owner's current grants.
  • Workspace source checks keep the same results after import and test-string cleanup.

Workspace chats still lose all entitlements because the execution principal is not accepted by the availability checks.

Reviews (1) · Last reviewed commit: "chore(workspace-source): drop unused imp..." · Reviewed by Greptile

… delegation

The Function execution's Copilot delegation is scoped to sim:function-executions,
which the availability use cases refuse, so workspace chats never got
SIM_ENTITLEMENTS. Re-scope the execution's own delegation (same actor, chat and
delegation id, no longer lifetime) to sim:workspaces through the existing trusted
Copilot principal helpers before computing entitlements; non-Copilot principals
get none. Adds real-Postgres coverage through the real availability use cases.
@waleedlatif1
waleedlatif1 merged commit 76fa5b5 into staging Nov 19, 2026
81 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/sandbox-entitlements branch November 20, 2026 00:20

This branch was previously deployed

1 inactive deployment
Preview — 268f70c9 Deployed Nov 19, 2026 by vercel[bot]
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