feat(core): enforce project MCP trust boundaries - #1263
Closed
sethkarten wants to merge 18 commits into
Closed
Conversation
This was referenced Aug 12, 2026
sethkarten
marked this pull request as ready for review
August 12, 2026 06:00
…aved-sibling-validation
sethkarten
force-pushed
the
core05-project-mcp-trust
branch
from
August 12, 2026 18:34
eb1a438 to
c29a387
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 35de6e2. Configure here.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Core-05: project MCP declarations and trust boundaries
Draft publication for stack visibility. Validation is in progress and will be appended to this PR.
Scope
Hard exclusions
Parent: Core-04 #1262 at
4e9c1f2cbfe072d5226f0e49d37e799b6cdce345Head:
6e8e33c484a26498d41022accd5f118ebe7822fcPost-publication objective gates are in progress; valid findings will be fixed append-only.
Note
Enforce MCP project trust boundaries with admission-gated declaration management
mcp), document parsing/validation, URL canonicalization, redaction, and per-scope (user/project) read/write viamcp-declarations.tsandmcp-declaration-command.ts.McpProjectTrustAuthority(project-trust-authority.ts) that pins OS directory file descriptors to canonical project paths, issues opaque bindings, and validates them against a revisioned, digest-verified policy snapshot to prevent TOCTOU races.ProjectMcpDeclarationAdmissionis held; admission is derived from a global-only policy (mcpProjectTrustPolicy) and released after use.openat-style helper (project-settings-openat.ts) that operates over a trusted file descriptor, never exposing raw project paths.McpManagerand both the SDK (sdk.ts) and agent session (agent-session-services.ts) entry points now build an immutableMcpRuntimeDeclarationSnapshotfrom global + conditionally admitted project declarations, replacing direct settings reads.Macroscope summarized f0bfce6.
Final validation
1f23778f9a94673de05eff5eecdab15045363c01tsgo --noEmit: passgit diff --check: pass; worktree cleanmcp testis preview-only and cannot calltransport.open, eliminating late-open session leakage at this layer.Note
High Risk
New security-critical paths for project MCP (trust bindings, TOCTOU checks, openat settings I/O) and behavior changes: project legacy MCP servers no longer drive host integrations; project declarations require explicit global trust.
Overview
Adds a
prime-agent mcpCLI for credential-free MCP declaration records (list,inspect,preview,test,add,enable,disable,remove, optional--project). Output is redacted JSON;mcp testis preview-only (no transport/network).Introduces M01 declarations (
name,url,enabled) with strict parsing and settings APIs (getMcpDeclarationDocument/setMcpDeclarationDocument). Project scope is gated by global-onlymcpProjectTrustPolicy: opaque admissions, retained-directory trust authority, and descriptor-relative project I/O via a sandboxed Python openat helper—denied or malformed policy must not open project settings (CLI loads global settings first for--project).Runtime builds an immutable declaration snapshot (user + admitted project; name/endpoint collisions drop the whole project contribution).
McpManagerstill resolves legacy integrations from globalmcpServersonly; snapshots are exposed separately and do not register OAuth/host handlers. SDK and session service creation compose project admission/readers before merging declarations; injectedmcpManageris unchanged.Reviewed by Cursor Bugbot for commit f0bfce6. Bugbot is set up for automated code reviews on this repo. Configure here.