Skip to content

Commit 96148c0

Browse files
authored
feat(sandbox): add network isolation configuration option (#18)
* feat(sandbox): add network isolation configuration option * docs: update changelog
1 parent b6cf364 commit 96148c0

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ All notable changes to agent-stuff are documented here.
3232

3333

3434

35-
## refactor/delegate-filesystem-enforcement
35+
36+
37+
## feat/network-isolation-config
38+
39+
Added configurable network isolation controls to the sandbox extension (#18), enabling users to selectively weaken network restrictions for compatibility with Go-based CLI tools (gh, docker, etc.) that require macOS trust daemon access for TLS certificate verification. The new `enableWeakerNetworkIsolation` option is exposed in the `SandboxConfig` interface with a default value of `true` to support these commonly-used tools out-of-the-box, while still allowing stricter isolation configurations when needed. Configuration merging logic has been updated to properly handle the new isolation setting alongside existing sandbox policies.
40+
41+
## [1.0.6](https://github.com/kostyay/agent-stuff/pull/17) - 2026-03-03
3642

3743
This refactor consolidates filesystem enforcement into a dedicated event-driven architecture (#17). The plan-ask extension now delegates read-only command filtering to the sandbox extension via a shared `readonly` event on `pi.events`, eliminating ~100 lines of duplicated destructive-command pattern matching and reducing the plan-ask module's responsibility to tool restrictions and system prompts only. The sandbox extension listens for readonly state changes and dynamically reconfigures its filesystem allowlist, with an acknowledgment mechanism that warns users if the sandbox extension isn't loaded. Additionally, the status bar now displays sandbox state on a dedicated line 3, surfacing sandbox and readonly modes to users in real-time.
3844

pi-extensions/sandbox/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ interface SandboxConfig extends SandboxRuntimeConfig {
5454
enabled?: boolean;
5555
ignoreViolations?: Record<string, string[]>;
5656
enableWeakerNestedSandbox?: boolean;
57+
enableWeakerNetworkIsolation?: boolean;
5758
}
5859

5960
const DEFAULT_CONFIG: SandboxConfig = {
6061
enabled: true,
62+
// Required for Go-based CLIs (gh, docker, etc.) that use the macOS
63+
// trust daemon for TLS certificate verification.
64+
enableWeakerNetworkIsolation: true,
6165
network: {
6266
allowedDomains: [
6367
"npmjs.org",
@@ -94,6 +98,8 @@ function mergeConfig(base: SandboxConfig, overrides: Partial<SandboxConfig>): Sa
9498
if (overrides.enabled !== undefined) result.enabled = overrides.enabled;
9599
if (overrides.enableWeakerNestedSandbox !== undefined)
96100
result.enableWeakerNestedSandbox = overrides.enableWeakerNestedSandbox;
101+
if (overrides.enableWeakerNetworkIsolation !== undefined)
102+
result.enableWeakerNetworkIsolation = overrides.enableWeakerNetworkIsolation;
97103

98104
if (overrides.network) {
99105
result.network = {
@@ -303,6 +309,7 @@ export default function sandboxExtension(pi: ExtensionAPI) {
303309
filesystem: config.filesystem,
304310
ignoreViolations: config.ignoreViolations,
305311
enableWeakerNestedSandbox: config.enableWeakerNestedSandbox,
312+
enableWeakerNetworkIsolation: config.enableWeakerNetworkIsolation,
306313
});
307314
sandboxActive = true;
308315
updateStatus(ctx, config, true);

0 commit comments

Comments
 (0)