Remove hardcoded permission allowlist for expert MCP tokens - #8185
Open
cstns wants to merge 4 commits into
Open
Conversation
The user:expert-mcp entry in IMPLICIT_TOKEN_SCOPES was a safety measure from before HITL and scoped PATs existed. With both now in place, the allowlist is a duplicate gate that adds maintenance overhead without meaningful protection. Every new tool capability required updating this list or it would silently fail. The expert MCP token now inherits the user's full permissions (gated by team role). The token is short-lived (5 min TTL) and first-party only. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cstns
requested review from
Steve-Mcl and
n-lark
and removed request for
n-lark
August 11, 2026 16:23
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8185 +/- ##
=======================================
Coverage 76.19% 76.19%
=======================================
Files 441 441
Lines 23619 23621 +2
Branches 6289 6290 +1
=======================================
+ Hits 17996 17998 +2
Misses 5623 5623
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
user:expert-mcpentry fromIMPLICIT_TOKEN_SCOPESinforge/routes/auth/permissions.jssession.scopeforuser:expert-mcptokens in the auth flow so they inherit the user's full permissions (gated by team role)This was a safety measure from before HITL and scoped PATs existed. Every new tool capability required updating the hardcoded list or it would silently fail.
Changes
forge/routes/auth/permissions.js: removed 30-line allowlistforge/routes/auth/index.js: deletesession.scopeforuser:expert-mcptokens after validationtest/unit/forge/routes/auth/permissions_spec.js: updated test fixtures and expectations to reflect role-based permissions instead of allowlistRelated Issue(s)
Closes #8066
Test plan