Skip to content

Tools and permissions ​

golem does its work through tools: small actions it asks the daemon to run, such as reading a file or running a command. Before any tool runs, one check decides: allow, ask you, or deny.

The built-in tools ​

ToolWhat it doesCarefulBalancedAutopilot
read_fileReads a file in the project, in pages of linesAllowedAllowedAllowed
list_dirLists a folder in the projectAllowedAllowedAllowed
globFinds files by pattern, such as **/*.pyAllowedAllowedAllowed
grepSearches file contents with a regular expressionAllowedAllowedAllowed
git_status, git_diff, git_logThe branch, the changes, and recent commitsAllowedAllowedAllowed
read_artifactReads more of a long tool output that was cutAllowedAllowedAllowed
delegateHands a reading or searching job to a helper that starts with an empty context and returns a short answer. The helper only reads, and never asks youAllowedAllowedAllowed
todo_writeKeeps the agent's todo list, shown with /todosAllowedAllowedAllowed
web_searchSearches the web with DuckDuckGoAsksAllowedAllowed
web_fetchReads one web pageAsksAllowedAllowed
shellRuns a command, in a sandboxAsksAsksAllowed, unless [shell] network = true
write_fileCreates a file, or replaces all of itAsks, with the diffAsks, with the diffAllowed
edit_fileReplaces exact text in a fileAsks, with the diffAsks, with the diffAllowed
shell_unsandboxedRuns a command outside the sandbox, with your credentials and the network, for gh and git pushAsksAsksAsks
mcp__<server>__<tool>A tool from an MCP serverAsksAsks, or allowed for a server you trust (below)Asks, or allowed for a server you trust (below)

Permission modes ​

The mode says how much the built-in defaults allow without asking. Balanced is the default.

  • Careful allows only the tools that read.
  • Balanced also allows web search and fetch. Anything that changes a file or runs a command still asks.
  • Autopilot also allows file writes and edits, and shell commands, which the sandbox keeps inside the project with the network off. With [shell] network = true a command can reach the network, so shell still asks. File tools cannot leave the project folder anyway.

shell_unsandboxed asks in every mode. MCP tools ask too, unless you trust the server: with approval = "read-only" in its [mcp.<name>] table, a tool the server marks read-only runs without asking in balanced and autopilot, and with approval = "allow" every tool runs in every mode. The server's word is all that marks a tool read-only, so trust it only for a server you trust. See MCP servers.

toml
[permissions]
mode = "balanced"   # careful | balanced | autopilot

In the web app, Settings → Tool rules → Default mode saves it for you: click Careful, Balanced, or Autopilot and golem writes mode into config.toml, keeping your comments. Autopilot asks you to confirm first. The edit applies to new chats at once, and to a chat that has not set its own mode.

A chat can use another mode than the default, set for that chat only and kept with it: pick it from the mode chip beside the model in the web composer, type /mode careful|balanced|autopilot (or /mode default to follow config.toml again), or press Shift-Tab in the terminal to cycle through the three. A mode changes only the built-in defaults. Your rules and the project's rules are checked first, so an ask or deny rule you wrote still applies in autopilot, and what you allowed for the session still counts.

The read-only tools only see the folder you opened golem in. Reads change nothing, so they never stop to ask. The file tools cannot leave the project folder in any mode.

Answering a question ​

When a call asks, the answer pauses until you choose:

Allow shell pytest -q?
asked by built-in default
a once · s this session · w always (saves a rule) · e edit · d deny
  • a (or Enter) allows this one call.
  • s allows it, and the same tool on the same subject for the rest of the chat.
  • w allows it, and writes a rule to ~/.golem/config.toml that allows exactly this call from now on.
  • e opens the call's arguments as JSON, so you can change them, then allows it once.
  • d (or Esc) denies it. The model reads that the call was denied, and carries on.

A file change shows its diff above the question. Approving it approves that diff and nothing else: if the file changes before the write, the call fails instead of writing something you did not see.

First chat walks through a first approval.

Rules ​

A rule names a tool, and can narrow it to a subject (match) or a path (path). The first rule that matches decides.

toml
# Never read .env files, in any project.
[[rule]]
tool = "read_file"
path = "**/.env"
action = "deny"

# Let the tests run without asking.
[[rule]]
tool = "shell"
match = "pytest*|just test*"
action = "allow"

# Ask before any search for secrets.
[[rule]]
tool = "grep"
match = "*password*|*secret*"
action = "ask"
FieldMeaning
toolThe tool name, as a glob. * is every tool, mcp__git__* every tool of one server
matchThe subject: a shell command, a search pattern, or a web host. Globs, with | between alternatives
pathA glob on the real path. * stays in one folder, ** crosses folders, ~ is your home, and a relative glob starts at the project
actionallow, ask, or deny

Where rules live, checked in this order:

  1. The project's .golem/policy.toml, for everyone who works in that folder.
  2. Your ~/.golem/config.toml.
  3. The built-in defaults in the table above, for the chat's mode.

A project file can make golem stricter: its deny and ask rules always count. Its allow rules count only when you list the folder in trusted_projects in your own config, so a cloned repository cannot give itself a shell.

toml
trusted_projects = ["~/repos/my-app"]

See and change them. golem config show prints the rules in effect for the folder you are in, in the order they are checked, and where each one came from. In the chat, /permissions shows the same list and what this chat allows, and changes or deletes a rule. Rules apply on the next call, with no restart.

The shell sandbox ​

A command you allow still runs in a sandbox (sandbox-exec, built into macOS). If the sandbox cannot start, the command does not run.

  • Writes only to the project folder, the temp folders, the usual caches (~/.cache, ~/.npm, and others), and any folder in [shell] writable. In a git worktree, it may also write the worktree's git folders in the main checkout, so git commit works.
  • No network, unless [shell] network = true.
  • No secrets. It cannot read ~/.ssh, ~/.gnupg, ~/.aws, ~/.config/gh, ~/.golem, your Keychains, and similar folders. Variables that look like credentials are removed from its environment.
  • A time limit of 120 seconds by default, [shell] timeout_seconds.

When the sandbox refuses something, the result says so: the tool line reads exit 1, blocked by the sandbox, and the output names what was blocked and how to allow it. The model reads the same line, so it can tell you.

With the network off, a command that names a network client such as curl, wget, or git clone also gets a last line after the exit code. It says the sandbox has no network, and points to web_fetch or shell_unsandboxed. The line is a hint, so it appears whatever the exit code is.

git_status, git_diff, and git_log run git directly, in the same sandbox, with hooks and other ways for a repository to run code switched off.

toml
[shell]
network = false
writable = ["~/scratch"]
timeout_seconds = 300

The [shell] settings are read only from your own config.toml. A project cannot widen them. A change applies from the next command.

Outside the sandbox ​

gh and git push need your login and the network, which the sandbox keeps out. For such a command the model uses shell_unsandboxed. It runs in the project folder like shell, but without the sandbox, so it can do anything you can. It asks every time, and the question names the tool:

Allow shell_unsandboxed gh pr create --fill?
asked by built-in default
a once · s this session · w always (saves a rule) · e edit · d deny

s and w cover that exact command. Only a rule that names shell_unsandboxed allows it: tool = "*" or tool = "shell*" with action = "allow" does not. Keep its match exact, because match = "gh *" would also allow gh x; rm -rf ~.

The web ​

web_fetch asks once per host, so a rule can allow the sites you trust:

toml
[[rule]]
tool = "web_fetch"
match = "docs.python.org|developer.mozilla.org"
action = "allow"

web_search sends the words it searches for to DuckDuckGo. It asks once for the host html.duckduckgo.com, whatever the query, so one rule allows searches:

toml
[[rule]]
tool = "web_search"
match = "html.duckduckgo.com"
action = "allow"

web_fetch refuses addresses inside your network (such as 192.168.… or localhost) unless [web] allow_private = true. What a page says is treated as data, never as instructions, so a page cannot approve anything.

Long output ​

A tool result over 20 000 characters is stored once, and the model sees its start and its end, with a note. It reads the rest with read_artifact when it needs to. /artifact opens the whole output in your pager.

Why it works this way ​

  • ADR-012: rules, first match wins, and a project cannot allow itself.
  • ADR-013: an approval pauses the run.
  • ADR-014: the shell runs under sandbox-exec, or not at all.
  • ADR-038: a command you approve may run outside the sandbox, as a tool of its own.
  • ADR-015: a file change is applied only as shown.
  • ADR-016 and ADR-017: long output, and the web.