Skip to content

feat(tools): centralize execution policy - #46

Merged
kacigaya merged 2 commits into
mainfrom
feat/execution-policy
Nov 5, 2026
Merged

kacigaya merged 2 commits into
mainfrom
feat/execution-policy

Conversation

@kacigaya

@kacigaya kacigaya commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Tool approval and audit scope checks used separate paths. JSON fallback calls also skipped shared schema validation. One execution policy now returns allow, deny, or require approval for every tool call.

The policy resolves targets and rejects invalid arguments, conflicting aliases, workspace escapes, and audit scope violations before approval. Approval covers a private snapshot of the arguments and targets. The runtime checks them again before dispatch. A deny decision cannot be overridden.

Sensitive diffs now require approval because they can expose file contents. Text reads use the existing capability-based file helper to reject replacement symlinks. Patch checks cover every source and destination. README, command docs, and help describe the behavior.

Shell commands still require approval and run without an OS sandbox. The policy checks their working directory. It does not restrict paths or network targets inside command text. No dependencies were added.

Validation passed:

  • Format check, strict Clippy for all targets, 204 Rust tests, and release build.
  • Website audit, lint, type check, tests, and production build with Bun 1.4.4.
  • All 10 bundled security script tests.
  • Live TUI checks with a local mock provider: approval, denial, audit scope, patch escapes, changed targets, Esc cancellation, process cleanup, and shutdown.
  • Local diff and security review. Cargo audit found zero vulnerabilities, with three existing unmaintained-package notices and two yanked-package warnings.

OSV checked all 388 resolved Rust packages. It returned existing maintenance notices for zbus_names 4.3.4, zvariant 5.15.0, and zvariant_derive 5.15.0. These records provide no severity, CVE alias, or fixed version. Dependency updates remain outside this PR.

Local checks ran on Linux. CI will check macOS and Windows. Real cloud providers were not called.

Reject invalid or out-of-scope calls before approval. Bind grants to
reviewed arguments and resolved targets, then recheck before dispatch.

Require approval for sensitive diffs and reject replacement symlinks
during file reads.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Use one canonical workspace path for runtime and audit requests. This tests audit scope rejection on macOS and Windows instead of an earlier workspace prefix rejection.
@kacigaya kacigaya added the enhancement New feature or request label Nov 5, 2026
@kacigaya
kacigaya merged commit e17e987 into main Nov 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants