Skip to content

Allow build drivers to request sandbox escape - #816

Merged
jonathanKingston merged 6 commits into
mainfrom
codex/fix-build-driver-escalation
Jul 18, 2026
Merged

jonathanKingston merged 6 commits into
mainfrom
codex/fix-build-driver-escalation

Conversation

@jonathanKingston

@jonathanKingston jonathanKingston commented Jul 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #786

Summary

  • classify host-dependent build operations as ambiguous instead of fully contained
  • let the existing expects_sandbox_block approval path work for xcodebuild, Gradle, Swift, and Cargo builds
  • retain hard-external precedence and keep non-build compiler queries sandbox-contained

Validation

  • npm run check
  • npm run build

Note

Medium Risk
Changes shell permission classification for common build commands; misclassification could over-prompt or under-restrict, but scope is narrow and hard-external precedence is preserved in tests.

Overview
Host-dependent toolchain builds (xcodebuild, gradle, and swift/cargo build-style subcommands) are now classified as ambiguous instead of fully sandbox-contained, because they often need host caches (~/.gradle, ~/.cargo, ~/Library) or system build services even when argv looks workspace-local.

On macOS these still auto-run inside seatbelt first; agents can use the existing expects_sandbox_block path to request up-front approval to run outside the sandbox (same pattern as gh pr create). Hard-external signals (e.g. curl alongside xcodebuild) stay external; version/metadata-only invocations like swift --version remain sandbox.

Reviewed by Cursor Bugbot for commit b77fff4. Bugbot is set up for automated code reviews on this repo. Configure here.

@jonathanKingston
jonathanKingston force-pushed the codex/fix-build-driver-escalation branch from c78f40e to 3b969fd Compare July 12, 2026 17:49
@github-actions

github-actions Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

E2E screenshot updates

Refreshed (4)

Clearly-different shots re-rendered by the CI e2e run and committed:

Ignored as render noise (7)

These re-rendered below the variance threshold (font hinting / anti-alias wobble) and were not committed. To accept them anyway, add the update-screenshots label or commit the rendered PNGs by hand:

  • markdown-table-wrap-message.png — 30 px (0.0031%)
  • markdown-table-wrap.png — 30 px (0.0031%)
  • portrait-panel-controls-chrome.png — 57 px (0.0059%)
  • portrait-panel-controls-footer-row.png — 57 px (0.0696%)
  • portrait-panel-controls-settings-seam.png — 4 px (0.0062%)
  • portrait-panel-controls-with-panel.png — 515 px (0.0536%)
  • settings-usage-plan-limits.png — 521 px (0.0543%)

These PNGs live under tests/e2e/screenshots/ for human visual review; CI asserts DOM structure, not pixel diffs.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Merge conflict needs a human

main advanced and screenshot conflicts were resolved automatically, but the merge updates these workflow files, which CI's token isn't scoped to push. Merge or rebase main by hand (or grant the SCREENSHOTS_PAT the workflow scope to let CI resolve these automatically):

  • .github/workflows/ci.yml

@jonathanKingston
jonathanKingston force-pushed the codex/fix-build-driver-escalation branch from 3b969fd to 479d6f2 Compare July 14, 2026 11:28
@jonathanKingston
jonathanKingston force-pushed the codex/fix-build-driver-escalation branch from 479d6f2 to a63bc85 Compare July 14, 2026 13:54
@jonathanKingston jonathanKingston added area:shell Shell execution, command routing, and sandbox behavior enhancement New feature or request priority:p3 Normal-priority backlog work labels Jul 16, 2026 — with Cursor
github-actions Bot and others added 2 commits July 17, 2026 10:16
# Conflicts:
#	tests/e2e/screenshots/panel-position-bottom.png
#	tests/e2e/screenshots/panel-position-side.png
#	tests/e2e/screenshots/ssh-projects-pane-after-enable.png
@jonathanKingston
jonathanKingston marked this pull request as ready for review July 18, 2026 14:55
@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_b77e1df8-1e4f-4fa2-ad9a-a26b093362b4)

@jonathanKingston
jonathanKingston enabled auto-merge (squash) July 18, 2026 14:56

@cursor cursor 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.

Stale comment

Not approving: Cursor Bugbot skipped (usage limit reached) and CI precheck failed on npm audit. Human review is needed before merge; no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@cursor

cursor Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_c72aec6c-de53-4daf-9d1c-46530115baa7)

@cursor
cursor Bot requested a review from AutomatedTester July 18, 2026 18:53

@cursor cursor 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.

Not approving: Cursor Bugbot skipped (usage limit reached), so automated review did not complete. Human review is needed before merge; assigned AutomatedTester as reviewer.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@jonathanKingston
jonathanKingston merged commit 2aad52e into main Jul 18, 2026
20 checks passed
@jonathanKingston
jonathanKingston deleted the codex/fix-build-driver-escalation branch July 18, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:shell Shell execution, command routing, and sandbox behavior enhancement New feature or request priority:p3 Normal-priority backlog work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build drivers (xcodebuild/gradle/swift) can't escape the seatbelt: expects_sandbox_block is ignored for "contained" commands

2 participants