Skip to content

Fix broad toolkit approve policies being dropped as legacy connection records - #1550

Open
sethcarlton wants to merge 3 commits into
UsefulSoftwareCo:mainfrom
sethcarlton:fix/toolkit-broad-approve-policy
Open

Fix broad toolkit approve policies being dropped as legacy connection records#1550
sethcarlton wants to merge 3 commits into
UsefulSoftwareCo:mainfrom
sethcarlton:fix/toolkit-broad-approve-policy

Conversation

@sethcarlton

Copy link
Copy Markdown
Contributor

Problem

Write tools in toolkits can prompt for approval even when they are set to “Always run.” This occurs when a broad approve policy covers a narrower connection or tool ID:

Policy:     google_docs.org.*        approve
Connection: google_docs.org.<name>.*

Although the UI shows “Always run,” the server-side resolver mistakes the policy for a legacy connection row because it does not exactly match the saved connection pattern. The resolver drops the policy and uses the plugin default, require_approval.

Fix

Treat a policy as a legacy connection row only when its pattern covers no saved connection. This keeps broad approve policies active when they cover narrower connections or tool IDs.

Testing

  • Added a regression test in packages/plugins/toolkits/src/server.test.ts.
  • Added and ran the e2e scenario “Toolkits · a broad approve policy applies over a narrower connection grant.”
  • format:check, lint, typecheck, and test pass.

A broad approve rule was mistaken for a legacy connection record when it covered a narrower persisted connection. Runtime then prompted for destructive tools even though the toolkit UI showed Always run.

Keep matching broad policies active and cover both dynamic invocation and the toolkit MCP surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant