- 01
Allow, ask, block
Every rule has one of those three actions. You can change it, turn it off or write your own rules.
- 02
A card you can read
You see the command, what it does in plain words and how risky it is, before you decide.
- 03
Approve from wherever you are
The same card shows up on the Mac and in doki in the browser, on a computer or a phone.
- 04
Loosening happens on the Mac only
Turning rules off or allowing more can’t be done from a browser.
Rule tester
Test a command against Guard
Rules (click to change the mode)
How Guard works
Before it uses a tool, Claude Code asks doki. doki checks the command or the file path against your rules and answers: go, don’t go, or wait for you to decide.
If nobody answers, the action doesn’t wait forever. After 10 minutes it’s denied. You can change that time in Settings → Security.
- Allow: the action goes ahead and the agent doesn’t stop.
- Ask: the action waits until you approve or deny.
- Block: the action doesn’t run and is noted in Activity.
Which rules Guard ships with
Guard comes with 13 rules for the things that tend to do damage even when the task was reasonable. You don’t have to write them yourself. You review them in Settings → Security and adjust them.
- Blocks: recursive delete outside the project,
curl … | sh, and editing the agents’ own configuration. - Asks:
sudo,git push --force, pushing straight tomain,git reset --hard. - Asks: reading secrets such as
.env,~/.sshor~/.aws. - Asks: global package installs, publishing packages, deploys, migrations and
DROPon databases.
What you see when an agent asks for permission
The card says which agent it is, which project it’s in and the exact command. A moment later the explanation appears: one or two sentences on what the command does and its risk, low, medium or high.
You can allow it once or deny it. On the Mac you can also always allow it in that project. On the Mac and on the web, pending cards sit in a bar at the top, whichever section you’re in.
On the Mac the permission also arrives as a system notification, with Allow and Reject. Away from the Mac, open doki in the browser on your phone and decide without opening the terminal.
dokiMacBook ProActivity
How to adjust rules per project
The same rule can be strict in a production repository and looser in a test one. An exception changes a rule’s action in that project only.
Your own rules use a pattern on the command or on the file path. Before you rely on one, type a command into the test box and see which rule catches it and with what action.
What can’t be changed from a browser
Anything that lowers security is done on the Mac: turning Guard off, turning a rule off, moving it to a softer action, or dropping device approval. If someone tries it from the web, the Mac refuses.
From the browser you can still approve or deny a card, and make a rule stricter.
A new browser or phone only gets straight in if you signed in with two-step or a passkey; otherwise you approve it in Remote → Devices, and you can revoke it there too. What was approved and what was blocked is kept in Activity. The rest is in Security.
dokiMacBook ProAccess to this Mac
How to start
Open Settings → Security
The built-in rules are there, each with its action.
Adjust what you need
Change an action, write your own rule or add an exception for one project.
Test a command
Type it into the test box and see which rule catches it.
Approve when it asks
When an agent hits an ask rule, you decide from the Mac or from the browser, on your phone too.
Frequently asked questions
What is Guard in doki?
It’s the set of rules that decides what a coding agent may run. Every action falls into allow, ask or block. Anything under ask stops until you approve or deny it.
Which agents does Guard work with?
It works fully with Claude Code, which asks doki before every tool call. For Cursor CLI, doki passes the block rules as entries in its own deny list. Codex keeps its own sandbox.
Does Guard replace the agent’s own permissions?
No, it adds to them. The agent keeps its own permissions. Guard adds your rules and lets you approve outside the terminal. If doki isn’t open, Claude Code carries on with its usual permissions.
What happens if I don’t answer a card?
The action waits 10 minutes and is then denied. You can change that time in Settings → Security. The agent gets the denial and moves on to something else or asks you.
Can I approve from my phone?
Yes. Open doki in the browser on your phone and the card is there, with the command and its risk. The browser gets no system notifications: pending cards wait for you at the top and in the bell.
Can someone with my web session turn the rules off?
No. Turning Guard off, turning rules off or softening them can only be done on the Mac. From a browser you can only approve cards and make rules stricter.