Conversation
The backend endpoint for execute-sql requires only query:read, so the extra insight:read in the MCP catalog hid the tool from tokens that could call it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
🤖 CI report✅ Trunk lane — non-backend lane (
|
|
[Critical risk] Changes permission requirements for SQL execution. The PR appears safe to merge, but a focused test would protect its scope-filtering fix from regression. Reviews (1) · Last reviewed commit: "fix(mcp): gate execute-sql on query:read..." |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: PostHog/posthog/.coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe execute-sql tool definitions now require only the query:read scope. Integration-test text states that requirement. The unit test checks that a query:read token includes execute-sql. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to execute-sql is now visible to query:read credentials, consistent with the endpoint’s existing scope; role-based SQL access remains in force. No material merge risk is established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change broadens SQL tool availability, but matches the backend’s existing query:read requirement and preserves authenticated user and project context. No new authorization bypass was established. Downstream enforcement was not fully verified end to end. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
query:readbut withoutinsight:readdoes not seeexecute-sql, so the agent cannot run any SQL.query:read(registration, scope check).insight:readcame in with the tool in feat(mcp): v2 with sql #46947, which gives no reason for it.Changes
execute-sqlnow requires onlyquery:readin the MCP catalog, which matches the backend.system.insightsalready returns only the insights the user's role allows, and the backend never checkedinsight:readfor this call.tool-definitions-all.json, and a comment and skip message in the integration suite.insight:read.How did you test this code?
Test rationale: the existing read-scope case in
tool-filtering.test.tsnow uses aquery:read-only token and checks thatexecute-sqlshows up. It fails ifinsight:readcomes back. No new test.hogli build:openapi-mcp-toolsandhogli build:openapi-cli-agent-scopes. Only the three files in this diff changed.tool-filtering.test.tslocally.Release status
Automatic notifications
Docs update
None. No doc lists the scopes for
execute-sql.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, claude-opus-5-5
/reviewing-with-coderabbit,/writing-pr-descriptions.--deepbecause the diff touches permissions. It reported no findings.execute-sqlscopes.system.*table for personal API keys and OAuth tokens. The backend runs that check only for project secret API keys.🤖 Generated with Claude Code