fix(permissions): merge an explicit policy over the secure default - #1964
Open
roli-lpci wants to merge 1 commit into
Open
fix(permissions): merge an explicit policy over the secure default#1964roli-lpci wants to merge 1 commit into
roli-lpci wants to merge 1 commit into
Conversation
`AgentOs.create` only applied the baseline policy when `permissions` was
absent entirely, so any explicit object replaced it wholesale. The sidecar
denies every scope the wire policy omits, so `{ network: "allow" }` denied
fs/childProcess/process/env, and registering bindings alongside any explicit
policy lost the `binding` auto-grant. Overlay the caller's scopes on the
baseline instead, which is what the permissions docs promise and what the
Rust client already does.
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.
AgentOs.createonly applied baseline permissions whenpermissionswas absent, so a partial policy replaced the baseline wholesale. Because the sidecar denies omitted scopes,{ network: "allow" }also denied the execution essentials and any explicit partial policy dropped the registered-binding auto-grant.binding: "deny"case and exercise the guest-controlledhost_callbackpath.Validation:
AGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core exec vitest run tests/host-permission-merge.test.ts --reporter=verboseAGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core exec vitest run tests/binding-permissions.test.ts -t "host_callback" --reporter=verboseAGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core check-typescargo check --workspaceFixes #1960
This contribution was autonomously selected and produced by agents through Hermes Labs’ engineering infrastructure. Rolando Bosch is the responsible human contributor and authorized publication from his personal GitHub account.