Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 6, 2026

When the sandbox is enabled (either explicitly via sandbox.agent or auto-enabled via network restrictions), agents now automatically receive file editing and bash command capabilities without explicit tool configuration.

Changes

Modified applyDefaultTools() signature

  • Added SandboxConfig and NetworkPermissions parameters to detect when sandbox is active
  • Added isSandboxEnabled() helper to check sandbox state (explicit config or auto-enablement)

Default tool injection
When the sandbox is enabled:

  • tools.edit: true - enables file editing
  • tools.bash: ["*"] - enables all bash commands

The sandbox is considered enabled when:

  • sandbox.agent is explicitly set (awf/srt)
  • Firewall is auto-enabled due to network restrictions
  • Legacy sandbox.type: srt is configured

Explicit tool configuration overrides these defaults.

Example

Before:

network:
  allowed:
    - github.com
tools:
  edit: true
  bash: ["*"]

After:

network:
  allowed:
    - github.com
# edit and bash tools automatically available (firewall auto-enabled)

Or with explicit sandbox:

sandbox:
  agent: awf
# edit and bash tools automatically available

Behavior Matrix

Configuration edit tool bash tool
sandbox.agent: awf ✓ added ✓ added
sandbox.agent: srt ✓ added ✓ added
Network restrictions (auto-firewall) ✓ added ✓ added
sandbox.agent: false ✗ not added ✗ not added
No sandbox and no network ✗ not added ✗ not added
Explicit tools: User config takes precedence User config takes precedence
Original prompt

Enable editing and bash * by default when the sandbox.agent is enabled

tools.edit: true
tools.bash: ["*"]


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

- Modified applyDefaultTools to accept SandboxConfig parameter
- Added isSandboxAgentEnabled helper function to check if agent is enabled
- When sandbox.agent is enabled (awf/srt), automatically add:
  - tools.edit: true (enables file editing)
  - tools.bash: ["*"] (enables all bash commands)
- Updated all test call sites to pass SandboxConfig parameter
- Added comprehensive tests for the new functionality

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable editing and bash by default in sandbox.agent Enable edit and bash tools by default when sandbox.agent is configured Jan 6, 2026
Copilot AI requested a review from pelikhan January 6, 2026 03:38
@pelikhan
Copy link
Contributor

pelikhan commented Jan 6, 2026

@copilot the sandbox does not need to be specified as long as it is enabled

…ndbox.agent

Per feedback from @pelikhan, the sandbox does not need to be explicitly
specified as long as it is enabled. Updated logic to check if sandbox is
enabled (either explicitly via sandbox.agent or auto-enabled via firewall)
rather than only checking for explicit sandbox.agent configuration.

Changes:
- Renamed isSandboxAgentEnabled() to isSandboxEnabled()
- Added NetworkPermissions parameter to applyDefaultTools()
- isSandboxEnabled() now checks:
  1. Explicit sandbox.agent configuration (awf/srt)
  2. Auto-enabled firewall (networkPermissions.Firewall.Enabled)
  3. Legacy SRT configuration
- Updated all test call sites
- Added test case for auto-enabled firewall scenario
- Updated unit tests to cover all scenarios

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 6, 2026

@copilot the sandbox does not need to be specified as long as it is enabled

Fixed in 8085b5c. The logic now enables edit and bash tools whenever the sandbox is enabled, including when the firewall is auto-enabled via network restrictions (not just when sandbox.agent is explicitly configured).

Copilot AI changed the title Enable edit and bash tools by default when sandbox.agent is configured Enable edit and bash tools by default when sandbox is enabled Jan 6, 2026
@pelikhan pelikhan marked this pull request as ready for review January 6, 2026 05:21
@pelikhan pelikhan merged commit 11e56a7 into main Jan 6, 2026
129 of 130 checks passed
@pelikhan pelikhan deleted the copilot/enable-editing-and-bash-defaults branch January 6, 2026 05:39
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.

2 participants