Approvals and permissions
Most work just runs. Bandicot checks four kinds of risky call first, the Decisions model rules on them, and you decide what you marked. What you see and why.
Available now. A current user-facing path exists within the stated scope.
On this page
- How Bandicot decides what runs
- When you are still asked
- Reads and writes outside the workspace
- What counts as a dangerous shell line
- Answer a permission card
- What an allow covers
- Asks about a place outside the workspace
- Commands the sandbox stopped
- Checks before a shell command runs
- Asks from an automaton
- Write your own rules in permissions.json
- The order Bandicot checks
- Workspace rules
How Bandicot decides what runs
Bandicot has one mode, Auto: ordinary work runs without stopping, and four kinds of risky call are checked first by the Decisions model before they run.
Reading, searching and editing inside your workspace go ahead with no stop. A call that could do harm is not handed to you as a constant stream of questions. Instead Bandicot reads the call and what it is for, and it runs only when the Decisions model is sure enough that it is safe. See Decisions.
Three more kinds are checked the same way and no standing rule lets them through: changes to the files that decide what runs (permissions, hooks, config and trust), installs from your marketplaces, and moving a workspace's git history into Versions or back. Each runs only when your request asks for that change.
If Decisions is off or cannot answer, the agent's own model takes one short look at any call the fixed rules would block, at its lowest effort, and its verdict stands. Its cost shows in Usage as safety_check. If that model cannot answer either, fixed rules decide: local edits and commands that send nothing still run, and anything that could post or send something, change what runs, or that the check could not read in full is blocked. A call that is blocked is shown in the agent, and the agent works another way.
AI Gateway › Agent › Permissions shows the current rules with their verdicts: Runs, Checked first or Blocked. Some places in the app still show the older name System One for Decisions.
| Row in Permissions | Default | Example |
|---|---|---|
| Dangerous shell lines | Checked first | A command that can change the system, your home or a remote. |
| Writes outside the workspace | Checked first | Saving a file in another place, or reading, listing or searching one. Temporary file locations do not need a check. |
| Changes after reading team or web content | Checked first | A write after the agent read a web page or a team message. |
| Untrusted sources | team, web | Tools whose results other people wrote. |
When you are still asked
You still decide anything you marked yourself, running a command outside the sandbox and any question the agent asks.
These come to you as a card, because they are your choices and not a safety judgement. A card nobody answers counts as Deny, never as allow. A company plan can also add rules of its own, and one that keeps approvals with people sends every checked call to a card instead; see Policies.
A workspace you cloned cannot loosen any of this. Its own permissions file can always make a verdict stricter, and it loosens one only after you approve its exact contents.
| Card | When it appears |
|---|---|
Needs your call | A rule of your own with the action ask matched the call. |
The agent suggests an install | Only when your company keeps approvals with people. See the marketplace. |
Run once outside the sandbox | The sandbox stopped a command and the agent tried again. See Commands the sandbox stopped. |
| A Versions history move | Only when your company keeps approvals with people. Then it happens only after you confirm in the app window, every time. |
Question | The agent needs a decision that is yours. See Agents. |
Reads and writes outside the workspace
Reading, listing, searching or writing in a place outside the workspace is checked first, except in the system temporary file locations.
A path counts as outside when it is absolute and not inside the workspace, starts with ~, or climbs out with ... The reason reads This reads outside the project. or This writes outside the project.
Temporary file locations are never checked: /tmp, /private/tmp, /var/folders and /private/var/folders. A place you granted with Always for this place is not checked either, as the places section explains.
If you switch off Reach outside the workspace in AI Gateway under Agent, then Capabilities, the agent cannot reach outside at all and no check happens; the file tool refuses with a message that names that setting.
What counts as a dangerous shell line
A shell line is dangerous when it changes privileges, uses a disk or system tool, removes a whole root, forces a push or throws away unsaved work, rewrites history, loosens permissions everywhere or pipes a download into a shell.
Bandicot reads the text of each line, including every part of a chain joined with ;, && or a pipe, and a wrapper such as env sudo. A command written inside bash -c, eval, $( ) or backticks is read too, and so is one behind a quote. The default verdict is Checked first.
Everyday commands pass without that extra check: rm -rf build, rm -rf ./node_modules, git push origin main, git commit --amend, git rebase, git restore --staged ., npm run build and chmod 755 run.sh. Every command, flagged or not, also goes through the shell checks.
| Kind | Examples |
|---|---|
| Raised privileges | sudo, su, doas |
| Disk and system tools | mkfs, diskutil, dd, fdisk, shutdown, reboot, halt, launchctl, csrutil, security, nvram |
| Removing a whole root | rm -rf or rm -R aimed at /, ~, $HOME, .., * or . |
| Forcing or deleting on a remote | git push with -f, --force, --force-with-lease, --mirror, --delete, --prune, a branch written with a leading +, or a :branch delete |
| Throwing away unsaved work | git reset --hard, git clean -f, git checkout -- ., git restore ., git checkout -f |
| Rewriting history | git filter-branch, git filter-repo |
| Loosening permissions | chmod -R 777 |
| A download piped into a shell | curl -s https://example.com/x.sh | sh, wget -qO- url | bash |
| Raw disks and fork bombs | Anything naming /dev/disk, or :(){ |
Answer a permission card
When a call of yours needs you, a card titled Needs your call says what the agent wants to do and why, with buttons to allow or deny it.
The card names the tool, the command or file, and the reason. A riskier one reads Needs your call · higher risk. After you click, the buttons lock while your answer is sent.
What an allow covers is in what an allow covers. Allow this workspace is greyed out, with the hint Workspace scope is not available for this request, for tools that cannot be saved as a workspace rule. Only shell, write, edit, memory and subagent calls can, so a read outside the workspace or a web call offers Allow once and Allow this agent instead.
Allowing a risky line for this agent or this workspace remembers that exact line only. The next forced push or hard reset is a different line and is checked again.
A card nobody answers within 60 seconds counts as Deny, never as allow. You can also answer from another Mac, or by saying yes or no in the voice window.
| Button | What it allows |
|---|---|
| Allow once | This one call. |
| Allow this agent | Calls like this one, for the rest of this agent's work. |
| Allow this workspace | Calls like this one, in this workspace, from now on. |
| Deny | Nothing. The agent is told no and carries on without it. |
What an allow covers
Allowing a call for the agent or the workspace covers calls of the same kind, not every call of that tool, and it never covers a dangerous shell line.
The kind is worked out from the call you allowed, so Allow this agent on git status does not also allow git push. A rule you wrote in permissions.json with deny or ask still wins over an allow.
A dangerous line, such as a forced git push, is still checked even when an earlier allow such as git status seems to cover it. Only a rule whose own text names that dangerous line lets it run without a check, for example the exact line you allowed on purpose.
| You allowed | It then covers |
|---|---|
A shell line that starts with git, gh, npm, pnpm, yarn, bun, cargo, go, docker, kubectl, brew, pip, pip3, uv or swift, such as git status | That tool and its first word after it: every line that starts git status, but not git commit or git push. |
One of those tools with an option first, such as git -C app push | That exact line only. |
Any other shell line, such as ls -la | Every line that starts with that command, here ls. |
A file call, such as a write to notes.txt in a place | Files in that place. |
| Any other call | That exact call. |
Asks about a place outside the workspace
When a card is about a place outside the workspace, it offers Allow once, Allow this place for this agent, Always for this place or Deny.
Always for this place adds a place grant that lasts. See Settings for where your grants are listed.
For a read, listing or search, Always for this place is greyed out like Allow this workspace; Allow this place for this agent is the widest choice there.
Commands the sandbox stopped
When the sandbox stops a command, the card offers Run once outside the sandbox or Keep it inside, and the answer covers that one command only.
Keep it inside refuses the command. The agent sees the refusal and works another way.
Shell commands run in a macOS sandbox. A command can read most of the disk but never the private places that hold keys, sign-ins and browser profiles. It can write only in the workspace, the temporary file locations and the download caches of common tools, such as the npm, Cargo and Go caches. Network access is allowed. A command can stop the programs it started inside the sandbox, such as a dev server it left running, but no program outside it.
When the sandbox, not the command, makes a command fail, the agent is told so. If it runs the same command again, the card appears. Your answer covers that one run and nothing is remembered. A command too long to show in full is never offered and stays inside.
Checks before a shell command runs
Before any shell command starts, Bandicot checks its syntax, refuses a few unsafe deletions, and asks the Decisions model about the rare command it cannot call ordinary.
These checks run for the agent's commands and for your own direct commands, after the permission step and before the command starts. A refusal is shown in the tool row for the agent to read and work around.
Most commands pass at the second step and run at once. Only a command that deletes or moves something not plainly inside the workspace, writes its output to a file by a full path, builds code at run time, raises privileges, runs a script from a pipe, passes an option that runs another program (such as --exec), or forces a push or a hard reset goes on to the judge.
The judge is asked whether the command is safe for its project, and it passes the command only when it is confident. If no judge is available or it does not answer in time, the command goes on under your permission rules and the sandbox alone, so a slow judge never holds up your work.
| Check | What it catches | What the tool row says |
|---|---|---|
| Syntax | A line the shell cannot read, such as an unclosed quote. Nothing runs, not even the part before the mistake. | bash verifier (syntax): and the shell's own message. |
| Unsafe expansion | rm, mv, chmod, chown, dd, find -delete or git clean aimed at a variable that may be empty or an expansion that is not quoted. | destructive command refused: maybe-empty leading variable or unquoted expansion in the part, then how to fix it. |
| Protected target | A deletion or move aimed at your home, the disk root, or the system locations /Users, /home, /etc, /usr and /System, a raw disk, or output written into one of them. | bash verifier (static): unsafe expansion or protected destructive target. |
| Judge | The commands described above that the first checks cannot call ordinary. | bash verifier (model): judge denied or abstained when it does not pass the command. |
If it goes wrong
- A command is refused with
destructive command refused: maybe-empty leading variable or unquoted expansion. - The target could be empty or split into several words, and an empty one could reach the wrong place. Quote the variable and guard it, such as
"${DIR:?}", or write the path out. - A command is refused with
bash verifier (static). - It names your home or a system location as the thing to delete or move. Aim it at the exact path inside the workspace, or run it yourself in Terminal.
- A command is refused with
bash verifier (model): judge denied or abstained. - The judge would not call it safe. Ask the agent for a narrower command inside the workspace, or run it yourself in Terminal.
Asks from an automaton
When an automaton needs you, its conversation shows the request as a card, and an automaton's request that nobody answers is denied.
A command the sandbox stopped shows the whole command with Run once outside the sandbox and Keep it inside. If the automaton asks you something instead, the card has a box reading Your answer… and an Answer button.
Open the automaton to answer; see Automations.
Write your own rules in permissions.json
A permissions.json file in your Bandicot settings holds rules that allow, ask or deny a tool, optionally only when its arguments match a pattern.
A rule has a tool (a tool name, or * for any), an optional pattern that may use * and ?, and an action: allow, ask or deny. For example {"tool":"bash","pattern":"git *","action":"allow"} lets everyday git commands run without a check. The risky lines in the table above are still checked, and a read-only run refuses them.
An allow rule on a chain such as git status && rm -rf build has to cover every part of it that changes something, so a rule for one command never lets a second one ride along.
The auto object sets the three Auto verdicts with the keys dangerous, outside_workspace and after_untrusted, each allow, ask or deny, and untrusted_tools adds tools whose output counts as written by others. In AI Gateway › Agent › Permissions they read as Runs, Checked first and Blocked.
The Permissions card shows what is in force. A rule with the action ask is the one way to get a Needs your call card for a call Auto would otherwise judge by itself.
If it goes wrong
- A rule seems to be ignored.
- A rule with
denyoraskbeats one withallow, and a dangerous line is still checked whatever an allow says. Check thePermissionscard for what is in force.
The order Bandicot checks
Bandicot checks control files first, then untrusted content, then your rules, then place grants, and finally the Auto defaults.
Among rules, deny beats ask, and ask beats allow. A write to a control file is always checked, though a deny rule still wins.
| Step | Check | Result |
|---|---|---|
| 1 | A write to a control file, such as permissions.json or hooks.json | Checked first. |
| 2 | The turn read team or web content, and the call changes or sends something | Follows after_untrusted; checked first by default. |
| 3 | Your rules | deny, then ask, then allow. |
| 4 | Place grants | Runs where you granted the place. |
| 5 | Auto defaults | Dangerous shell lines and reads or writes outside the workspace are checked first; everything else runs. |
Workspace rules
A workspace can carry its own .bandicot/permissions.json, which can always make Bandicot stricter but whose allow rules count only once you trust that exact file.
Trust is kept for the file's exact contents, outside the workspace, so a changed file is untrusted again. AI Gateway › Agent › Permissions shows the file's path next to Workspace rules.
Questions
Can I turn approvals off?
No. Auto is the only mode. You can loosen or tighten what it checks with rules in permissions.json.
Why does the agent not ask me about every risky command?
Because the Decisions model rules on each risky call and runs it only when it is sure enough that it is safe. You are asked about what you marked yourself.
What happens if I do not answer a card?
After 60 seconds it counts as Deny. Nothing runs on a timeout.
Does the agent read files outside my workspace?
Only after the check passes, except in the temporary file locations. A place grant removes the check for that place.
What counts as a dangerous shell command?
Commands such as sudo, disk tools, a recursive rm aimed at a root, a forced git push, git reset --hard, git clean -f, chmod -R 777 and a download piped into a shell. Ordinary builds and rm -rf build run without that extra check.
Can a repository I clone grant itself permissions?
No. A workspace file can only make Bandicot stricter until you trust its exact contents.