Make your AI coding agent ask you before risky changes
A four-step DueReason setup, about ten minutes: your AI coding agent asks on your phone before it pushes to main, deploys, drops a database or edits .env.
Updated · 6 min read
In short
- DueReason's "Recommended: ask me before risky changes" pack covers the handful of commands a non-developer running Claude Code or Cursor is actually afraid of: a push to main, a production deploy, a destructive database change, an .env edit or a recursive delete.
- Setup fills the approver group with you automatically, so a request never sits unanswered the way an empty group otherwise would, and the result screen walks you straight to turning on phone push.
- One command, `duereason-gate setup`, pastes your key on a hidden prompt, writes the policy to every repo at once, installs the hook even for a GUI-launched IDE with no shell PATH, and files one real test request so the first approval is real, not a demo.
- It is a guardrail against the agent, not a replacement for GitHub branch protection or Vercel's own production protection: anyone with shell access on the same machine can still remove the hook.
If you build your own app with Claude Code or Cursor, deploy it through Vercel, Supabase or GitHub, and are not a developer, the one thing you actually want is for your agent to ask you before it does something you cannot undo: pushing straight to main, deploying to production, dropping a table, or editing the .env file that holds your secrets. DueReason's "Recommended: ask me before risky changes" pack gets you there in about ten minutes, end to end on your phone.
Four steps, about ten minutes
- Sign up and say what you're protecting. Once you verify your email, the onboarding question "What will you use DueReason for first?" has an option for exactly this: "Make my AI coding agent (Claude Code, Cursor) ask me before risky changes." It drops you straight onto Settings > Agent gate with the right template already picked.
- Set up the gate from one page. The "Recommended: ask me before risky changes" template is preselected and badged *Recommended*. Name the API key (or keep the default, "Agent gate") and click Set up. DueReason creates the action, a one-step approval workflow on a group called "Agent approvers", and -- because that group starts empty -- adds you, the person running setup, as its only member, so a request never sits with nobody to answer it. You get the one-time API key, the generated
.duereason/gate.ymlpolicy and an install snippet for your harness. - Get it on your phone. The same screen shows a QR code to Settings > Notifications, an inline reminder for iOS (Safari > Share > Add to Home Screen is what turns push on there) and a button to send yourself a test notification. Email is already on as a fallback, so nothing is missed while push is still off. An optional, off-by-default toggle on the same screen, "Approve/Decline in notifications", lets you decide straight from the lock screen instead of opening the console first -- turning it on is your own explicit click, never automatic.
- Run one command in your terminal. Paste the one-time key when
duereason-gate setup --org your-slug --preset safety-pack --harness claude-code(or--harness cursor) asks for it on a hidden prompt -- it never lands in your shell history, argv or any log. The command writes the policy to~/.config/duereason/gate.ymlso it covers every repo your agent touches, not only the one you happen to be in; installs the Claude Code or Cursor hook at user scope using the real path of the running binary, so it still works when the IDE was launched from the Dock with no shell PATH at all; and makes sure the folder where approved grants get cached,.duereason/grants/, is excluded from git so an agent's owngit add -Acan never commit it. It finishes by filing one real test request and waiting up to ten minutes for you to approve it on your phone or by email, through the same check every later call goes through -- so this is already your first approved agent action, not a dry run.
What the safety pack asks about today
- Pushing straight to
mainormaster - Force-pushing, or discarding commits with
git reset --hard - Deploying to production on Vercel or Netlify
- Dropping, truncating or bulk-deleting data:
supabase db reset, a DROP/TRUNCATE/DELETE FROM statement,prisma migrate reset,drizzle-kit push/drop, or a Supabase MCP call that can change or delete data - Writing, editing or shell-touching a
.envfile - Changing environment variables or secrets on Vercel or Supabase
- Deleting files recursively (
rm -rfand its spellings)
Each one waits for your approval, for up to 15 minutes, before the agent's command actually runs.
What it doesn't cover yet
- Reading a `.env` file. Claude Code's own Read tool is never gated, and only its Bash, Write, Edit and MultiEdit calls are -- so the agent can still read your secrets to use them, just not edit that file through a gated path unnoticed.
- Cursor's own file edits. Cursor wires the gate into
beforeShellExecutionandbeforeMCPExecutiononly today; an edit to.envmade through Cursor's own editor, rather than a shell command, is not caught. The shell-command rule above still catchescat,cp,mv,rm,sed,teeor a redirect touching.envfrom a terminal. - Anyone with shell access to the same machine. There's no uninstall command yet; removing the hook means deleting the entry duereason-gate added to
~/.claude/settings.jsonor~/.cursor/hooks.json, or editing~/.config/duereason/gate.ymlby hand. The gate is a guardrail against the *agent*: it only runs where the harness itself calls it, and whoever has a terminal on that machine can bypass it the same way they could bypass any other local script.
That second point is why the in-agent gate is a guardrail, not the whole answer. For the boundary that survives a bypassed or never-installed gate, pair it with GitHub's own branch protection on main, Vercel's production deploy protection, and Supabase's own project permissions; see stop AI agents from deploying without approval for how the two layers fit together.
Turning it off
There is no disable switch. To stop the gate from asking, remove the hook entry duereason-gate added to ~/.claude/settings.json (Claude Code) or ~/.cursor/hooks.json (Cursor), or delete ~/.config/duereason/gate.yml so nothing matches any more. Either change takes effect on the agent's next tool call, with nothing to restart.
Questions
- Can my own agent's request get approved by me, the person who set it up?
- Yes, and for a one-person setup that's the point: the rule that refuses someone approving their own request only applies when the requester is a signed-in user, and a gate request comes from the agent's API key instead. For a team where someone other than the requester should always decide, add a second person to "Agent approvers" rather than leaving yourself as the only member.
- What if I'm not near my phone?
- Email is on by default and reaches every member of "Agent approvers", so push is a convenience on top of it, not a requirement. Turn push on from the same "Get it on your phone" panel once you've confirmed email is reaching you.
- Does duereason-gate setup work with harnesses other than Claude Code and Cursor?
- Not the one-command setup yet -- it only accepts --harness claude-code or --harness cursor. Settings > Agent gate still generates the same policy and a manual install snippet (npm install, two export lines, duereason-gate install) for Windsurf, Hermes, OpenCode, Codex, Gemini CLI, a git pre-push hook and a standalone MCP proxy; it just takes a few more copy-paste steps than the one command.
- I'm self-hosting DueReason instead of using the cloud. Does this still work?
- Yes: pass --url followed by your instance's address to duereason-gate setup, or set DUEREASON_URL in the credentials file by hand. The policy, the hook install and the test request all work the same way either way.
Give your agent a safety pack in ten minutes
Sign up, pick "Make my AI coding agent ask me before risky changes" on the first screen, and you'll have an approved test request on your phone before the coffee's cold.
Start for freeSources
This guide explains the regulation as we read it; it is not legal advice. Check the official text and your national law, which may add obligations.