Conversation
…2047) Tool policies matched against dynamic (connection-backed) tools use a four-segment id, `integration.owner.connection.tool`, but the public docs and UI describe patterns in the pre-owner three-segment shape `integration.connection.tool`. A pattern written that way is one segment short and can never match anything — silently for `approve`, dangerously for `block`, where the tool keeps running with no warning that the policy never fired. `policiesCreate`/`policiesUpdate` now backfill a mid-pattern `*` for the owner segment via `normalizePolicyPattern`, leaving `*`, `integration.*`, and static-namespace patterns untouched.
cjumeow
force-pushed
the
fix/policy-pattern-owner-segment
branch
from
September 19, 2026 19:11
c0f629e to
eb29c66
Compare
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
Tool policies matched against dynamic (connection-backed) tools are keyed by the full four-segment id
integration.owner.connection.tool, but the publicpolicies.createtool description describes patterns in the pre-owner three-segment shapeintegration.connection.tool. A pattern written in that documented shape is one segment short of the matcher and can never match anything — silently forapprove/require_approval, and dangerously forblock, where the tool keeps running on every call with no indication the policy never fired.policiesCreate/policiesUpdatenow backfill a mid-pattern*for the missing owner segment via a newnormalizePolicyPattern, so a pattern written in the documented shape matches as intended.*,integration.*(already unbounded), and patterns rooted at a static namespace (no owner segment to backfill) are left untouched. Thepolicies.createdescription and a stale comment abovenormalizedPolicyIdare also corrected to describe the real grammar.Linked issue
Fixes #2047
Verification
bun run format:checkbun run lintbun run typecheckbun run test— ran scoped:vitest runonpackages/core/sdk(949/949 passed), including new unit tests fornormalizePolicyPatterninpolicies.test.tsand an integration regression test inexecutor.test.tsthat creates a block policy in the documented pre-owner shape and asserts the tool call is actually blocked.Checklist
bun run changeset).