There are security controls that undoubtedly sound like a safety net, but they end up acting like a trapdoor. For AI coding agents, it’s the approval prompt and the shortcuts people use to skip over it.
On November 9, 2026, Ars Technica reported on research from Apiiro showing that Claude Code is quietly leaking secrets onto public GitHub repositories. Fortunately or unfortunately, the mechanism is mundane, which is exactly why it matters: The leak can be plugged. Separately, our own research found that 10% of sessions ran in YOLO mode, a related but different control. In essence, users are trading oversight for speed and opening their employers up to risk in more than one way.
Defining the controls and their scopes
Both of these controls can be lumped together as “skipping the approval prompt,” but they carry different risks after implementation. Here’s how each one works:
- “Yes, and don’t ask again” is a saved allow rule. When a user approves a command and picks this option, Claude Code writes a rule for that command or pattern to .claude/settings.local.json. The permission is scoped only to the specified command and it persists on disk so Claude Code doesn’t have to ask permission to run the same command or pattern in future sessions. This is what Apiiro found leaking.
- YOLO mode is permissions prompts turned off. The user tells the agent to stop asking permission and run its tool calls without approval. According to the data, this is often scoped to the entire working session. This is what Sysdig identified.
How a single click exposed secrets on GitHub
When a user approves a shell command and clicks, “Yes, and don’t ask again,” Claude Code saves that choice as a rule. If that command had a database password, API token, or root login baked in, the secret will live in plain text in a config file.
That file is meant to stay local. Anthropic’s docs say it gets added to the developer’s global .gitignore, but security doesn’t move with the repository. If it’s cloned to another machine, or a folder is turned into a repository later, the file can get committed. Per Apiiro, Claude Code will sometimes commit changes to that file on its own.
Apiiro’s research says that more than 100,000 public repositories contained the local settings file, and about one percent of them, from 63 organizations, contained secrets. Of those, roughly 20% slipped past both gitleaks and TruffleHog. Deleting the file doesn’t fully fix it either, because forks keep the secrets alive.
Claude Code’s Boris Cherny said on Hacker News that these files should almost never be checked into a user’s git source control unless they were manually created and checked in. Related bug reports date back to August 2025 and were closed after 60 days of inactivity. The fix is coming, but your secrets are already out there, and there are steps you can take to remove them.
YOLO mode trades oversight for speed
In the report A First Look: Under the Hood of AI Agents published on November 4, we analyzed what agents were doing on 300+ devices at one organization over one month. Even though it was a single organization and not a representative sample, the patterns were hard to ignore.
In our data, 10% of sessions ran in YOLO mode, meaning the user turned permission prompts off for at least one call. But 98% of the time, prompts actually stayed off for the rest of the session. Looking at tool calls, 61% ran without a human approving them: nine percent in YOLO mode and 52% in auto mode. Auto mode is a classifier tuned to Anthropic’s threat model that screens each tool call in place of prompting a human for approvals. Only 19% of tool calls ran in default mode, where the agent stops and asks for approvals before continuing a session.
YOLO mode and the saved allow rule fail in different ways. YOLO mode turns prompts off for a session and removes the human from the loop. The saved allow rule that was leaking secrets saves a standing approval to disk, removing the human indefinitely. However, the root cause is the same: An approval is treated as a one-time convenience factor for the user when it should actually be a policy decision. In the Apiiro case especially, a click made at 4:55 p.m. on a Friday, while in a rush trying to get one stubborn script to run, becomes a permanent record.
While Cherny suggested auto mode was a better alternative to the saved allow rule because users could avoid “manually maintaining finicky allow/deny lists,” another practitioner noted that sensitive commands can still be saved to settings files in auto mode.
It’s likely that Claude will close the gaps that have been called out, but in the meantime, your secrets are already out there, so you need to do something about that.
Logs and scanners leave gaps
There are certainly benefits to using these controls, namely expediting workflows. However, the Sysdig and Apiiro research highlight gaps in the two safety nets security teams fall back on when approvals are skipped: scanning for secrets that leak and logs that show what the agent did.
First, secret scanners missed secrets. Apiiro found 215 secrets that gitleaks and TruffleHog missed. Scanning is worth doing, but it isn't a complete answer.
Second, you can’t trust an agent’s account of its own actions. In our data, when an agent read a credential file, the agent’s log had no record of the read 82% of the time. When an agent binary read a credential file, the frequency rose to 95%. Fortunately, the kernel saw it every single time. The agent writes the record and also happens to be the thing being audited, which is a conflict of interest that no auditor would otherwise accept from a human.
Put those together and there’s some serious risk exposure to manage. A single user may have long-lived credentials on a laptop, an agent running with standing approvals, and an audit record written by the agent itself. Whether the secret leaks through a public commit, poisoned MCP server, or malicious package, the agent inherits the user’s reach. Attackers only need to borrow it.
Securing AI agents without banning them
No organization should rush to ban the use of agents. This would only push employee usage out of sight. Instead, treat agents like what they are: fast, tireless, untrusted actors using human identities.
- Find the files. Search your organization’s repositories, including forks, for .claude/settings.local.json and similar agent config files. Rotate anything sensitive you find, because removing the file doesn’t revoke the secret and forks keep copies.
- Stop putting secrets directly in commands. If a command needs a credential, pass it through an environment variable or a secrets manager so it never lands in an approval rule.
- Block the file from git at the repo level. Don’t rely on a developer’s global gitignore. Add it to the repository’s .gitignore and enforce it with a pre-commit hook or push protection.
- Shrink the blast radius. Give agents scoped, short-lived credentials instead of long-lived files on laptops. Turning prompts off in a sandbox with throwaway credentials is reasonable. Turning them off on a laptop with your cloud keys isn’t.
- Verify at the kernel, not the agent log. Gate risky calls (credential paths, destructive commands, installs, new MCP servers) based on what they touch, and rely on runtime telemetry that the agent can’t edit as a source of truth.
- Decide if anyone should even have access to these controls. Determine whether your employees should have access to “don’t ask again” rules and YOLO mode at all, or whether to restrict them, for example by limiting them to specific employee groups or sandboxed environments, or enforcing a policy centrally where your tooling supports it.
The bottom line
Convenience features become an attack surface the moment they persist. This is a good reminder that security fundamentals still haven’t changed: least privilege, short-lived credentials, and runtime visibility. For AI agents these fundamentals just need to be applied to a new kind of user that works faster than you and never gets tired of clicking yes.
Want the full data behind the numbers above? Read A First Look: Under the Hood of AI Agents.












