In my previous post about IBM Bob I recommended starting with narrow permissions, but I did not show how to configure them. I had to do that for the demo in my December talk, where Bob migrates a Java EE 8 application to Jakarta EE 11 live on stage, and I tested each setting in Bob Shell 2.1.0, in a throwaway repository.
This tutorial shows how to configure tool groups, the allowed and denied command lists and access outside the workspace, how to restrict a project with a custom mode, and how to test the configuration before relying on it. At the end are the limits the configuration does not solve and a complete example for a Java project with Maven.
Before you start: where permissions live
Approvals live in the global file ~/.bob/settings/settings.json, under the approval key. The file is shared: whatever you change in the IDE screens shows up there, and Bob Shell reads the same block. A project cannot declare its own approvals. What it can declare is modes, which is why step 5 exists.
In the IDE there are two places. The Permissions button, next to the mode selector, changes permissions for the current task only. Settings > Tool Auto-approval holds the defaults new tasks inherit. In this post I edit the file directly, because it is easier to version and compare.
Two precautions before editing. Close Bob, because it rewrites the file while it runs, and keep a backup:
cp ~/.bob/settings/settings.json ~/.bob/settings/settings.json.bak
Changes take effect from the next session.
Step 1: choose the groups that run without asking
The allowed_permissions field lists the tool groups that are approved automatically. By default, only read. The IDE documentation rates the risk of each one:
| Group | What it allows | Risk according to IBM |
|---|---|---|
read | Reading files | Medium |
edit | Creating and changing files | High |
execute | Running shell commands | High |
mcp | Calling MCP tools | Medium to high |
skill | Invoking skills | Medium |
todo, subtask, subagent, mode | Organizing the work | Low |
For day-to-day work, I would start with read and edit. Add execute only after building the list in step 2, because without it the group does nothing useful. And turning on mcp does not approve every MCP tool: each server still needs “Always allow”.
"allowed_permissions": ["read", "edit", "execute"]
Step 2: build the command allow list
With execute allowed, the commands in approvedCommands run without asking. Matching is by prefix, word by word: git approves any git, and git status approves only git status, with or without extra arguments. There are no wildcards and no regex. Bob also splits the line with a bash parser before matching, so in a chain like ls && touch x every command must be approved. In the test, the approval screen showed ls and touch in separate boxes.
"allowedExecutors": [{
"toolId": "execute_command",
"approvedCommands": [
"ls", "cat", "grep", "head", "tail", "wc", "diff",
"git status", "git diff", "git log", "git show", "git switch", "git add", "git commit",
"./mvnw -q verify", "./mvnw -q test"
],
"deniedCommands": []
}]
Always prefer multi-word entries: git status instead of git, ./mvnw -q verify instead of ./mvnw.
Pitfall: interpreters and wrappers. In the lab, with rm on the deny list and bash, xargs and find on the allow list, these three commands deleted the file without asking anything:
bash -c "rm notes.txt"
echo notes.txt | xargs rm
find . -name notes.txt -delete
Bob matches the command that appears on the line. In bash -c "rm notes.txt", the command is bash, and rm is just a string. The allow list controls which programs run, not what they do. Keep off it everything that runs other commands: bash, sh, zsh, python3, node, xargs, find, env and sudo. When Bob needs one of them, it asks, and you approve it that one time.
Pitfall: redirection. The > is not part of the match. With echo approved and the edit group off, echo done > notes.txt changed the file without asking. Any command on the list can write files this way, so turning off edit does not guarantee nothing gets changed.
Step 3: use the deny list for exceptions, not as a wall
A command in deniedCommands does not open a confirmation prompt. Bob cancels the call and returns Attempted to execute commands that are on the deny list: "rm" to the model. The catch is the tie-break: when a command matches both lists, the rule with more words wins, and a tie goes to the approval.
| Allow | Deny | Command | Result in the test |
|---|---|---|---|
| (none) | git push | git push --dry-run | Blocked |
git push origin | git push | git push origin main | Ran, the allow entry has more words |
That makes the deny list a tool for cutting variations of an approved command. An exception longer than the approval beats it:
"approvedCommands": ["./mvnw -q verify"],
"deniedCommands": ["./mvnw -q verify -DskipTests", "rm", "git push", "git reset --hard", "curl", "wget"]
Only that exact variation, though: ./mvnw -q verify -X -DskipTests does not match the exception and gets through. And the reverse, approving something longer than a deny entry, reopens what you meant to close.
Step 4: decide on access outside the workspace
outsideWorkspaceAllowed turns tool access to files outside the project folder on or off, and permissionOptions refines it per group:
"outsideWorkspaceAllowed": true,
"permissionOptions": [{ "groupId": "read", "enableOutsideWorkspace": true }]
With that, Bob reads outside the workspace but does not edit there. Leave it all off if you do not need it.
Pitfall: the shell skips this filter. With outsideWorkspaceAllowed: false and cat approved, cat /etc/hostname ran and printed the hostname. The setting applies to Bob’s file tools, not to paths inside a command. I did not test writes outside the workspace, but I would not count on them being blocked.
Step 5: restrict per project with a custom mode
Modes are the only permission control that lives inside the repository, versioned with the code. A mode defines which tool groups exist in it, and a group that is not listed simply does not show up for the model. Create .bob/custom_modes.yaml at the project root:
customModes:
- slug: docs-only
name: Docs only
roleDefinition: You maintain the Markdown documentation under docs/ in this repository.
groups:
- read
- - edit
- fileRegex: "(^|/)docs/[^/]+\\.md$"
description: Markdown files under docs/ only
Open it with bob chat --mode docs-only, or switch modes with Shift+Tab. In the test, I asked it to run ls -la and Bob answered that it had no shell tool. It created docs/guide.md without trouble and refused to change README.md with the message “edit tools can only be used on files that match this regex”.
Pitfall: fileRegex is matched against the absolute path. My first version used ^docs/.*\.md$, and Bob blocked even docs/guide.md, because it received /path/to/project/docs/guide.md. The documentation’s example, .*\.(js|ts)$, only works because it is not anchored at the start. Use (^|/)docs/ or something equivalent.
Two details from the documentation: a mode with the same slug as a default one (agent, plan, ask) replaces it, so you can ship a stricter agent to the whole team. And a misspelled group name grants nothing and gives no warning.
Step 6: test the configuration before you trust it
None of this replaces running it. The routine I used:
- Create a throwaway git repository with any file, a fake
.envand a.bobignore. - Apply the configuration with a backup. I used
jqto swap only theapprovalkey:
#!/usr/bin/env bash
set -euo pipefail
settings="$HOME/.bob/settings/settings.json"
cp "$settings" "$settings.bak"
jq --slurpfile lab lab-approval.json '.approval = $lab[0]' "$settings.bak" > "$settings"
echo "Restore with: cp $settings.bak $settings"
- Open
bob chat --workspace <repo>and send one command at a time, asking it to run exactly that command. Reject every approval prompt. - Start a fresh session for each sensitive test, with a neutrally worded request. With the blocked
rmstill in its context, the model refused to runbash -c "rm ...", calling it a workaround. In a fresh session, it ran it. That refusal is welcome, but it depends on context, and a malicious README or issue changes that context. It is not a layer you control. - Restore the backup and check it with
cmp.
The commands worth testing in any configuration: a chain with one command off the list, a denied command inside bash -c or xargs, a > into a file listed in .bobignore, a path outside the workspace, and a write to settings.json itself.
What the file does not solve
Four things the lab showed that do not depend on how you tune the configuration:
.bobignoreis not a sandbox.cat .envran and printed the contents, andecho done > build.logwrote to an ignored file. IBM’s own security guidelines say as much.settings.jsonis protected. Any command that mentions the file triggers “This operation accesses protected Bob files and requires explicit approval”, with only approve once or reject as options. The agent cannot quietly widen its own permissions. That is the good news.forbiddenApprovalGroupsbelongs to your company. The field shows up in the file and promises to force confirmation for a whole group, but it is filled in by corporate policy (DisabledAutoApprovalGroups). Written by hand, as["execute"], it had no effect:lsran without asking.--command-securitywas not tested. It sends each command to a model-based check, but in 2.1.0 it only exists in headless mode (bob run), which requires an API key.
That is why the real boundary sits outside Bob: run the agent in a container or a VM, with no SSH keys or tokens beyond what it needs, and use git as your rollback, with one branch per task and a diff review before the merge. Also remember that the build is an interpreter: with edit allowed, Bob can change pom.xml or the Makefile, and the approved ./mvnw then runs whatever it wrote.
The full configuration
Putting the steps together, for a Java project with Maven:
"approval": {
"autoApprovalEnabled": true,
"outsideWorkspaceAllowed": false,
"allowed_permissions": ["read", "edit", "execute"],
"allowedExecutors": [{
"toolId": "execute_command",
"approvedCommands": [
"ls", "cat", "grep", "head", "tail", "wc", "diff",
"git status", "git diff", "git log", "git show", "git switch", "git add", "git commit",
"./mvnw -q verify", "./mvnw -q test"
],
"deniedCommands": [
"rm", "git push", "git reset --hard", "curl", "wget",
"./mvnw -q verify -DskipTests", "./mvnw -q test -DskipTests"
]
}]
}
Plus a .bob/custom_modes.yaml in the repository for tasks that do not need a shell. The list I had built for my talk’s demo had bash, sh, python3, xargs, find, env, echo and tee, in other words, every pitfall in this post. On stage, a generous list can be a conscious choice, as long as it is a choice and runs in an environment where a stray rm costs nothing.