Skip to content

fix(tool-sandbox): skip missing fs_write_file grants instead of denying - #1452

Merged
lukehinds merged 1 commit into
nolabs-ai:mainfrom
kipz:kipz/tool-sandbox-fs-write-file-missing
Jul 24, 2026
Merged

fix(tool-sandbox): skip missing fs_write_file grants instead of denying#1452
lukehinds merged 1 commit into
nolabs-ai:mainfrom
kipz:kipz/tool-sandbox-fs-write-file-missing

Conversation

@kipz

@kipz kipz commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Linked Issue

Closes #1450

Summary

A per-command fs_write_file grant for a missing path denied the whole
sandboxed command, unlike the sibling fs_read/fs_write/fs_read_file
grants which already skip missing paths. Adds a shared
add_optional_write_file helper (in tool-sandbox/mod.rs, alongside the
existing agent_can_write/lexically_normalize shared helpers) matching
that existing pattern, called from both the macOS and Linux platform
implementations instead of each defining its own copy.

Agent Disclosure

Authored by an AI coding agent on behalf of @kipz. Consulted
tool-sandbox/platform/{macos,linux}.rs (add_policy_fs and its
add_optional_* siblings) and capability.rs/capability_ext.rs to
confirm this path lacks the missing-file tolerance the top-level session
sandbox already has. Disclosed on the linked issue before opening this PR.

Test Plan

  • make ci — clean.
  • Added add_optional_write_file_tests (missing path is skipped, existing
    path is granted) — both pass.
  • Rebuilt a downstream consumer against this branch and re-ran the issue's
    repro: denial is gone, command proceeds past sandbox construction.

Checklist

  • An issue exists and is linked above
  • All commits are signed-off, using DCO
  • All new code follows the project's coding standards (CLAUDE.md) and is covered by tests
  • Public-facing changes are paired with documentation updates
  • Release note has been added to CHANGELOG.md if needed

Agent Compliance Check (Required for AI/Automated PRs)

  • I am not prohibited from contributing under this policy
  • An issue already exists
  • I disclosed that I am an agent in the issue discussion
  • I described my intent and approach in the issue discussion
  • I reviewed repository coding and security rules for the affected area
  • I provided required attribution for reused or adapted code
  • I did not use forbidden patterns such as unwrap/expect
  • I used NonoError where required
  • I validated and canonicalized all relevant paths
  • This PR matches the approved or disclosed issue scope

@github-actions github-actions Bot added bug Something isn't working nono-cli size/small labels Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

PR Review Summary

Size

Metric Value
Lines added +50
Lines removed -2
Total changed 52
Classification Medium (50–300 lines)

Affected crates

  • crates/nono-cli — CLI changes. Verify argument parsing, flag documentation, and UX behaviour across supported platforms.

Blast radius — Contained

This PR touches: source code


Updated automatically on each push to this PR.

@kipz
kipz force-pushed the kipz/tool-sandbox-fs-write-file-missing branch from 4db7096 to 4c32bb7 Compare July 20, 2026 10:56
@kipz
kipz marked this pull request as ready for review July 20, 2026 10:59

@nogent-nolabs-ai nogent-nolabs-ai Bot 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.

nogent code review

No blocking issues; 0 suggestions.

Findings: none flagged in scope.

Automated code + security review. CI already covers clippy, rustfmt, tests, cargo-audit and commit-lint.

kipz added a commit to kipz/nono that referenced this pull request Jul 20, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 20, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 20, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 20, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 21, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 21, 2026
@kipz
kipz force-pushed the kipz/tool-sandbox-fs-write-file-missing branch from 4c32bb7 to d02dad9 Compare July 21, 2026 17:12
kipz added a commit to kipz/nono that referenced this pull request Jul 21, 2026
kipz added a commit to kipz/nono that referenced this pull request Jul 23, 2026
@lukehinds

Copy link
Copy Markdown
Contributor

all good thanks @kipz !

@lukehinds
lukehinds merged commit 697be78 into nolabs-ai:main Jul 24, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working nono-cli size/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tool-sandbox): per-command fs_write_file denies whole command on missing path

2 participants