Skip to content

Isolate MCP connection authority and await descendant grant drains - #4456

Merged
Jason Morse (JasonVMo) merged 4 commits into
mainfrom
jasonmo-microsoft-f12-grant-isolation
Nov 6, 2026
Merged

Jason Morse (JasonVMo) merged 4 commits into
mainfrom
jasonmo-microsoft-f12-grant-isolation

Conversation

@JasonVMo

@JasonVMo Jason Morse (JasonVMo) commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Platforms Impacted

  • iOS
  • macOS (native qualification not run)
  • win32 (Office; native qualification not run)
  • windows (native qualification not run)
  • android

Description of changes

F12 separates driver-control, declared-workload, and operator-recovery scopes, defaulting grants to driver-control only. Trusted delegation enforces strict target and scope subsets, with bounded depth and service-lifetime issuance. The fixed HTTP delegation route can only create a driver-only child for the current target set.

Each MCP controller now keeps a distinct child principal after verified descriptor discovery. Sibling sessions remain isolated; older or unprotected services without delegation fail closed. Parent revocation synchronously invalidates its subtree and exposes an awaitable drain that joins acquisitions and session cleanup, including prior descendant revocations. Digest-only tombstones permit only the same child to retry its own terminal cleanup after a failed drain or lost response; unauthorized is not accepted as cleanup success. No management/recovery HTTP surface or cross-connection session resume is introduced. Credentials stay out of status, tool output, and diagnostics.

Mainline integration: Normal merge 114c7c1937ecf6f6b87ec8da72fe5b7b4f58026f incorporates F7 from main 0cfecf0b3a8d135c7cd7f5f6abc0400a9f00a3eb, following the earlier F1 integration at d9fc74280c7ecdc26329317ef2922580499f6dc9. The only manual conflicts were the desktop-driver and desktop-driver-mcp references/current-status.md tables, reconciled additively to retain F12 isolation/drain evidence, F7 neutrality/native-subpath evidence, and F1's shared service/recovery boundary. Exports retain ./native and ./driver-service. No unmerged sibling branch was integrated.

Test resilience: User-requested commit e4d2efc20f855d511c78e8c070a530f15d9ce7eb restores the original native-command budget in finally after each intentionally timed-out click in both quarantine tests. Both fixtures use a 25 ms fake application close delay, longer than the injected 10 ms click deadline. This follow-up changes tests only, not production cleanup behavior; the earlier hosted cleanup failure's cause remains unconfirmed.

Verification

Post-F7 integration validation: Focused suites ran on merge 114c7c1937ecf6f6b87ec8da72fe5b7b4f58026f; authority tests and the aggregate were rerun with the test-resilience change at final head e4d2efc20f855d511c78e8c070a530f15d9ce7eb.

  • yarn install --immutable — passed with existing peer warnings, reported by the implementation owner.
  • cd packages/agentic/desktop-driver && yarn test grants — passed, 23 tests.
  • cd packages/agentic/desktop-driver && yarn test recovery — passed, 12 tests.
  • cd packages/agentic/desktop-driver && yarn test settlement — passed, 19 tests.
  • cd packages/agentic/desktop-driver && yarn test src/server/authority.test.ts — passed, 33 tests, including after the resilience change; an independent coordinator rerun also passed 33 tests.
  • cd packages/agentic/desktop-driver-mcp && yarn test server — passed, 25 tests.
  • cd packages/agentic/desktop-test && yarn build — passed; generated the library required by the contract fixture.
  • cd packages/agentic/desktop-test && yarn test contracts — passed, 22 tests.
  • cd packages/agentic/desktop-driver && yarn format — passed after the resilience change.
  • Initial yarn clean-lage-cache && yarn lage buildci && yarn lage test-links --verbose --grouped — cache clear passed; buildci failed with 125 successful tasks and 1 failure because the unchanged storybook-desktop fake WDIO executable worker exceeded its 7000 ms process deadline. Links were not run in this attempt.
  • cd packages/agentic/storybook-desktop && yarn test wdioRunner — passed, 1 test, without source changes.
  • Resumed yarn lage buildci — passed, 60 successful executed tasks and 118 cached tasks, 0 failed; all 178 tasks were accounted for after the cache clear.
  • yarn lage test-links --verbose --grouped — passed, 90 successful tasks, 0 skipped/failed.

The coordinator independently read the retained focused-test and aggregate failure/retry logs and verified a clean worktree, F7 mainline ancestry, local/remote/PR head equality, and GitHub mergeable: true after the normal push. The WDIO deadline failure remains unattributed; a passing isolated or aggregate retry does not establish its cause. In the fresh hosted PR validation at e4d2efc20, the JS PR job passed: 178 tasks successful, 0 skipped, pending or aborted. The coordinator checked the job status and the retained raw log. Android, Win32, Bundle Size, NPM pack, changeset and repo-link jobs also passed. The macOS, iOS, Windows and Storybook native jobs were still running when this evidence was captured, so the full workflow is not claimed as passed. The JS pass does not confirm the cause of the earlier cleanup failure.

Historical hosted failure: The earlier JS PR job, before F7 integration and the test-resilience change, failed during harness.close() in src/server/authority.test.ts, in the quarantine session-ID isolation test, with AggregateError: Desktop Driver cleanup failed. The hosted driver suite reported 798 passed, 72 skipped, and 1 failed. A subsequent local authority-test run passed 33/33; both logs were retained and independently checked. Leakage of the fixture's 10 ms native-command budget into cleanup is a possible explanation, not a proven cause or baseline-flake classification. GitHub rejected the attempted JS-only rerun while other workflow jobs were running. That old-head rerun was subsequently dropped in favor of fresh CI on the new push; it is no longer pending.

Historical pre-integration validation at 341834bf902af962df0c67ddfed49300b6c291cd (not fresh-head results):

  • cd packages/agentic/desktop-driver && yarn format && yarn lint && yarn build && yarn test — passed; 808 passed, 61 skipped.
  • cd packages/agentic/desktop-driver-mcp && yarn format && yarn lint && yarn build && yarn test — passed; 25 passed.
  • yarn clean-lage-cache — passed.
  • yarn lage buildci — passed; 178 tasks, 0 failed.
  • yarn lage test-links --verbose --grouped — passed; 90 tasks, 0 failed.
  • yarn change:check — passed.
  • yarn check-agent-instructions, yarn oxfmt --check, and git diff --check — passed.

Not run: live native descriptor-path and physical-input qualification, including macOS, Windows, and Win32 consumer lanes. No live app or desktop-driver service was launched for post-main validation. JavaScript tests and bundles do not qualify these native behaviors.

Before After
Shared descriptor grant allowed MCP connections to share authority. Deterministic contract tests verify per-connection principals, subset enforcement, awaited drain, terminal cleanup retries, and no mutation replay. No UI screenshots apply.

Pull request checklist

This PR has considered (when applicable):

  • Automated Tests
  • Documentation and examples
  • Keyboard Accessibility — not applicable (no UI change)
  • Voiceover — not applicable (no UI change)
  • Internationalization and Right-to-left Layouts — not applicable (no UI change)

Fixes #4440

Separate permission scopes, attenuate each connection into a child principal, and preserve terminal-only cleanup proof across failed drains and lost responses.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Bundle size report

Tree-shaken, minified production esbuild bundles with React and React Native runtimes externalized.

Scenario Modules-Mac (Δ) Modules-Win (Δ) Size-Mac (Δ) Size-Win (Δ)
components-button 79 (+1) 80 (+1) 72.78k (-842b) 72.71k (-842b)
components-catalog 228 (+1) 229 (+1) 228.46k (-855b) 228.38k (-855b)
design-themed-root 55 (+4) 56 (+4) 56.26k (+998b) 56.18k (+998b)
design-color-lib 6 (+0) 6 (+0) 6.27k (+0b) 6.27k (+0b)
design-theme-state-legacy-source 49 (+1) 50 (+1) 52.96k (-841b) 52.89k (-841b)
design-legacy-theme 42 (+0) 42 (+0) 39.11k (+0b) 42.91k (+0b)
design-legacy-theme-from-flex 58 (+4) 58 (+4) 60.70k (+824b) 64.51k (+822b)
design-fluent-light-theme 7 (+0) 7 (+0) 18.74k (+0b) 22.59k (+0b)
design-fluent-theme 35 (+0) 35 (+0) 27.46k (+4b) 31.25k (-1b)
design-fluent-hc-theme 32 (+0) 32 (+0) 27.34k (+0b) 31.13k (+0b)
design-flex-theme 29 (-4) 29 (-4) 14.30k (-9.07k) 14.29k (-9.07k)
design-flex-cool-theme 26 (New) 26 (New) 12.51k (New) 12.50k (New)
design-flex-warm-theme 26 (-7) 26 (-7) 12.28k (-11.15k) 12.27k (-11.15k)

The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail.


View bundle-size workflow run

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve attenuated grant and cleanup status alongside native and driver-service boundary evidence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore normal cleanup budgets in finally and exercise application cleanup beyond the injected click deadline.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

Infrastructure: Attenuate desktop driver grants and isolate MCP connections

2 participants