Skip to content

core: correct sandboxed shell tool description (reads allowed anywhere) - #3069

Merged
nornagon-openai merged 1 commit into
mainfrom
nornagon/sandbox-descriptions
Sep 3, 2025
Merged

nornagon-openai merged 1 commit into
mainfrom
nornagon/sandbox-descriptions

Conversation

@nornagon-openai

Copy link
Copy Markdown
Contributor

Correct the shell tool description for sandboxed runs and add targeted tests.

  • Fix the WorkspaceWrite description to clearly state that writes outside the writable roots require escalated permissions; reads are not restricted. The previous wording/formatting could be read as restricting reads outside the workspace.
  • Render the writable roots list on its own lines under a newline after "writable roots:" for clarity.
  • Show the "Commands that require network access" note only in WorkspaceWrite when network is disabled.
  • Add focused tests that call create_shell_tool_for_sandbox directly and assert the exact description text for WorkspaceWrite, ReadOnly, and DangerFullAccess.
  • Update AGENTS.md to note that just fmt can be run automatically without asking.

- Add focused tests for create_shell_tool_for_sandbox covering WorkspaceWrite/ReadOnly/DangerFullAccess with exact description assertions.
- Refactor tests to call create_shell_tool_for_sandbox directly.
- Remove parameter schema assertions in these tests.
- Update AGENTS.md to state that just fmt may be run automatically without asking.
@nornagon-openai nornagon-openai changed the title core: correct sandboxed shell tool description (writes restricted, reads allowed) + tests core: correct sandboxed shell tool description (reads allowed anywhere) Sep 2, 2025
- Writing files outside the current directory, and protected folders like .git or .env{}
- Writing files other than those in the writable roots
- writable roots:
{}{}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If this list updates mid-conversation, it will impact prompt caching. I believe that this list is currently static, so we should be okay right now, but what do you think of instead adding it to EnvironmentContext?

And if we are making this static, it could be worth moving to an md file and using include_str!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i decided to keep this change minimal, but I can follow up by moving it to EnvironmentContext. (that was actually my first attempt at this change but I cut it down.)

@dylan-hurd-oai dylan-hurd-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm okay with this as a net improvement, but would like to follow this up by moving this to EnvironmentContext, since we're now trying to simplify tool definitions!

@nornagon-openai
nornagon-openai merged commit 97000c6 into main Sep 3, 2025
@nornagon-openai
nornagon-openai deleted the nornagon/sandbox-descriptions branch September 3, 2025 17:02
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants