A terminal coding agent built to be bounded rather than trusted: six permission modes where deny rules survive even always-approve, a kernel-enforced sandbox, and a plan mode that is genuinely read-only in every mode. Guide cards explain the mechanisms; the index below is a searchable dictionary of every command, flag, slash command, config key and TOML field.
A terminal coding agent: reads and edits files, runs shell commands, searches the codebase, plans work, applies changes after you approve. What distinguishes it is how much is built to be bounded rather than trusted.
| Mechanism | What it guarantees |
|---|---|
| Six permission modes | Deny rules, hooks and some shell rules survive even always-approve |
| Kernel sandbox, 5 profiles | Landlock / Seatbelt — enforced by the OS, not the agent |
| Plan mode | Read-only except the plan file, in every mode |
| Roles & personas (TOML) | Capability modes: a reviewer that must not write cannot |
Open source — xai-org/grok-build, Rust, split into a shell (agent backend) and a pager (TUI). When the docs are ambiguous you can read the implementation.
Access with SuperGrok / X Premium+, or the Code API. Two components you will see named in logs and settings: the shell and the pager.
The 30-second orientation: install, grok inspect to see what config it found, then a real task in /plan mode — and read the plan before approving.
npm is an alternative path. Authenticate with a SuperGrok / X Premium+ subscription, or set XAI_API_KEY from console.x.ai.
Run grok inspect first, every time. It lists discovered config sources, instructions, skills, plugins, hooks and MCP endpoints — the only question that matters at the start is whether it found your conventions.
xai-org/grok-build, in Rust: a shell (agent backend) and a pager (TUI frontend). When the docs are ambiguous you can read the implementation — not true of its competitors.
| Mode | Runs without asking |
|---|---|
default (ask) | Read-only tools and built-in read-only shell |
acceptEdits | File edits |
auto | What the safety check allows; rest blocked or escalated |
dontAsk | Only pre-approved tools |
bypassPermissions | Tool calls in general — "always-approve" |
plan | Claude-compat alias; use real plan mode |
Cycle with Shift+Tab or Ctrl+O. Set via /always-approve, /auto, /settings, --permission-mode, or [ui] permission_mode. CLI overrides config.
Even in always-approve, deny rules, hooks and some shell ask rules still apply. The escape hatch is deliberately not total — you can hand over the keys and keep a lock on the drinks cabinet.
Admins can lock the mode off. Enable per-command allowlists with [ui] remember_tool_approvals.
OS kernel primitives — Landlock on Linux, Seatbelt on macOS — enforced for the process lifetime, not by the agent's good intentions. Off by default.
| Profile | Writes | Child net |
|---|---|---|
off | everywhere | allowed |
workspace | CWD, ~/.grok/, temp | allowed |
devbox | all top-level except /data | allowed |
read-only | ~/.grok/, temp | blocked¹ |
strict | CWD, ~/.grok/, temp | blocked¹ |
¹ Child-network blocking is Linux-only (seccomp). On macOS it is a no-op — a macOS read-only profile does not stop a child process phoning home. Know this before relying on it.
| Platform | Mechanism | Minimum |
|---|---|---|
| Linux | Landlock | Kernel 5.13+ |
| macOS | Seatbelt | all versions |
| Windows | none | — |
No kernel sandbox on native Windows, and the failure is quiet — an unapplied profile "logs a warning and continues without enforcement." For the sandbox on Windows, run under WSL. A failed custom profile is the exception: Grok refuses to start rather than expose denied paths.
Custom profiles take a deny list with globs — **/*.pem, **/.env — kernel-enforced for read and write alike.
Sandbox first, then loosen approvals. grok --sandbox workspace --permission-mode auto is the combination worth adopting. Approvals off without a sandbox is just removing the brakes.
Read-only except the plan file. plan.md edits auto-approve; edits to any other file are rejected outright, the call failing with the plan file named as the only writable path. This holds in every permission mode, including always-approve.
The agent can enter it itself via enter_plan_mode (needs your approval) and leaves via exit_plan_mode. The plan is written to ~/.grok/sessions/<cwd>/<session-id>/plan.md.
Context (why the change) · the recommended approach, not every alternative · paths of critical files · existing functions to reuse, with paths · a verification section describing how to test end to end.
Planning a task that did not need planning is pure latency.
Declarative rather than prose: define roles and personas as TOML and reuse them.
| Capability | Read | Write | Exec |
|---|---|---|---|
read-only | ✓ | ||
read-write | ✓ | ✓ | |
execute | ✓ | ✓ | |
all | ✓ | ✓ | ✓ |
A reviewer role at read-only cannot edit code — structural, not an instruction it might drift from. Personas (.grok/personas/*.toml) overlay tone and focus without changing the agent type or its tools, so they can never widen permissions.
Nesting is one level. A subagent calling spawn_subagent fails with a depth-limit error — fan out from the parent, do not build trees. Subagents inherit the parent's MCP servers by default; narrow with mcpInheritance: all | none | named | except.
Use isolation: worktree whenever more than one child will write.
Folders of markdown plus scripts. From ./.grok/skills/ (to repo root), ~/.grok/skills/, plugin skills/, and [skills] paths.
| Frontmatter | Does |
|---|---|
description | The matcher — what it does and when |
when-to-use | Extra trigger phrases |
paths | Gitignore patterns gating visibility |
allowed-tools | Tools it may use |
user-invocable | Appears as /name. Default true |
disable-model-invocation | You invoke it; the model cannot |
Bundle skills, agents, hooks, MCP servers and LSP servers — real language intelligence, not just prompts. From ./.grok/plugins/, ~/.grok/plugins/, ~/.grok/plugins/marketplaces/, --plugin-dir. Sources via [[marketplace.sources]].
TUI modals: /plugins · /skills · /hooks · /mcps.
Project hooks require /hooks-trust — a hook in a repo you cloned is arbitrary code execution. Plugin hooks get GROK_PLUGIN_ROOT and GROK_PLUGIN_DATA. Hooks are the only deterministic layer: instructions are advice, a hook is a rule.
Auto-compaction at 85% of the window; tune with [session] auto_compact_threshold_percent.
/context itemises the fixed overhead — tool definitions, the skills listing, MCP announcements. That is the honest answer to "why does a fresh session already feel full?" If you installed a lot of plugins, that is where the window went.
Experimental, off by default. GROK_MEMORY=1 or [memory] enabled; /memory on|off is session-scoped. Markdown under ~/.grok/memory/, SQLite-indexed.
Workspace identity is the origin remote (org/repo), else the directory path — so clones and worktrees of one repo share a memory directory.
For CI the documented recommendation is always-approve plus deny rules or hooks — not because it is safe, but because there is nobody to approve, so guarantees must be structural. Pair with --sandbox and --disallowed-tools.
Drive it as a server to build your own tooling on top — and read the source when you need to.
| Model | Ctx | In $/Mtok | Out $/Mtok |
|---|---|---|---|
| Grok 4.6 | 500k | 2.00 / 4.00 | 6.00 / 12.00 |
| Grok 4.3 / 4.20 | 1M | 1.25 / 2.50 | 2.50 / 5.00 |
| Grok Build 0.1 | 256k | 1.00 / 2.00 | 2.00 / 4.00 |
A request whose prompt reaches 200k tokens is billed at the higher rate for every token in it — not just those past the threshold. A cliff, not a ramp: a 210k prompt costs roughly double a 190k one.
/compact before you cross it. Auto-compaction at 85% of 500k fires at 425k — long past the cliff./context — plugin overhead gets you to 200k sooner than you think.[models] default deliberately.Alongside its own .grok/ directories, Grok discovers and honours the instruction files and extensions other agents use — so a repository that already carries agent config needs no porting before the first useful session.
| It finds | Where |
|---|---|
AGENTS.md | Repo root — the cross-vendor standard |
CLAUDE.md, Claude.md, CLAUDE.local.md | Always recognised at top level |
.claude/CLAUDE*.md | Scanned root-down through directories |
~/.claude/ | User-level Claude config |
.claude/settings.json | Including defaultMode |
~/.cursor/, <dir>/.cursor/ | Cursor rules too |
| Marketplaces, plugins, skills, MCP servers, agents | Claude Code's, alongside .grok/ |
xAI's announcement puts it plainly: “Your AGENTS.md, plugins, hooks, skills, and MCP servers all work out of the box.”
The durable point: the instruction layer is becoming portable. An AGENTS.md stating your build commands, boundaries and conventions is read by every current agent worth using — time spent writing it is not a bet on a vendor.
That is the whole thing. Because it reads your existing config, there is nothing to port first.
Far fewer prompts than default, with the kernel still bounding the damage.
read-only role cannot write; a polite request can be drifted from.The machinery operates on context. A plain-text work wiki and CLI access to your data matter more than any of the above — and neither is vendor-specific.
A large share of the public — in most 2025–26 polling, a plurality to a majority — says it is more worried than excited about AI. You use xAI's tools all day; it is worth being able to state the other side's case accurately, and then say why you are on this side of it anyway.
Grok specifically. xAI draws two objections the others do not. The Memphis Colossus site ran dozens of gas turbines before its air permits were settled, in a neighbourhood that already carried a disproportionate pollution load — the data-center fight in its sharpest form. And the model's deliberately looser guardrails have produced public incidents (antisemitic output in July 2025, the "MechaHitler" episode, image-generation abuse) that the safety-first labs point to as the case for guardrails. Being the model that refuses least is the selling point and the liability at once.
The short version for the dinner table: the concerns are mostly legitimate and mostly about who pays; the benefits are larger, broader and already measurable; and the one thing in your control is to be a user whose output earns the tool its trust.