Skip to content

fix(permissions): merge an explicit policy over the secure default - #1964

Open
roli-lpci wants to merge 1 commit into
rivet-dev:mainfrom
roli-lpci:fix/permissions-merge-partial-policy
Open

fix(permissions): merge an explicit policy over the secure default#1964
roli-lpci wants to merge 1 commit into
rivet-dev:mainfrom
roli-lpci:fix/permissions-merge-partial-policy

Conversation

@roli-lpci

@roli-lpci roli-lpci commented Sep 7, 2026

Copy link
Copy Markdown
  • AgentOs.create only applied baseline permissions when permissions was 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.
  • Merge caller-provided scopes over the TypeScript client's existing baseline, preserving explicit overrides. This matches the documented merge semantics and the Rust client's behavior.
  • Add fast unit coverage for partial policies, the binding auto-grant, and explicit deny/rule overrides. Update binding-permission coverage to preserve an explicit binding: "deny" case and exercise the guest-controlled host_callback path.

Validation:

  • AGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core exec vitest run tests/host-permission-merge.test.ts --reporter=verbose
  • AGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core exec vitest run tests/binding-permissions.test.ts -t "host_callback" --reporter=verbose
  • AGENTOS_SKIP_NATIVE_META_BUILD=1 pnpm --dir packages/core check-types
  • cargo check --workspace

Fixes #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.

`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.
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.

Explicit permissions object replaces the secure default instead of merging over it (drops binding auto-grant)

1 participant