Permissions & Safety

Three safety layers, in plain English: how often Grok asks, allow/deny rules, and the OS sandbox.

You have seen a permission popup at least once
Big idea

Permission mode, allow/deny rules, and the OS sandbox are three different layers. Mix them up and you get either false safety or constant popups. Learn them as a stack.

Three layers of protection—mode, rules, sandbox.

Three safety layers (memorize this)

1

Permission mode

How often Grok asks you before tools run (Ask / Auto / Always-approve).

2

Allow / deny rules

Hard policy: some tools or patterns never run (deny always wins).

3

Sandbox

Extra OS limits on read/write/network—even after you say yes to a tool.

Always-approve skips most popups, but deny rules still apply, and a sandbox can still block writes outside the project.

Permission modes

ModePlain EnglishWhen
Ask (default)Often pauses before edits and shellLearning; untrusted folders
AutoGrok auto-allows safer actions and still asks for riskier onesWhen you want fewer prompts but not full auto. If /auto is missing from your menu, stay on Ask
Always-approveSkips ordinary promptsTrusted machine + project + good git/tests
acceptEdits (advanced)Edits freer; shell may still askHeavy local refactors you’ll review in git

How to change: Shift+Tab cycles Normal → Plan → Always-approve (watch the UI indicator). Also: /always-approve, /auto (only if that feature appears in your menu), Ctrl+O (toggle always-approve), /settings, or launch with grok --always-approve / --yolo (CLI flags—not a /yolo slash command).

Beginner rule

Stay on Ask until you finish a ship walkthrough. Never Always-approve on folders with production secrets or untrusted downloads.

Allow / deny rules

Rules are patterns that force allow or deny for tools regardless of mode. Deny wins ties. Configure via settings UI, project .grok/config.toml permission sections, or CLI flags such as:

grok --deny '…' --allow '…'

Use deny as a permanent seatbelt for dangerous shell patterns—even when always-approve is on for trusted automation (scripts/CI you control).

Sandbox (separate from permissions)

Off by default. An extra OS safety net that limits what Grok’s process (and child commands) may read, write, or use on the network—even after you approve a tool. On Linux this uses Landlock; on macOS it uses Seatbelt (the OS’s built-in sandbox tech). You usually pick a profile instead of typing those names.

# Sandbox is OFF by default. Profiles (install docs):
grok --sandbox workspace   # write CWD + temp + ~/.grok; read everywhere
grok --sandbox read-only   # no project writes (only ~/.grok + temp)
grok --sandbox strict      # untrusted code; tighter reads + writes
# Also: off (default), devbox (disposable VMs). Network child limits are Linux-focused.
# also: GROK_SANDBOX=workspace  or  [sandbox] profile in config
ProfileIdea
workspaceRead broadly; write mainly CWD + temp + Grok home
read-onlyAnalyze; don’t change project files
strictLeast privilege for untrusted trees
devboxDisposable VM style (broader writes)

Some network limits work differently by operating system. Do not depend on sandbox alone for network safety until you check in-product /docs for your version.

Practice

  1. In Ask mode, request a harmless file edit and read the permission dialog before accepting.
  2. Deliberately deny one prompt, then ask Grok to explain what it wanted to run.
  3. Say out loud which of the three layers you just used (mode, rule, or sandbox).
Done when

You can explain: “Always-approve is not invincible—deny and sandbox still matter.”

Self-check

1. Always-approve means deny rules no longer apply.
2. Sandbox is the same thing as permission mode.
3. Best mode while learning?