Skip to content

(MOT-4220) feat(harness): default dispatch to deny-only policy - #594

Draft
ytallo wants to merge 2 commits into
mainfrom
feat/harness-default-functions
Draft

(MOT-4220) feat(harness): default dispatch to deny-only policy#594
ytallo wants to merge 2 commits into
mainfrom
feat/harness-default-functions

Conversation

@ytallo

@ytallo ytallo commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make allow optional: a present function policy permits every function not matched by deny
  • ship default_functions as { "deny": [] }, so new sends and parentless workers receive full function access unless an operator narrows it
  • preserve legacy explicit allow scopes, deny precedence, frozen turn inheritance, reaction inheritance, and child non-escalation
  • execute structurally allowed calls immediately when no approval gate is installed; approval hooks still hold or deny calls when present
  • fail closed for missing persisted authority, explicit allow: [], unknown policy fields, empty globs, and malformed globs
  • add pinned-engine E2E scenarios, a cross-worker compatibility matrix, QA test cases, and CI coverage for approval-gate changes

Behavior and compatibility

Without an approval gate, the harness now behaves as YOLO by default. Explicit deny globs remain the primary restriction. Existing callers that send allow keep their positive-scope behavior, and default_functions: null still restores deny-all for new turns.

Ask mode continues to cap requests at the configured default policy; because the shipped default is permissive, operators that want a read-only or deny-all ask mode must configure that ceiling explicitly.

Validation

  • cargo test --manifest-path harness/Cargo.toml --all-features
  • cargo test --manifest-path harness/Cargo.toml -p harness-integration
  • pinned-engine E2E-005, E2E-010, and E2E-011
  • pinned-engine harness/approval-gate integration: 8 passed
  • cargo test --manifest-path approval-gate/Cargo.toml --all-features
  • cargo clippy with -D warnings for harness and approval-gate
  • GitHub script tests: 131 passed

Fixes MOT-4220

@vercel

vercel Bot commented Jul 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview Jul 31, 2026 1:21am
workers-tech-spec Ready Ready Preview Jul 31, 2026 1:21am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a8d26642-087e-422b-962c-400a7c71b08a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/harness-default-functions

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 50 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

Make `allow` optional: a present function policy permits every function not
matched by `deny`. Ship `default_functions` as `{ "deny": [] }`, so new sends
and parentless workers receive full function access unless an operator narrows
it.

Preserve legacy explicit `allow` scopes, deny precedence, frozen turn
inheritance, reaction inheritance, and child non-escalation. Execute
structurally allowed calls immediately when no approval gate is installed;
approval hooks still hold or deny calls when present. Fail closed for missing
persisted authority, explicit `allow: []`, unknown policy fields, empty globs,
and malformed globs.

Add the INT-010 / INT-011 integration fixtures, a cross-worker compatibility
matrix in the approval-gate suite, and CI coverage for approval-gate changes.

`FunctionPolicy::default()` flips from deny-all to permissive, so eval's
`normalize()` now builds an explicit empty allow-list to keep its documented
"omitted means deny all" contract.

Fixes MOT-4220
Extract the native arm of `build_tools` into a pure `native_tools(policy,
registry)` so the dispatch policy's effect on the MODEL-FACING tool list is
testable without a live `Deps`. Behavior is unchanged: same order (intercepted
subscription controls first, then registry order), same allocations. The
empty-surface `tracing::warn!` stays in `build_tools`, which owns the
`session_id` it interpolates.

Five tests pin what was previously untested: a denied id is absent from the
surface rather than merely uncallable; a legacy allow-list narrows the controls
too, so a narrow child cannot pick up `engine::register_trigger`; an explicit
empty allow-list and a missing policy both expose nothing; controls lead and
never duplicate a registry id; and an unhydrated descriptor still ships a usable
object schema.
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.

1 participant