In short.
This guide explains sandbox settings for developers using the Grok coding agent, with protection disabled by default and child-network restrictions enforced only on Linux. It documents five built-in profiles, configuration through the command line, files and environment variables, and custom profiles with denied paths. The key distinction is that permissions decide whether a tool call runs, while the sandbox constrains an approved call. Broad read access, writable session storage and unrestricted in-process networking require attention when choosing a profile. Enforcement was not tested, and pricing, licensing and release compatibility are unknown.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete page at [https://docs.x.ai/build/features/sandbox.md]: profile boundaries, platform and credential caveats, activation methods, custom profiles and closing permission guidance. Linked Permissions, Enterprise and Settings Reference pages are excluded. No commands or configurations were executed, and actual enforcement, compatibility and performance were not tested.
The overview
Identity
The resource is xAI’s Sandbox documentation for the Grok agent at [https://docs.x.ai/build/features/sandbox.md]. It explains controls over the agent process and its children, covering filesystem access and network access.
Assessment
The guide is useful for comparing documented profile boundaries and finding the settings needed to enable them. Its concrete tables and configuration examples support practical decisions about development, review and untrusted repositories.
The main qualification is that enabling a sandbox does not automatically protect every credential or network route. The page documents several exceptions, but provides no runtime results establishing enforcement in a particular environment.
Users
The documented use cases include developers working in ordinary repositories, cloud devbox users, reviewers auditing code and people opening untrusted repositories. Beginners can use the profile comparison to understand access boundaries; experienced developers get configuration locations, inheritance and path-denial examples.
Capabilities
The off profile leaves filesystem reads, writes and child networking unrestricted. The workspace profile allows reads everywhere and writes in the current working directory, ~/.grok/ and temporary storage, while allowing child networking. The devbox profile allows reads everywhere and writes to top-level directories except /data, also allowing child networking.
The read-only profile allows reads everywhere and writes to ~/.grok/ and temporary storage. The strict profile limits reads to the current working directory and system paths, and allows writes in the working directory, ~/.grok/ and temporary storage. Both specify blocked child networking, subject to the Linux-only enforcement limitation.
Custom profiles can inherit an existing profile, restrict child networking and deny paths or patterns. The supplied example denies /secrets, any .env file at any depth and any .pem file at any depth.
Using it
Requirements
The instructions assume access to the grok command and its configuration files. Linux and macOS enforcement mechanisms are named, but minimum operating-system versions, supported Grok releases and installation steps are not provided.
Linux is required for the documented child-network blocking. Managed settings in requirements.toml can override a command-line profile choice, so the effective configuration may depend on organization-level settings.
Mechanism
The page identifies Landlock on Linux and Seatbelt on macOS as the mechanisms limiting the agent process and its children. Permissions and sandboxing serve different roles: permission controls whether a tool call runs; sandboxing limits what that call can access after approval.
Child-network settings do not block the model API or web tools, which use in-process networking. On macOS, child-network blocking for read-only and strict has no effect.
Setup
Enable the workspace profile with grok --sandbox workspace, set profile = "workspace" under the sandbox section of ~/.grok/config.toml, or use the GROK_SANDBOX environment variable. Sandboxing is off by default.
Define custom profiles in ~/.grok/sandbox.toml or the project’s .grok/sandbox.toml. Select a custom name with --sandbox or the sandbox profile setting. Built-in names cannot be redefined for selection. Full field definitions and configuration precedence are not established by this page.
Example
The documented custom example defines my-profile with extends = "workspace" and restrict_network = true. The deny list covers /secrets plus every .env file and every .pem file in any directory. The corresponding selection command is grok --sandbox my-profile.
This example illustrates combining a built-in profile with additional restrictions. It does not establish comprehensive secret protection, and the child-network restriction remains subject to the platform limitation. The configuration and command were not executed.
Assessment & evidence
Limitations
All built-in profiles except strict allow reads everywhere. Built-ins do not permanently protect credential paths such as ~/.ssh; the page directs readers to custom deny rules. Sandboxed profiles retain writable ~/.grok/ storage so sessions can persist.
The read-only name therefore does not mean zero writes or restricted reading. Child-network blocking is Linux-only, and model API and web-tool networking remain outside that control. No enforcement tests, performance measurements or detailed guarantees about denied-path matching are supplied.
Reasoning
These documented rules imply that profile choice should follow the files and network access a task requires, rather than the profile name alone. For example, read-only can limit project writes while still allowing broad reading and session writes.
For untrusted repositories, the page recommends pairing strict with narrow permission allows, or mentions headless dontAsk. The implications of that headless permission mode are not explained here; this page alone does not establish its suitability for a particular task.
Alternatives
Within the guide, workspace targets normal development, devbox targets cloud development environments, read-only targets code review and auditing, and strict targets untrusted repositories. Custom profiles provide an option when those built-in boundaries need additional restrictions.
No competing sandbox products are described, so comparative security, usability and performance are not assessed.
Evidence
The source is the complete Sandbox documentation page at [https://docs.x.ai/build/features/sandbox.md]. It supports the profile descriptions, activation methods, custom configuration example and stated exceptions.
The captured source has SHA-256 6795d7dde08430ad2db159803a8b5e5763e2530ea423637b871334326de52d06. It is documentation evidence; no implementation inspection or runtime testing establishes the described behavior.
Access & freshness
Costs
The page provides no prices, subscription requirements or usage charges. The cost of using the Grok agent, its model services or managed sandbox features is unknown from this resource.
Rights
No license or redistribution terms are included in the page. Rights to redistribute the documentation or agent implementation, and any commercial-use conditions, are not established here.
Freshness
The source was captured on November 14, 2026, at 19:21:08 UTC. The page supplies no publication date, update date or Grok release identifier. Compatibility with a specific installed version and changes after capture are unknown.
Actions
Match the intended task to the documented read, write and child-network boundaries, then explicitly enable a suitable profile. Account for managed configuration that can override the command-line choice.
Add custom deny rules for sensitive paths where needed, and consult the linked permission and settings documentation before relying on options not explained here. Confirm effective enforcement in the intended environment, especially when child-network blocking matters; that behavior remains unverified.
