autoMode settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.
Out of the box, the classifier trusts only the working directory and the current repo’s configured remotes. Actions like pushing to your company’s source-control org or writing to a team cloud bucket are blocked until you add them to autoMode.environment.
For how to enable auto mode and what it blocks by default, see Permission modes. This page is the configuration reference.
This page covers how to:
- Choose where to set rules across CLAUDE.md, user settings, and managed settings
- Define trusted infrastructure with
autoMode.environment - Override the block and allow rules when the defaults don’t fit your pipeline
- Inspect your effective config with the
claude auto-modesubcommands - Review denials so you know what to add next
Where the classifier reads configuration
The classifier reads the same CLAUDE.md content Claude itself loads, so an instruction like “never force push” in your project’s CLAUDE.md steers both Claude and the classifier at the same time. Start there for project conventions and behavioral rules. For rules that apply across projects, such as trusted infrastructure or organization-wide deny rules, use theautoMode settings block. The classifier reads autoMode from the following scopes:
| Scope | File | Use for |
|---|---|---|
| One developer | ~/.claude/settings.json | Personal trusted infrastructure |
| One project, one developer | .claude/settings.local.json | Per-project trusted buckets or services, gitignored |
| Organization-wide | Managed settings | Trusted infrastructure distributed to all developers |
--settings flag or Agent SDK | Inline JSON | Per-invocation overrides for automation |
autoMode from shared project settings in .claude/settings.json, so a checked-in repo cannot inject its own allow rules.
Entries from each scope are combined. A developer can extend environment, allow, and soft_deny with personal entries but cannot remove entries that managed settings provide. Because allow rules act as exceptions to block rules inside the classifier, a developer-added allow entry can override an organization soft_deny entry: the combination is additive, not a hard policy boundary.
The classifier is a second gate that runs after the permissions system. For actions that must never run regardless of user intent or classifier configuration, use
permissions.deny in managed settings, which blocks the action before the classifier is consulted and cannot be overridden.Define trusted infrastructure
For most organizations,autoMode.environment is the only field you need to set. It tells the classifier which repos, buckets, and domains are trusted: the classifier uses it to decide what “external” means, so any destination not listed is a potential exfiltration target.
Setting environment replaces the default environment list, which includes the entry that trusts the working repo and its remotes. Run claude auto-mode defaults to print the defaults, then include them alongside your own entries so you extend the list rather than narrow it.
- Organization: your company name and what Claude Code is primarily used for, like software development, infrastructure automation, or data engineering
- Source control: every GitHub, GitLab, or Bitbucket org your developers push to
- Cloud providers and trusted buckets: bucket names or prefixes that Claude should be able to read from and write to
- Trusted internal domains: hostnames for APIs, dashboards, and services inside your network, like
*.internal.example.com - Key internal services: CI, artifact registries, internal package indexes, incident tooling
- Additional context: regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky
Override the block and allow rules
Two additional fields let you replace the classifier’s built-in rule lists:autoMode.soft_deny controls what gets blocked, and autoMode.allow controls which exceptions apply. Each is an array of prose descriptions, read as natural-language rules. There is no autoMode.deny field; to hard-block an action regardless of intent, use permissions.deny, which runs before the classifier.
Inside the classifier, precedence works in three tiers:
soft_denyrules block firstallowrules then override matching blocks as exceptions- Explicit user intent overrides both: if the user’s message directly and specifically describes the exact action Claude is about to take, the classifier allows it even when a
soft_denyrule matches
Setting any of
environment, allow, or soft_deny replaces the entire default list for that section. If you set soft_deny with a single entry, every built-in block rule is discarded: force push, data exfiltration, curl | bash, production deploys, and all other default block rules become allowed. To customize safely, run claude auto-mode defaults to print the built-in rules, copy them into your settings file, then review each rule against your own pipeline and risk tolerance. Only remove rules for risks your infrastructure already mitigates.soft_deny when the defaults block something your pipeline already guards against with PR review, CI, or staging environments, or add to allow when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten: add to soft_deny for risks specific to your environment that the defaults miss, or remove from allow to hold a default exception to the block rules. In all cases, run claude auto-mode defaults to get the full default lists, then copy and edit: never start from an empty list.
environment alone leaves the default allow and soft_deny lists intact.
Inspect the defaults and your effective config
Because setting any of the three arrays replaces its defaults, start any customization by copying the full default lists. Three CLI subcommands help you inspect and validate. Print the built-inenvironment, allow, and soft_deny rules as JSON:
allow and soft_deny rules:
claude auto-mode defaults to a file, edit the lists to match your policy, and paste the result into your settings file. After saving, run claude auto-mode config to confirm the effective rules are what you expect. If you’ve written custom rules, claude auto-mode critique reviews them and flags entries that are ambiguous, redundant, or likely to cause false positives.
Review denials
When auto mode denies a tool call, the denial is recorded in/permissions under the Recently denied tab. Press r on a denied action to mark it for retry: when you exit the dialog, Claude Code sends a message telling the model it may retry that tool call and resumes the conversation.
Repeated denials for the same destination usually mean the classifier is missing context. Add that destination to autoMode.environment, then run claude auto-mode config to confirm it took effect.
To react to denials programmatically, use the PermissionDenied hook.
See also
- Permission modes: what auto mode is, what it blocks by default, and how to enable it
- Managed settings: deploy
autoModeconfiguration across your organization - Permissions: allow, ask, and deny rules that apply before the classifier runs
- Settings: the full settings reference, including the
autoModekey