Claude Code auto mode: it read our logs and wrote us a security policy
This week Claude Code offered to set up auto mode for us. Auto mode puts a classifier in front of tool calls where the permission prompt used to be. During setup it did something we hadn’t seen a harness do: it read the transcript history on the machine and proposed a security profile based on how the machine is actually used.
Not a template. A profile mined from evidence. A trimmed excerpt of what it wrote:
Environment
· Cloud provider(s): Google Cloud (gcloud used heavily; Firestore API contacted);
AWS CLI seen once, not established as primary
· Trusted internal domains: agenticcontrolplane.com, api.agenticcontrolplane.com,
cloud.agenticcontrolplane.com, calafia.ai (frequently contacted hosts in this
project's transcripts)
· Sensitive data locations: .env / .env.example / .env.production files found
across many sibling checkouts — treat any .env* file and gcloud secrets as
credential material
· Sensitive remote targets: any namespace, host, or container whose name carries
`prod` or `production` as a whole word or name segment
Extra soft blocks
· Bash(gcloud secrets:*) — scope to secret material reads/writes, given
secrets-manager marker found in sibling configs
It noticed which cloud we use and which one showed up once. It found the .env files in sibling checkouts and called them credential material. It flagged gcloud secrets for a soft block because it saw a secrets-manager marker in a neighboring repo. Where the evidence was thin, it said so: “not corroborated by usage in this repo.”
Starting from observed behavior instead of a blank config is how our own recommendation engine works too: watch what the agent does, then propose a rule a human confirms. Seeing the harness do it on-device at setup is good news. A control layer is becoming a basic part of the harness.
This post covers how auto mode works, because the details are easy to get wrong, and what a classifier in the harness leaves open.
How it works
The classifier is a second gate. A secondary model reviews tool calls instead of prompting you. The documented order:
- PreToolUse hooks fire on every tool call, whatever the permission settings.
- Permission rules (
permissions.allowandpermissions.deny) are checked. - The classifier runs last and decides whether the call goes ahead without a prompt.
For actions that must never run, permissions.deny in managed settings blocks before the classifier is asked.
The settings live under autoMode.*:
autoMode.environment: the trust profile, in prose. The classifier reads it as plain language to decide what counts as “external”: which repos, domains and buckets are inside the boundary, and where sensitive data lives.autoMode.allow: carve-outs from soft blocks.autoMode.soft_deny: destructive actions your intent can override, like force pushes and production deploys.autoMode.hard_deny: boundaries nothing overrides, with exfiltration rules as the usual example.autoMode.classifyAllShell: send every shell command to the classifier (v2.1.193+).
Where settings are read matters. The classifier takes autoMode only from user settings and managed settings, never from project files. A repo you cloned can’t give itself trust by shipping a .claude/settings.json. That blocks a real injection route.
It backs off. After 3 blocks in a row, or 20 in a session, the classifier goes back to prompting you. Organizations that don’t want the mode can remove it with permissions.disableAutoMode in managed settings.
Hooks still run. PreToolUse fires on every call, and a hook deny, by exit code 2 or a JSON permissionDecision: "deny", blocks the call even when an allow rule says yes. No allow path skips hooks. So with our hook installed, each call is still checked and logged, and can still be denied, with auto mode on. With the Claude Code plugin, auto mode sessions count as interactive for tier rules.
One caution. A hook that times out doesn’t block; the call continues through the normal permission flow. Recent Claude Code versions (2.1.295 and later) let a hook set onFailure: "block" if you want a stalled hook to stop the call.
What a classifier alone leaves open
We’ve worked under auto mode for several days. The gaps are as useful to know as the feature.
You can’t query what it decided. Classifier verdicts show up in the session transcript and a “Recently denied” tab. Recent versions attach a rule tag, such as [Data Exfiltration], which is a real improvement over the old fixed “Blocked by classifier”. But there’s no ledger to ask, next week, what the classifier allowed across your machines. For one developer that’s a small thing. For a team, your real policy is whatever each machine’s classifier decided, with no shared record.
Each machine builds its own profile. The profile mined from one machine’s history is that machine’s. Managed settings can push a shared autoMode config to a team, but two engineers who accept their own generated profiles can drift apart, and nothing diffs them.
It’s a model’s judgment. The environment profile is prose read by a model, not rules run by an engine. That’s why it’s flexible, and it also means the boundary can move with the classifier’s call on the day. So hard boundaries belong in permissions.deny, not in classifier prose. We’d add that anything you may need to show someone afterward, for an incident, an audit or a customer, belongs in a layer that writes one decision record per call.
Can the agent edit the file the classifier trusts? Settings reload mid-session, including permissions and hooks. We haven’t confirmed whether the agent can edit ~/.claude/settings.json, and we wouldn’t assume it can’t. The same goes for a hook: disableAllHooks turns hooks off, ours included, so a governance layer on the machine is only as strong as who controls that machine’s settings. We’ve written about why an agent shouldn’t be able to change its own controls.
Run both
None of this is a reason to skip auto mode. It marks where “a quieter attended session” ends and “a check you can point to later” begins.
Auto mode is for sessions where you’re at the keyboard. It cuts prompts. The empty-chair test still applies to what it doesn’t cover: unattended runs, a view across the team, a separate record, and a deny that says why.
Let the classifier make your sessions quieter. Keep a rules-based check on the tool call too, one that fires every time, writes a record the agent didn’t author, and applies the same rules on every machine in the workspace. By default ACP records calls and holds only the safety floor, so you choose what else to hold. The rules page has a rule for each of six things people worry an agent will do.
Running Claude Code? One command adds a hook. Each tool call is recorded, the session's model calls are priced, and a force-push, destructive SQL or curl | sh waits for your OK in the session.
curl -fsSL https://agenticcontrolplane.com/install.sh | bash
irm https://agenticcontrolplane.com/install.ps1 | iex
What the installer writes · Claude Code guide · free up to 5 agents