feat(runtime): expose permission policies to embedders - #468
Open
xenaocx-dev wants to merge 1 commit into
Open
Conversation
Contributor
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: feat(runtime): expose permission policies to embedders This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
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.
Related: #139
Proposal: #467
AI-assisted: yes. The author reviewed the implementation and understands the
runtime call paths changed by this PR.
What Problem This Solves
Applications embedding
acpx/runtimecannot currently configure the existingdeclarative per-tool permission policy through the public runtime contract, so
they cannot reuse its rule matching and decisions.
Why This Change Was Made
This adds an optional
permissionPolicyfield toAcpRuntimeOptionsand threadsit through every runtime-created ACP client, including fresh and resumed
sessions, reconnects, control sessions, shutdown, and probes. Existing callback
precedence and default permission behavior are unchanged.
Path or command-argument rules are deliberately out of scope. This remains a
tool-name policy, not a sandbox or a complete security boundary.
Structured permission-escalation delivery to the embedding host is also out of
scope; the current runtime does not expose that event.
User Impact
Embedding developers can use the existing
PermissionPolicyconfigurationwithout reimplementing policy resolution in a host callback. Existing runtime
users see no behavior change unless they opt into the new field.
Evidence
session resume, turn reconnection, control sessions, backend shutdown, and
runtime probing.
Unreleasedchangelog.git diff --check: passed.pnpm run format:check: passed on 366 files.pnpm run check: passed with the frozen lockfile and declared ACP SDK 1.2.1,including typecheck, type-aware lint, builds, 860/860 main tests, and 109/109
coverage tests.
pnpm run check:docs: passed.gpt-5.6-sol, high reasoning): clean;patch is correctat 0.91 confidence with no accepted/actionable findings.