Skip to content

feat(box): choose native file checks for each workload - #113

Merged
kevin-orellana merged 11 commits into
strands-agents:mainfrom
kevin-orellana:keorel/native-filesystem-workload-selection
Oct 16, 2026
Merged

kevin-orellana merged 11 commits into
strands-agents:mainfrom
kevin-orellana:keorel/native-filesystem-workload-selection

Conversation

@kevin-orellana

@kevin-orellana kevin-orellana commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Core #112 is merged. This PR now targets main.
The branch includes the squashed core commit. Its files are identical to the approved revision a906ae2.
The signed test receipt still matches. CI is rerunning, and GitHub requires renewed approval after this update.

The global switch applies the same default to the agent, tools, and local servers.
This PR lets you choose native file checks separately for each one. The feature is available in experimental mode.

View this PR's changes without the core diff.

Add native-filesystem-policy to an existing agent, tool, or local Model Context Protocol (MCP) server table:

[experimental-features]
native-filesystem-policy = true

[agent]
native-filesystem-policy = true

[tool.cargo]
native-filesystem-policy = false

[mcp.files]
native-filesystem-policy = true

This example shows only the new settings. Keep each table's required command and other settings.

Configuration approval

Fernando approved the workload-settings change in his review.
The shared launcher now reads the same workload setting inside the launch function. Setting precedence and saved-record behavior remain unchanged.
The configuration descriptions now list the fifth process field. The top-level key and version 22 belong to #112. Explicit workload overrides require version 23 here.

FAQ

What happens when I omit a setting?

That workload inherits the global setting. Tools and local servers do not inherit the agent's override.
Setting any workload to true requires the global experimental setting to be true.

What remains when I disable native checks for a tool?

Its sandbox restrictions still apply. Box still tracks it for shutdown.
Shell and network policy checks remain active.
Its direct file operations skip Dogwood checks and history recording. Later rules cannot rely on seeing those operations.

Does disabling checks remove all overhead?

No. The operating system can still deliver events, and Box still prepares and tracks the process.
This setting skips native policy checks.

Can a child change its setting by executing another program?

No. Children inherit their parent's setting.
When Box starts a declared tool, it uses that tool's table.
Directly executing a program inside the agent does not select the matching tool table.

Does this apply to remote MCP servers?

No. Box does not launch their processes. Remote server entries reject this setting.

Does disabling checks erase policy history?

No. Existing history remains on disk.
Disabled native operations add no new history, so that period contains a gap.

When do changes apply, and can I downgrade?

Changes apply on the next Box run.
Any explicit workload override, including false, requires stored configuration version 23.
To return to version 21, remove the overrides and set the global feature to false.
Run once with the compatible binary before starting the older binary. Policy history remains intact.

What merges first?

Core #112 is merged. This PR targets main.
Agent tests #114 can merge independently of this PR.

Related Issues

Split from #107.

Type of Change

New feature, available in experimental mode.

Testing

The branch includes current main and its macOS signing metadata. The signed build and receipt were refreshed after that merge.

On October 16, the updated signed build passed 21 native integration tests plus one bridge test target on macOS 27.0.1.
The receipt matches the current production code and relevant test sources.

Commands, results, and remaining limits
  • cargo test --manifest-path test-native-filesystem/Cargo.toml --locked -- --test-threads=1, with STRANDS_BOX_SIGNED_TEST_BINARY set: 22 passed.
  • Independent agent, tool, local-server, and concurrent-child settings passed.
  • Saved configuration transitions 22 → 23 → 21 → 22, with policy history preserved, passed.
  • Configuration tests: 135 passed. Adapter tests: 16 passed.
  • Startup tests: three passed with the feature and three without it. The launch-gate test passed.
  • Receipt freshness and formatting passed. Native test package Clippy passed with all targets, all features, and -D warnings.
  • Changed Box packages passed Clippy with the existing CI allowances.

The full workspace test suite and live model runs were not repeated. Earlier testing found an intermittent catalog-scaling timing failure.
Core's kernel-failure validation limits remain in #117. Linux compilation requires CI.
CI now runs against the staging base. Signed runs remain manual, with source freshness checked in CI.

  • I ran the relevant suites.
  • If I touched Rust, I ran cargo fmt --all and cargo clippy --workspace --all-targets --all-features -- -D warnings

Formatting passed. The exact workspace Clippy command ran and failed on existing warnings, including chunks_exact_to_as_chunks in containment and vendored Shell warnings.
The containment failure also reproduces at base commit bd85785. The flagged Shell source is unchanged from that base.
The checkbox remains unchecked. Changed Box packages pass with the repository CI workflow's existing lint allowances.

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • My changes generate no new warnings under the repository lint configuration

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…acOS

## Problem

Direct filesystem calls inside contained workloads bypass Dogwood policy. Filesystem reach grants cannot apply history-based rules to these calls.

## Solution

This adds global, explicit native filesystem policy selection on macOS. Selected open, create, unlink, rename, and truncate requests use the existing policy engine and durable history. Containment remains a separate restriction.

Enable the Cargo feature `native-filesystem-policy`, then set:

```toml
[experimental-features]
native-filesystem-policy = true
```

The feature requires macOS 27, its SDK, and a signed executable with Apple's Endpoint Security entitlement. Standard release artifacts exclude it. Missing support refuses startup before workload launch or record changes.

The trusted launcher waits until Box registers the workload's process identity. Trusted bootstrap reads stay outside workload policy. Descendants remain tracked across forks and executable changes. Shutdown terminates tracked descendants and bounds callback draining.

Disabled records retain version 21. Enabled records require version 22. Older binaries reject unsupported records. Disable the feature using a compatible build before returning to a version-21 binary.

This is the core part of strands-agents#107. Per-workload selection and real-agent workloads are separate dependent drafts. The unrelated socket shutdown test fix remains outside these three feature changes.

The adapter, trusted launch path, startup refusal, lifecycle cleanup, and signed tests stay together because they establish one enforcement boundary. Splitting these pieces would expose an incomplete safety contract.

Limits remain explicit: already-open descriptors and mapped memory are not checked on every read or write. Kernel denials expose an operating-system error; structured details appear in Box diagnostics. This adds no asynchronous history writes or durability option.

## Tests

Fresh macOS 27 validation passed: 13 signed integration tests, 16 adapter tests, 133 configuration tests, 11 native unit tests, three startup tests, one launcher handshake test, and 11 policy path tests. The receipt verifier's three tests passed.

`trusted_launcher_reads_are_not_workload_requests` fails against the old defective signed binary and passes against this build. `direct_open_truncate_and_grandchild_obey_dogwood` covers direct and descendant denial. `native_history_changes_the_next_decision_without_a_cached_allow` covers history-sensitive decisions.

Formatting and clippy passed for the changed Rust packages and standalone signed test package. Clippy used the repository's established allowances.

The checked-in receipt records this candidate's full signed suite and source hashes. Continuous integration checks receipt freshness; it does not run Apple's signed enforcement tests.

The full workspace suite was not rerun for this split. Earlier strands-agents#107 testing found an intermittent catalog-scaling timing failure. This PR does not claim that the full suite is green. Linux and older macOS runtime tests were not rerun locally.
## Problem

A global native filesystem setting cannot select agent, tool, and local Model Context Protocol (MCP) server workloads independently.

## Solution

This adds optional `native-filesystem-policy` settings to `[agent]`, `[tool.<name>]`, and local `[mcp.<name>]` entries. An absent setting inherits the global default. It does not inherit the agent override. Explicit enablement requires the global experimental gate. Remote MCP entries reject the local-process setting.

Box registers the selected mode before the workload starts. Descendants inherit that mode. Tools use their own table's setting. Disabled workloads retain containment and shutdown tracking. Their native file calls bypass Dogwood evaluation and history recording; Shell and network checks remain active.

Explicit process overrides require record version 23. Configurations without overrides retain the core feature's version 21 or 22 behavior. Remove overrides with a compatible binary before returning to a binary that cannot read version 23.

Depends on the core branch `keorel/native-filesystem-core`. This draft targets `main` under repository rules, so its full diff initially includes the core changes. Review this branch's final commit for selection-only changes. Merge core first, update this branch from main, resolve overlaps, and refresh signed evidence. The agent-workload test draft is independent of this draft.

This is the selection part of strands-agents#107. It adds no history durability option. Disabled native operations leave a history gap, so policies cannot rely on observing them.

## Tests

Fresh macOS 27 validation passed: all 18 signed integration tests, adapter tests, the full `record::config::` filter, native unit tests, startup tests, launcher handshake test, policy path tests, and receipt verifier tests.

`independent_agent_and_tool_modes_survive_concurrent_forks_and_exec` covers mode separation. `local_mcp_selection_is_independent_of_the_agent` covers local servers. The disabled-agent and disabled-tool bootstrap tests cover restrictive startup policies.

`process_policy_overrides_require_the_global_gate_and_a_new_record` pins the configuration and record contract. The trusted-launcher regression also passes with the stronger assertion.

Formatting and clippy passed for changed Rust packages and the standalone signed test package, using repository lint allowances. The signed receipt covers this branch's exact candidate source.

The full workspace suite and live model workloads were not rerun for this split. Earlier strands-agents#107 testing found an intermittent catalog-scaling timing failure. Continuous integration checks manual signed receipt freshness; it does not execute signed native enforcement.
@kevin-orellana kevin-orellana changed the title feat(box): select native filesystem policy per workload feat(box): choose native file checks for each workload Oct 15, 2026
@kevin-orellana

Copy link
Copy Markdown
Collaborator Author

Replaced for review by stacked draft PR #1. Its base is the core branch for #112, so Files changed excludes core changes.

Closing this PR preserves its discussion and test history. The source branch is unchanged. #112 remains open upstream. After core merges, submit this branch upstream for merge.

@kevin-orellana
kevin-orellana marked this pull request as ready for review October 15, 2026 06:29
@github-actions

Copy link
Copy Markdown

Assessment: Request Changes

Technically this is a careful, fail-closed implementation with strong tests and thorough design docs. The blocking concern is governance, not correctness: the PR extends box.toml's interface-frozen surface without naming that change or its approval in the description.

Review themes
  • Frozen interface (blocking): New [experimental-features] top-level key and a new native-filesystem-policy field on [agent]/[tool.<name>]/[mcp.<name>] grow the frozen 8-key / 4-field contract, and they parse on all platforms. AGENTS.md/CONTRIBUTING.md require explicit maintainer approval and a "what breaks" note before such a change. Please confirm approval in the PR body. (inline on record/config/mod.rs)
  • Unexplained pipeline change: Release build drops --all-features; the intent and blast radius aren't stated. (inline on deploy-box-artifact.yml)
  • PR size: ~5.8k changed lines across 39 files (config plumbing + macOS ES C bridge + signed test harness + docs). Well beyond the ~400-line guideline; consider splitting into reviewable units.
  • Minor: version-mismatch error message can name the wrong expected version. (inline)

Design strengths worth keeping: the record version 22/23 bump that stops older binaries resuming without the selected enforcement, the dev/ino re-verification against TOCTOU, and the "unsigned/unavailable build refuses before workload start" behavior are all solid.

@kevin-orellana
kevin-orellana changed the base branch from main to feature/native-filesystem-core October 15, 2026 20:19
@kevin-orellana

Copy link
Copy Markdown
Collaborator Author

Follow-up to the review summary:

Fernando's approval remains in the review history. The current changes merge shared core fixes and use the same workload setting in the new shared launch function. Setting precedence is unchanged. The configuration descriptions now list all five process fields.

The --all-features removal belongs to #112's release workflow. Keep it removed there: standard releases must exclude the experimental native feature. This also excludes test-support; it is not another customer feature. Test and Clippy commands still use --all-features.

The old combined-diff size comment is outdated. This PR targets the synchronized core branch and excludes core's implementation. After #112 merges, update from main and retarget this existing PR before merging it.

The saved-version error text remains unchanged. It can name version 21 even when the binary also supports 22 and 23. Unsupported versions are still rejected. We deferred that minor wording change.

The updated signed build passed 21 native integration tests plus the bridge target. CI now runs for this staging base.

ferdingler
ferdingler previously approved these changes Oct 16, 2026
@kevin-orellana
kevin-orellana changed the base branch from feature/native-filesystem-core to main October 16, 2026 21:05
@kevin-orellana
kevin-orellana dismissed ferdingler’s stale review October 16, 2026 21:05

The base branch was changed.

@kevin-orellana
kevin-orellana enabled auto-merge (squash) October 16, 2026 21:07
@kevin-orellana
kevin-orellana merged commit 069c39c into strands-agents:main Oct 16, 2026
18 of 20 checks passed
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.

3 participants