Permission policies
Set a permission policy for each agent tool. Run it silently, ask your phone, leave it to the agent's own prompt, or block it outright.
Updated
A permission policy decides what happens when your AI agent is about to run a tool, such as a shell command or a file edit. Pushary can run the call silently, ask your phone, leave it to the agent's own prompt, or block it. Each rule matches a tool pattern like Bash, Bash(git status) or Bash(npm test:*), with a * rule as the fallback.
Policies are enforced by the hooks that npx -y pushary@latest setup installs. A hook is a small program the agent runs before each tool call. Agents connected over MCP only (Windsurf, Claude Desktop, Cowork, ChatGPT, or Cursor without its hooks) can send notifications and ask questions, but their tool calls are not gated. Supported agents lists which agents enforce.
Change a policy in the dashboard
Pick a preset, or edit single rules
Permission presets set a whole agent at once: Cautious, Balanced, Autonomous or Custom. For one tool, open Advanced: individual tool rules and click Edit on a row.
Set where you decide and what happens on a timeout
Choose Where to decide (the mode), Timeout (0 to 300 seconds) and If you don't respond (Auto approve, Auto deny, Ask in terminal, or Wait for phone). Push window applies only to When away.
Add a rule for a specific tool or command
Type a pattern such as Bash, Bash(git status), Bash(npm test:*) or Edit(src/**), choose All repos or one repository, and click Add a rule. The * row is the catch-all and cannot be removed.
The running agent picks up the change on its next tool call.
The four approval modes
Every rule has a mode. The mode decides where the approval happens. New workspaces start on Always.
| Label | Mode id | Where you are asked |
|---|---|---|
| When away | push_first | On your phone when you are away from the agent's machine. In the agent, or on the Mac app, when you are there |
| Always | push_only | On your phone for every approval, even while you are at the machine |
| Alert only | notify_only | In the agent's own prompt. Your phone gets an alert with no approve or deny |
| In agent | terminal_only | In the agent's own prompt. No approval alert |
push_first
Shown as When away. Pushary asks your phone only when it cannot place you at the agent's machine. Two signals place you there:
- The Pushary Mac app on that machine reports you are there: the screen is unlocked and awake, and you used the keyboard or mouse in the last minute.
- A CLI agent hook on that machine recorded a prompt in the last five minutes and tool activity in the last minute.
Editor plugins report no presence of their own. Your phone is asked when neither signal holds, or when the question carries no machine id, as with Cowork and Claude Desktop.
While you are at the Mac, the decision stays on the Mac however long it waits. Time alone never sends it to your phone. Leave the Mac and the decision moves to your phone. When a CLI or editor agent skips your phone because you are at the keyboard, the decision goes straight to the agent's own prompt.
Some callers have no prompt of their own. They ask your phone every time, as under Always, and wait up to timeoutSeconds:
- a Cursor file edit, or a session started from your phone, from
pushary1.9.13 - Antigravity CLI, from 1.9.14
- a Codex edit outside a scope you agreed, from 1.9.15
- Codex set to never ask for approval (full access), from 1.9.17
In Codex full access, a call nobody answers is refused with "No response within timeout", even when the rule approves on timeout. Older versions refuse a Cursor file edit and tell you to switch to Always.
Anywhere else, when your phone is asked, the hook waits up to pushFirstSeconds. Yes runs the call, No denies it, and no answer hands the decision back to the agent's own prompt.
push_only
Shown as Always, and where a new workspace starts. Pushary sends the push for every approval, even while you are at the machine. The agent waits until you answer or timeoutSeconds runs out, then the rule's timeout action applies. On a Mac with the Pushary app, the card also shows there and the first answer wins. Use it for destructive operations where the agent should wait for you.
terminal_only
Shown as In agent. Pushary sends no approval alert, and no approval card opens on its own on the Mac (Pushary for Mac 0.1.35 or later). The agent's own permission flow decides. A host with no permission prompt of its own refuses the action, as described under Alert only. Task updates are a separate setting and still arrive if you turned them on. Use it for tools you always want to approve at the keyboard.
notify_only
Shown as Alert only. Your phone gets a one-way alert titled Agent needs approval, with the tool description as the body. There is no approve or deny on the phone, and no approval card opens on its own on the Mac (Pushary for Mac 0.1.35 or later). You decide in the agent's own prompt, and the agent never waits on Pushary.
A host with no permission prompt of its own refuses the action. A Cursor file edit is denied, and from Cursor plugin 0.2.3 or @pushary/agent-hooks 0.95.7 the denial says why. The unattended Gemini bridge also refuses with an explanation from 0.95.7. Earlier versions pass the call to Gemini, which refuses it without saying why. Use Alert only when you want to know about approvals without a remote gate.
When Pushary is unreachable
If the hook cannot reach Pushary, it returns no opinion, so the agent's own permission flow decides as if the hook were not installed. An offline agent cannot reach your phone anyway, so you approve at the keyboard. A host with no prompt of its own, such as a Cursor file hook, refuses the action instead.
Policy fields
Prop
Type
The auto-approve shortcut
A rule with timeoutSeconds: 0 and timeoutAction: "approve" runs the call silently, in any mode. There is no push and no terminal prompt. This keeps read-only tools quiet, and it is what Teach-on-Tap writes when you tap always allow.
The mirror also holds. timeoutSeconds: 0 with timeoutAction: "deny" refuses the call at once, with no push and no prompt. Pair it with a pattern like Bash(rm -rf:*) to block a command family.
Read-only shell commands such as ls and git status run without asking under a bare Bash or * rule. A deny still covers them: under a Bash deny or a * deny they are denied too. The reverse also holds. A command Pushary rates destructive, such as rm -rf, never auto-approves through a bare Bash, PowerShell or Monitor rule or a * rule. From Pushary CLI 1.9.241, and for calls the Pushary Mac app forwards once Pushary's servers update, that includes gh repo delete, prisma migrate reset, git checkout -- ., git restore ., git stash drop, npm unpublish, docker rm -f, dd with of=, shred, rsync --delete, npx rimraf and a recursive delete in python -c or node -e code. From Pushary CLI 1.9.250, and for calls the Pushary Mac app forwards once Pushary's servers update, it also includes docker volume rm, docker volume prune, gsutil rsync -d, crontab -r, kill -9 -1 and any other kill sent to every process, a kill that ends process 1 such as kill 1 or kill -KILL 1, mv ~ or mv / somewhere else, and mv onto /dev/null. In PowerShell that includes Remove-Item -Recurse under any of its aliases, and cmd /c rd /s. Only an exact or prefix rule you wrote yourself can approve it. Pushary does not rate git restore --staged, git checkout main, docker rm without -f, dd without of= or an rsync dry run (-n, --dry-run) that names no remote shell with -e or --rsh and no --rsync-path destructive, so a * rule runs them. The same goes for docker volume ls, crontab -l, kill sent to one process other than process 1, a reload of process 1 such as kill -HUP 1, kill -0 1 and mv between two ordinary paths. A gsutil or gcloud storage rsync that deletes asks even with -n or --dry-run, because in gcloud storage rsync -n means --no-clobber.
The kill switch overrides the auto-approve shortcut. A stopped session is denied before any policy is read, so even silently approved tools stop.
Pattern syntax
The tool field accepts four forms, modeled on Claude Code's own permission rules:
| Pattern | Matches | Example |
|---|---|---|
Tool | Every call to that tool | Bash |
Tool(exact arg) | Calls whose argument equals the text exactly | Bash(git status) |
Tool(prefix:*) | Calls whose argument starts with the prefix | Bash(npm test:*) |
Tool(glob) | Calls whose argument matches the glob. * stays inside one folder, ** crosses folders | Edit(src/**) |
The argument depends on the tool:
| Tools | Argument |
|---|---|
Bash, PowerShell, Monitor | command |
Read, Edit, Write, MultiEdit | file_path |
NotebookEdit | notebook_path |
LS | path |
Other tools have no argument to match. The dashboard refuses an argument pattern for them, so write the bare tool name. A path is matched as written and also relative to the agent's working folder, so Edit(src/**) covers files under src in the current project.
Shell commands are split at &&, ||, ; and |, and each part is checked:
- A rule that approves needs every part to match.
Bash(npm test:*)does not auto-approvenpm test && rm -rf dist. - A rule that denies or asks needs only one part to match.
Bash(git push:*)catchescd repo && git push. - A rule that asks and approves on timeout approves only the parts it names.
Bash(npm test:*)withtimeoutAction: "approve"still asks aboutnpm test; rm -rf ~, but if nobody answers, therm -rf ~part gets what it would get on its own: the catch-all*rule a new workspace starts with asks in the terminal, the built-inBashrule refuses it, and a*approve or the Autonomous preset keeps waiting for you. The same holds for a destructive step inside$(...), abash -cscript, a heredoc,watch '...',sudo -s '...', afindthat runs two or more commands, or a shell function the command calls, and for a command whose program is hidden, such as$RM -rf /oreval "$CMD", which gets what it would get without the rule. A part that is not destructive, such asnpm run lint, still runs on timeout. With permissions skipped in your agent, each part gets what it would get there on its own: under Never stop me a lonerm -rf ~runs, so the rule still approves the whole command on timeout, unless a preset or another rule of yours asks aboutrm. In the terminal this needs CLI 1.9.247 or later.
Argument patterns need @pushary/agent-hooks 0.13.0 or later, and path globs need 0.55.0 or later. On older versions such a rule never matches, and the bare-tool and * rules still apply.
Which rule wins when several match
- Your own rules come before preset rules, and preset rules come before Pushary's built-in defaults. One exception: a preset's rule for a specific tool beats your own
*rule. - Within one layer, the most specific match wins: an exact argument, then a prefix or glob, then the bare tool name.
- On a tie, a rule for one session or one repository beats a workspace-wide rule, then the longer pattern wins.
* is a literal catch-all, not a glob. It applies only when no other rule in its layer matches.
Default policies
A new workspace starts with one rule of its own, the catch-all *: Always, a 60 second timeout, and ask in the terminal if nobody answers. The rule also carries a 20 second push window, which applies once you switch it to When away. Because your own * rule outranks the built-in rules, it governs every tool until you add a specific rule or pick a preset.
A site with no * rule of its own falls back to these built-in rules:
| Tool | Timeout | If no response | Mode | Push window |
|---|---|---|---|---|
Bash | 60s | Auto deny | push_first | 20s |
Write | 60s | Ask in terminal | push_first | 20s |
Edit | 45s | Ask in terminal | push_first | 20s |
Read | 0s | Auto approve | terminal_only | not used |
* | 60s | Ask in terminal | push_first | 20s |
Built-in Read uses the auto-approve shortcut, so file reads never interrupt you. Built-in Bash denies on timeout: if you do not approve a shell command, it does not run.
The hook keeps your policy in your temp folder as pushary-policy-v3-<hash>.json. On every tool call it asks Pushary whether those rules still apply, and keeps using them while they do for as long as Pushary allows: up to an hour, or 60 seconds while you or someone who answers your routes has phone calls set up, or while Pushary could not read part of your settings. Saving a change in the dashboard, a change to your plan and a new Pushary release each make the hook fetch the rules again on its next tool call, so a running agent uses the new rule without a restart. CLIs older than 1.9.239 fetch the rules again every 60 seconds.
Permission presets
A preset sets five capabilities for one agent, or for all agents: Read files, Edit and write files, Run shell commands, Reach the network, and Delete or force push.
| Preset | What the agent does on its own |
|---|---|
| Cautious | Reads. Asks before editing, running commands, or reaching the network |
| Balanced | Reads and edits. Asks before running commands or reaching the network |
| Autonomous | Works on its own. Asks only for network and destructive actions |
| Custom | Your own mix, set per capability |
Destructive actions always ask, whatever you choose, while your agent asks for permissions as usual. When it skips them, such as Claude Code with --dangerously-skip-permissions or Grok Build in Always-approve, the default is "Never stop me" and a preset asks only about the commands its rules name. Under Autonomous, git push and rm still ask, git -C "$(pwd)" push included from Pushary CLI 1.9.241 and, for calls the Pushary Mac app forwards, once Pushary's servers update, and a destructive step its rules do not name, such as git branch -D or git reset HEAD~1 --hard, runs. To be asked before a destructive step the preset does not name too, or an edit to a protected file such as .env or a CI workflow, pick "Stop me for risky steps" under "When your agent skips permissions" in Settings, Connections. An agent-specific preset takes effect once that agent's CLI is up to date. The All agents preset applies everywhere at once. A rule you write under Advanced can override a preset.
Set the mode from the command line
pushary mode changes the mode for the whole site:
npx -y pushary@latest mode push_only --for 30m # Always, for the next 30 minutes
npx -y pushary@latest mode status # show the current override
npx -y pushary@latest mode clear # back to your per-tool rulesWith --for, the mode is a temporary override that wins over every rule's own mode until it expires. Durations are <n>m or <n>h, up to 24 hours. Without --for, the command changes the mode of your * rule and stays until you change it. updates-only is accepted as another name for notify_only.
pushary wait <seconds> sets the push window of your * rule (0 to 300). pushary wait clear puts it back to 20 seconds.
Changing the mode or the push window from the command line needs a full-access key: create a new key with Create Key at pushary.com/dashboard/agent/settings. Keys that Pushary creates for your computer when you set it up run approvals and notifications, not account settings. With one of those, the command says so and tells you where to change it instead: the mode in the Pushary app or on the dashboard at pushary.com/dashboard/agent/policies, the push window on the dashboard at the same address. An edit on Policies changes your rules but does not end a temporary mode set with --for. A temporary mode ends on its own, when you pick a mode in the Pushary app, or with pushary mode clear and a full-access key. pushary mode status and pushary wait status work with the key setup gave you or a full-access key.
Teach-on-Tap: "always allow this tool"
When a question is about a specific tool, the decision page shows Always allow <tool>. Tapping it approves the current call and saves a rule so you are not asked again.
The rule is as narrow as Pushary can make it:
- For a shell command, it covers the command's first words. Approving
npm test -- --watchwritesBash(npm test:*). - For
Edit,WriteandMultiEdit, it covers the whole tool, except the files listed below that still ask.
Pushary does not save the rule for a command it rates destructive or high consequence, such as rm -rf or git push, or for one that hides what it runs, such as bash -c or eval. The current call is still approved. Under the hood the rule is timeoutSeconds: 0, timeoutAction: "approve", mode: "push_only", pushFirstSeconds: 0, which trips the auto-approve shortcut.
The rule applies to every agent on your site, in every project. Once you always allow Bash(npm test:*), every agent runs npm test without asking. Remove it any time in the policy editor.
On Team and Enterprise, a member's Always allow covers only that member's own agents, and a team rule for the same tool wins. An owner's or admin's Always allow is a team rule and covers every agent on the site. See Pushary Team.
An always-allow for all of Bash still asks when the command shows a real consequence: a force push, rm -r, git clean -f, throwing away uncommitted changes, publishing or deploying, a production deploy or migration, a SQL client that writes, gh pr merge, writing to a .env or secrets file, writing, copying onto, moving or deleting one of the files listed below that still ask for edits, such as echo x >> ~/.zshrc, cp ci.yml .github/workflows/ or sed -i s/a/b/ CLAUDE.md, or running downloaded code such as curl ... | sh. Reading those files still runs, such as cat .env or grep x CLAUDE.md, but a copy whose new name is protected asks, even a backup such as cp ~/.zshrc ~/.zshrc.bak or cp CLAUDE.md /tmp/backup. This holds in Claude Code and the agents that share its hook. Codex's own shell commands follow Codex's prompt and sandbox, as before, unless the mode in effect is Always, where Pushary asks about such a write on your phone. Everything else runs, including commits, tests, npx, inline scripts, git push, git push --dry-run, git clean -n and a plain rm or git rm of a file. To let one of the held commands run without asking, write a specific rule for it, such as Bash(docker push:*).
An always-allow for all of PowerShell or all of Monitor asks about the same consequences, except that PowerShell asks about a write to a .env or secrets file but not yet about the other files listed below. A Monitor command is judged exactly as the same Bash command would be. In PowerShell the held commands also include their PowerShell spellings: a recursive Get-ChildItem piped into Remove-Item, irm ... | iex or a downloaded script then run, Set-Content, Out-File, Copy-Item or Remove-Item on a .env file, Stop-Service and other service changes, Format-Volume, Clear-Disk and scheduled task changes. A plain Remove-Item file.txt, git push, Stop-Process, -WhatIf previews and every read such as Get-ChildItem still run.
An always-allow for all of Edit, Write, MultiEdit or NotebookEdit, a * rule that approves, or a preset that runs edits, still asks before an agent changes a file that changes what runs later or what an agent reads next: a .env or other secrets file, a CI workflow in .github/workflows or a composite action's action.yml or action.yaml in .github/actions or any folder under it (a root action.yml is not included), agent settings and hooks such as .claude/settings.json, .codex/config.toml or .mcp.json, .git/hooks and .git/config, anything in ~/.ssh, shell profiles such as ~/.zshrc and ~/.gitconfig, ~/.npmrc and ~/.kube/config, .envrc, .husky, and agent instructions: CLAUDE.md, AGENTS.md, GEMINI.md, QWEN.md, .claude/commands/, .claude/agents/, .claude/skills/, .gemini/commands/, .codex/prompts/, .cursor/rules/, .cursorrules, .github/copilot-instructions.md and .github/instructions/. Every other file runs. A relative path is read from the agent's working folder, so ../.zshrc asks like ~/.zshrc, and a Windows spelling of one of these files asks too, such as .env., CLAUDE.md with a trailing space, or .env::$DATA. A rule that approves after a wait does not approve one of these files when nobody answers: the call waits for a person. A glob such as Edit(**) counts as an always-allow here. To let one of these files run without asking, or approve on timeout, write a rule for its exact path, such as Edit(.env). The approval card for such a file does not offer Always allow, since it would not stop the asking. In In agent and Alert only, which send no question to your phone, Codex has no prompt of its own for such a patch, so Pushary refuses it and tells Codex the ways out: a rule for that exact file such as Edit(AGENTS.md), switching to Always or When away, or making the edit yourself. Trying again is refused the same way. In Alert only you also get an alert that the edit was refused. Through the Pushary Mac app that is one alert per file in each session every 10 minutes, however often Codex tries again; through the Pushary CLI it is one alert per try, within the limit of 10 notifications every 5 minutes. This is about Pushary's own rules. Claude Code still decides for itself where its own allow rules cover the edit and no Pushary rule for the tool does, in acceptEdits, plan, auto and dontAsk, and under Never stop me while permissions are off. In the terminal this needs CLI 1.9.215 or newer, CLI 1.9.219 for the relative paths, the Windows spellings, the delayed approvals and the files from GEMINI.md on, and CLI 1.9.222 for shell writes under an always-allow for Bash and the Codex refusal in In agent and Alert only.
Rule suggestions from Policy Autopilot
Pushary watches how you answer. After you answer the same tool pattern at least 5 times in 30 days, almost always the same way, it suggests an auto-approve or always-deny rule. Suggestions never apply themselves. Accept them under Policy Autopilot in the policy editor, which needs a paid plan, or from the terminal:
npx -y pushary@latest suggestions
npx -y pushary@latest suggestions accept <id>Like pushary mode, the suggestions command needs a full-access key. Create a new key with Create Key in Settings.
Approval routing sends a tool's approvals to a role or a named teammate. It is on the same page and needs the Team plan or above. Pushary Team shows how to set up a team and add a rule.
Risky steps need the keyboard
A risky step, such as rm -rf, git push --force or a step that does not match what you asked, can be approved away from the computer after a second confirm. A workspace owner or admin can keep those approvals at the computer instead: Agent settings, Connections tab, Risky steps need the keyboard. It is off by default and available on every agent plan.
With it on:
- A risky step from an agent connected through the Pushary CLI's hooks, MCP, the Server API, Pushary for Mac or an editor plugin can be approved only at the agent's own prompt, or in Pushary for Mac on the computer the agent runs on.
- This includes steps Pushary for Mac or an editor plugin forwards, the Codex auto-reviewer's rescue, blocked actions and a command Pushary could not check in full. On those, the web and Slack still show Approve, and the approve is refused with a message that your team approves risky steps at the computer.
- The Pushary app, the web, Slack and calls can still deny it. The web shows Deny and Handle on your machine and no Approve, Slack shows Deny and Open, and a call says you'll need to approve it at your computer.
- An agent with no prompt of its own, such as Hermes, OpenClaw or an n8n workflow, cannot get a risky step approved, and neither can a Server API question, which names no computer. You can deny those steps or let them time out. Leave the setting off for a workspace that runs them.
- A request that was already waiting when you turned it on still shows Approve. That approve is refused with a message that your team approves risky steps at the computer, and Deny still works. A request asked while the setting was on keeps showing no Approve after you turn it off; hand it back to the agent or approve it at the computer.
- If Pushary cannot read the setting when you approve, it refuses the approve and says it could not check, instead of guessing. The exception is a step Pushary for Mac or an editor plugin forwards, the Codex auto-reviewer's rescue, a blocked action or a command Pushary could not check in full: those are approved as they were before the setting covered them.
The setting stops Slack, one-tap links, the web and the phone. It trusts Pushary for Mac to say which computer it runs on, so a workspace member who scripts the API could still claim to be the agent's Mac. The audit trail records that claim as agent_computer.
Next steps
Stop a runaway agent
The kill switch denies every tool call in a session, even the ones your policy auto-approves.
Review recorded decisions
See which questions, approvals and denials reached the audit log.