default_permissions and [permissions], or sandbox_mode /
sandbox_workspace_write, but not both. If sandbox_mode appears in any
loaded config file, you pass --sandbox, or the selected config profile sets
sandbox_mode, ZeroCode uses those older sandbox settings instead of
default_permissions.
Managed allowed_permission_profiles is the exception: it makes ZeroCode use
permission profiles. Remove older settings such as
sandbox_mode and [sandbox_workspace_write] before deploying a managed
profile allowlist. For a mixed-version enterprise rollout, you can keep the
managed allowed_sandbox_modes requirement as a temporary compatibility
constraint until every client runs ZeroCode 0.138.0 or later.
Permission profiles let you apply least-privilege boundaries to local commands
ZeroCode runs on your behalf. A profile is a named policy that combines filesystem
rules, which define what commands can read or write, with network rules, which
define which destinations commands can reach.
Use profiles to give ZeroCode enough access for the current chat without granting
broad access to your machine or network. For example, a read-only profile can
let ZeroCode inspect a project without editing it, while a write-capable profile
can limit edits to selected workspace roots.
Local permission profiles are supported on macOS, Linux, WSL, and native
Windows. See Scope and enforcement for platform-specific
details and caveats.
For ZeroCode cloud network settings, see Internet Access.
Define and select a profile
ZeroCode includes three built-in permission profiles::read-onlykeeps local command execution read-only.:workspaceallows writes inside the active workspace roots and system temp directories.:danger-full-accessremoves local sandbox restrictions and should be used only when that broad access is intentional.
[permissions.<name>], then set the top-level
default_permissions key to that profile name or to one of the built-ins above.
In this example, project-edit is a user-defined profile name, not a built-in
value.
Enterprise administrators can define profiles and restrict which profiles
users may select through managed requirements.toml. Once
allowed_permission_profiles is present, omitted profiles are denied,
including omitted built-ins and profiles added in future ZeroCode versions. See
Control available permission profiles
for the recommended managed configuration.
Custom profiles use two related concepts:
[permissions.<name>.workspace_roots]adds concrete directories that should count as workspace roots for that profile.[permissions.<name>.filesystem.":workspace_roots"]defines the filesystem rules ZeroCode applies inside every effective workspace root: the current session’s runtime workspace roots plus the profile-defined roots above.
server is active, both workspace roots participate in the effective
profile.
- Reads the minimal runtime paths common developer tools need.
- Applies the same workspace-root rules to the current session and the profile-defined roots.
- Keeps IDE-adjacent settings such as
.devcontainer/read-only under each root. - Denies matching environment files with a glob rule.
- Allows network access only through the configured domain policy.
.env path to deny.
Extend a profile
Useextends when a profile is mostly the same as a built-in or another named
profile. Prefer extending a built-in profile over starting from scratch so
baseline protections carry forward. Extending :workspace, for example, keeps
the workspace root’s .zerocode directory read-only unless you explicitly
override it. Set the parent once, then add or override only the rules that
differ.
:workspace, keeps matching .env files denied, and
allows requests to api.zerotwo.ai. A profile can extend :read-only,
:workspace, or another named profile. It cannot extend
:danger-full-access; ZeroCode also rejects unknown parents and inheritance
cycles.
Configuration spec
Filesystem permissions
Filesystem entries useread, write, or deny:
More specific entries override broader entries. When two entries target the
same path,
deny takes precedence over write, and write takes precedence
over read.
This precedence lets a profile describe a broad working area first, then carve
out files or directories that should stay unreadable:
.devcontainer/ stays
readable without becoming writable, and matching environment files remain
unavailable to sandboxed commands.
A more specific path can also reopen a narrower subtree inside a broader deny:
On native Windows, home-relative paths can also use backslashes, such as
~\work.
Use :root only when a profile intentionally needs broad read coverage:
:workspace_roots to scope access to workspace-root
relative subpaths:
../other-repo is rejected.
Deny reads with exact paths or globs
Usedeny for files or subtrees that ZeroCode should not read, even when a broader
profile rule grants access nearby. Exact paths work well for stable locations
such as ~/.ssh. Glob patterns work better when a profile needs to cover a
family of sensitive files whose exact locations vary across repositories.
When a glob sits under :workspace_roots, ZeroCode interprets it relative to each
effective workspace root. For example:
.env files found beneath each runtime or
profile-defined workspace root. Use it when you want to preserve normal
workspace writes while keeping environment files, generated secrets, or similar
credential-bearing files unreadable.
deny glob patterns are supported as deny-read rules. read or write globs
are less portable on Linux, WSL, and native Windows sandboxing, so prefer exact
paths or subtree rules such as "docs/**" = "read" when possible.
On Linux, WSL, and native Windows, an unbounded ** deny-read pattern may need
bounded pre-expansion before the sandbox starts. Set glob_scan_max_depth when
you use an unbounded pattern such as "**/*.env" = "deny":
glob_scan_max_depth must be at least 1. Higher values scan deeper before
sandbox startup, which can add startup work on Linux, WSL, and native Windows.
If you prefer not to use bounded expansion, enumerate explicit depths such as
*.env, */*.env, and */*/*.env.
Add reusable workspace roots to the profile when the same rules should apply to
more than the current session root:
:workspace_roots rules to the
current session’s runtime workspace roots and to each enabled profile-defined
workspace root.
On native Windows, drive-letter paths such as D:\work and UNC paths such as
\\server\share are supported as absolute paths.
Network permissions
Setenabled = true to allow network access for the selected profile:
dangerously_* network keys are escape hatches for
specialized environments and should not be used for ordinary local development.
Local and private networks
ZeroCode applies a local/private-network guard by default as a defense against DNS rebinding and accidental access to local services. To intentionally allow a literal local target, allowlist the exact host or IP literal:allow_local_binding = true only when the profile must reach allowlisted
hostnames that resolve to local or private addresses:
Unix sockets
Unix socket proxying is a local escape hatch for tools such as Docker. Use it sparingly:deny to reject a socket path, including an inherited allow entry. Denied
socket paths are omitted from the effective allowlist.
When Unix sockets are enabled, keep proxy listeners bound to loopback addresses.
Migrate from older sandbox settings
Permission profiles replace the older combination ofsandbox_mode and
sandbox_workspace_write when you want one reusable profile to describe both
filesystem and network behavior. Use one system or the other for a session, not
both.
Suggested starting points:
- For a read-only workflow, use the built-in
:read-onlyprofile or define a custom profile with read access only where needed. - For workspace editing, use the built-in
:workspaceprofile or define a custom profile that writes through:workspace_rootsand adds only the extra temp or cache paths the workflow needs. - For unrestricted local execution, use
:danger-full-accessonly when you intentionally want the broadest local access model.
Scope and enforcement
Permission profiles define the boundaries for local sandboxed command execution. Use them together with approval policies and the separate controls for connectors, MCP servers, the built-in browser, Computer Use, and ZeroCode cloud.What profiles control
- Local command execution: Permission profiles govern sandboxed commands that run on your machine. Connectors, MCP servers, browser or computer-use surfaces, ZeroCode cloud environment settings, and approved escalations use their own controls.
- Filesystem writes: A write-capable profile can create persistent changes. Treat writes to scripts, build steps, package manager hooks, shell startup files, and shared directories as sensitive because later tools or users can execute those files outside the original sandbox context.
- Outbound destinations: Network domain rules constrain where sandboxed command traffic can go through the network proxy. They do not determine whether an allowed destination is trustworthy, and wildcard allow rules stay broad.
- Local services: Local and private network targets are blocked by default.
Allowlisting
localhost, private IPs, Unix sockets, or settingallow_local_binding = trueexplicitly opens access to local services.
How enforcement works
- On macOS, ZeroCode uses Seatbelt sandbox profiles. If the selected policy cannot be enforced by the platform sandbox, ZeroCode refuses to run the command instead of silently running it unsandboxed.
- On Linux and WSL, ZeroCode uses bubblewrap and seccomp, with Landlock available for compatibility fallback paths. The strongest enforcement path depends on user namespaces and kernel support; restricted container hosts can force compatibility paths, and unsupported split policies are refused.
- On native Windows,
elevatedsandboxing is strongest because it can use dedicated lower-privilege sandbox users, filesystem permission boundaries, and firewall rules.unelevatedsandboxing is a fallback with weaker network isolation and cannot enforce every split read/write carveout, so unsupported policies are refused. Use WSL when you need the Linux sandbox model.
Operational guidance
Choose the narrowest profile that still lets the task complete, especially when you grant writes or outbound network access. Keep approval policy, secret handling, and allow rules aligned with that access level.Common profiles
Read-only with network allowlist
File access limited to workspace
Here is an example of a permission profile that will make your workspace folders writable by ZeroCode while denying reads to the rest of the filesystem (with limited exceptions, as determined by:minimal).
Workspace write without network
Workspace write with public web access
"*" allow rule only when you intend to allow public network
access. Deny rules can narrow a broad allowlist.