feat: enforce shadow mcp access rules#2771
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: c234311 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
||||||||||||||||
|
|
||||||||||||||||
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
b619982 to
3c1bdba
Compare
c80e96d to
a8c75ec
Compare
3c1bdba to
8f8b84d
Compare
2f5e167 to
7a121ef
Compare
8f8b84d to
7f980c0
Compare
7a121ef to
bfc2dd6
Compare
b728224 to
38546a7
Compare
ac6e88b to
131f304
Compare
131f304 to
c2eb920
Compare
df986c6 to
c27ea56
Compare
c2eb920 to
635f6d2
Compare
c27ea56 to
d1f9e60
Compare
635f6d2 to
4b26085
Compare
4b26085 to
c234311
Compare
Prompt-injection risk reportCorpus: 933 cases (384 malicious / 549 benign) No main baseline artifact found yet; this comment shows the current run only. Operational Modes
L1 opt-in was not evaluated in this run: classifier URL is not set. Generated by |
🚀 Preview Environment (PR #2771)Preview URL: https://pr-2771.dev.getgram.ai
Gram Preview Bot |
Summary
This PR wires Shadow MCP runtime enforcement to the generic Redis-backed access rules added in #2763.
The runtime path now:
accesscontrol.Storeintoshadowmcp.Clientshadow_mcprules for the active organization/projectThis PR also removes the legacy Shadow MCP approval Redis store/files. Runtime server-identity rules now only apply after a configured MCP server was actually matched, so an identity allow rule cannot allow an unconfigured server alias.
Verification
mise run test:server ./internal/hooks ./internal/shadowmcp -run 'TestClaude_PreToolUse_DoesNotAllowUnconfiguredServerByIdentityRule|TestClaude_PreToolUse_AllowsApprovedLocalStdioServer|TestEvaluateAccessRules' -count=1passed, 5 testsrg -n "shadow-mcp-allow|AddShadowMCPApproval|RemoveShadowMCPApproval|IsShadowMCPApproved|func CanonicalizeMatch\(" server/internal client/dashboardreturned no matchesmise run test:server ./internal/accesscontrol ./internal/access ./internal/risk ./internal/shadowmcp ./internal/hooks -count=1passed, 458 testsmise run lint:serverpassedpnpm --dir client/dashboard type-checkpassedpnpm --dir client/dashboard exec vitest run src/components/access/ShadowMCPAccessContent.test.tsxpassed, 3 testsgit diff --checkpassedStack
https://linear.app/speakeasy/issue/AGE-2586/feat-enforce-shadow-mcp-access-rules