feat(mcp): add account capability policies#914
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1304bac12c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if newKey != "" { | ||
| newPolicy := accounts[newKey] | ||
| if oldPolicy.AllowWrite != newPolicy.AllowWrite || !slices.Equal(oldPolicy.AllowTools, newPolicy.AllowTools) { |
There was a problem hiding this comment.
Normalize MCP policies before comparing collisions
When subject identity migration finds both old and new account policy keys, this compares the raw AllowTools slices. MCP policies can be equivalent after normalization but encoded differently, such as omitted allow_tools vs ["read"] or ["read,docs.*"] vs ["read", "docs.*"]; in those cases migration is rejected as a collision even though the effective ceiling is identical, which blocks token/account email migration for an otherwise safe config. Normalize both policies before deciding the destination already conflicts.
Useful? React with 👍 / 👎.
|
Codex review: found issues before merge. Reviewed July 11, 2026, 5:03 AM ET / 09:03 UTC. Summary Reproducibility: yes. at the source level: add a new write tool whose service or risk matches a stored broad selector, and the next policy evaluation includes it without any config change. The current registry loop and selector matcher establish this path directly. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Make durable write authorization upgrade-stable by requiring exact write-tool identifiers or a versioned reapproval mechanism, while allowing broad selectors for read-only narrowing if desired. Do we have a high-confidence way to reproduce the issue? Yes at the source level: add a new write tool whose service or risk matches a stored broad selector, and the next policy evaluation includes it without any config change. The current registry loop and selector matcher establish this path directly. Is this the best way to solve the issue? No, not yet: the single fail-closed resolver and account pinning are sound foundations, but a durable authorization ceiling should not silently grow after upgrades unless maintainers explicitly choose and document that behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f69b2f87a33d. Label changesLabel changes:
Label justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
Summary
Closes #913.
Proof
make cigovulncheck ./...— zero callable vulnerabilitiesactionlintgmail_search: typed read result with exit code 0Notes