Fixing Roo Code Auto-Approve Settings That Silently Run Commands the User Never Meant to Pre-Approve
Auto-approve was turned on for one specific, repetitive command — running the test suite, say — to skip a confirmation prompt that was getting clicked through dozens of times a day. Weeks later, a completely different and far more consequential command runs without any approval prompt at all, because the pattern that was meant to match one narrow case turned out to match a lot more than anyone noticed when it was written.
The Problem
Roo Code's auto-approve settings are configured to skip the confirmation prompt for a specific, frequently-run command — npm test, say — because clicking "approve" on the exact same safe command dozens of times a day had become pure friction. Some time later, a command that's clearly different and meaningfully more consequential — a destructive script, a deploy command, something that genuinely should have required a confirmation click — runs without any prompt appearing at all. Nobody changed the auto-approve setting in between; the original configuration, written for one narrow case, turns out to have matched something much broader than anyone realized at the time.
Why It Happens
Auto-approve patterns match by prefix or substring, not by exact command, so a rule written loosely covers more than the one command it was meant for
A pattern like npm or npm t added to an allow-list, intended to cover npm test specifically, also matches npm run build, npm publish, or any other command starting the same way — prefix or substring matching is a broader net than it looks like when the rule is first written with one specific command in mind, and the gap between "what I meant" and "what the pattern actually matches" doesn't become visible until a different command happens to trigger it.
Some auto-approve settings are scoped to a whole category of action, not to individual commands, so enabling one for convenience grants it to everything in that category
Roo Code's settings distinguish between broad categories like auto-approving file reads, file writes, command execution, or browser actions. Toggling "auto-approve execute command" on at the category level to stop re-confirming one trusted, routine command also silently auto-approves every other command that gets run afterward, within the same session or project, unless something more specific overrides it — the convenience toggle covers the entire category by design, not just the one command that motivated turning it on.
Allow and deny pattern precedence isn't always intuitive, so an added restriction doesn't necessarily override a broader rule the way it looks like it should
Adding a deny pattern for one specific dangerous command alongside an existing broad allow pattern doesn't automatically guarantee the deny takes precedence — depending on the exact rule-evaluation order and specificity rules in effect, a broad allow added earlier can still win over a narrower deny added later, producing exactly the opposite of what the deny rule was intended to accomplish.
The Fix
1. Read the actual auto-approve configuration directly, rather than relying on memory of what was intended when it was set up
// Roo Code settings (exact location varies by version/UI) —
// review every allow/deny pattern currently configured, not just
// the one remembered as having been added for a specific reason.
{
"allowedCommands": ["npm"],
"deniedCommands": []
}
Auto-approve configurations tend to accumulate over time as different conveniences get added for different reasons, and reviewing the actual current list — rather than trusting a mental model of "I only approved the test command" — is the only reliable way to see what's genuinely being matched today, as opposed to what was intended months ago.
2. Replace broad prefix patterns with precise, anchored matches for exactly the command intended
{
"allowedCommands": ["npm test", "npm run test:unit"]
// Rather than the broader "npm", which also matches
// npm run build, npm publish, npm install, and anything else
// starting with the same three letters.
}
Writing the allow pattern as the exact, complete command rather than a short prefix closes the specific gap that caused the problem — a pattern this precise genuinely can't match anything beyond the one command it names, removing the ambiguity a prefix match always carries.
3. Scope category-level auto-approve toggles down to the narrowest setting available, rather than the broadest convenience toggle
If the settings UI offers both a blanket "auto-approve all commands"
toggle and a more granular allow-list option, prefer the allow-list —
the blanket toggle trades convenience for exactly the kind of silent
over-approval this problem describes.
Where Roo Code's settings offer a choice between a broad category toggle and a more specific allow-list mechanism, the allow-list is almost always the safer choice for exactly this reason — it bounds what gets auto-approved to a known, reviewable set rather than an entire category of action.
4. Deliberately test that a command specifically NOT intended to be auto-approved actually still prompts for confirmation
After any change to allow/deny patterns, run one command that should
require confirmation and verify the prompt actually appears — don't
assume the deny-list or narrower allow pattern worked correctly
without confirming it with a real test case.
Because allow/deny precedence can behave unintuitively, the only way to be confident a given command is correctly still gated behind a confirmation prompt is to actually run it once and watch for the prompt — inferring it from reading the configuration alone risks missing exactly the kind of precedence surprise that caused the original problem.
Why This Works
A command running without the confirmation it should have required is never really a sign Roo Code's approval system is unreliable — it's a sign a pattern or category toggle, written with one specific command in mind, turned out to match a broader set than anyone checked at the time it was configured. Reading the actual current configuration rather than relying on memory, replacing broad patterns with exact matches, preferring granular allow-lists over category-wide toggles, and testing a should-still-prompt command directly together close the gap between what an auto-approve rule was meant to cover and what it actually covers.
Conclusion
A command running silently when it should have prompted for confirmation is an auto-approve pattern or category toggle matching more broadly than intended, not a flaw in the approval mechanism itself. Reviewing the actual configured patterns, writing exact rather than prefix-based matches, scoping toggles to the narrowest available setting, and testing directly that a command meant to still require confirmation actually does turns an invisible over-approval gap into an auto-approve configuration that matches exactly what it was meant to.
