modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -59,7 +59,7 @@ * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or the classifier reads a visibility check earlier in the conversation showing it is public. In the classifier requests sent by Claude Code itself, the classifier reads your messages and the commands Claude runs, not their output. The evidence has to be something the classifier can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. + * **Repository visibility** : a repository is assumed private unless the classifier has evidence that it’s public, such as its remote host and name. To tell the classifier yourself, name the repository as public in this entry or in your message. * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management**
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -115,7 +115,7 @@ } } -You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. +A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. ## Generate environment entries with `/auto-mode-setup` @@ -341,6 +341,7 @@ If a denial shows one of these names, the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) blocked the call and gave a broad policy as its reason: * `[Destructive or Unwanted Actions]` + * `[Sensitive Information Leakage]` * `[Unauthorized Access]` * `[Undermining Oversight]` * `[Unsanctioned Communication]`
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,4 +1,4 @@ -[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks what it judges irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. This page is the configuration reference. Turning auto mode on and off is covered on the Permission modes page: @@ -35,7 +35,7 @@ ---|---|--- Prompt before the action| `permissions.ask`| By default, prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. Never run the action| `permissions.deny`| Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. -One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. Use an ask or deny rule for a durable guarantee. +One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions it reviews, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. To keep the boundary from being lost, use an ask or deny rule instead. ## Where the classifier reads configuration
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -257,7 +257,8 @@ ... ], "soft_deny": [ - "Git Destructive [named+specifics — **must name:** the destructive operation and its target]: Force pushing (`git push --force`), deleting remote branches, tags, or releases, or rewriting remote history. Also `git commit --amend` when the commit being rewritten is not the agent's own unpushed work: either no prior `git commit` is visible (HEAD pre-dates the session), or a `git push` of the current branch is visible after the most recent commit (it has been pushed). Clears when the user asked to amend/reword/fixup, or when it is a message-only reword (`--amend -m …`, nothing newly staged) of a commit the agent visibly created this session.", + ... + "Production Deploy [named+specifics — **must name:** the production target]: Deploying to production/a production service or running production database migrations", ... ], "hard_deny": [...],
modified
Show diff (130 lines)
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -49,7 +49,7 @@ The classifier doesn’t read `autoMode` from project settings in `.claude/settings.json` or `.claude/settings.local.json`. Both files live in the repo directory, so a checked-in repo or a build step could otherwise inject its own allow rules. Move any `autoMode` block in `.claude/settings.local.json` to `~/.claude/settings.json`. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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](</docs/en/permissions>). 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 can’t be overridden. +The classifier is a second gate that runs after the [permissions system](</docs/en/permissions>). To block Claude’s [matching calls](</docs/en/permissions#bash-rule-limits>) before the classifier runs, use `permissions.deny` in managed settings. ## Define trusted infrastructure @@ -85,7 +85,7 @@ } } -After you save your settings, run `claude auto-mode config` to confirm the effective rules include your entries. Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers: +After you save your settings, run `claude auto-mode config` to confirm the rules include your entries. Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers: * **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 @@ -144,7 +144,7 @@ * Claude Code includes `"$defaults"` in each of the `allow`, `soft_deny`, and `hard_deny` lists the draft adds entries to, unless you already wrote an `allow` list without it, so the built-in rules you haven’t replaced stay in effect * After saving, Claude Code offers to remove `permissions.allow` rules in `~/.claude/settings.json` that auto mode ignores, such as `Bash(*)`, or that auto-approve destructive commands -Then run `claude auto-mode config` to see the effective result. +Then run `claude auto-mode config` to see the result. ### Turn off `/auto-mode-setup` @@ -170,7 +170,7 @@ ## Override the block and allow rules -Three additional fields let you replace the classifier’s built-in rule lists: +To add to the classifier’s built-in rules, set any of three additional fields and include the literal string `"$defaults"` in its list: * `autoMode.hard_deny`: actions to block even when the user asks for them * `autoMode.soft_deny`: destructive actions that user intent can clear @@ -185,9 +185,9 @@ * `hard_deny` rules block unconditionally. User intent and `allow` exceptions don’t apply. * `soft_deny` rules block next. User intent and `allow` exceptions can override these. * `allow` rules then override matching `soft_deny` rules as exceptions. - * Explicit user intent overrides the remaining soft blocks: 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_deny` rule matches. - -General requests don’t count as explicit intent. Asking Claude to “clean up the repo” doesn’t authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for actions to block even when the user asks for them. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. The following example keeps the defaults in all four lists and adds organization-specific rules to each. + * Explicit user intent overrides the remaining soft blocks: 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_deny` rule matches. General requests don’t count as explicit intent. Asking Claude to “clean up the repo” doesn’t authorize force-pushing, but asking Claude to “force-push this branch” does. + +To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for actions to block even when the user asks for them. The following example keeps the defaults in all four lists and adds organization-specific rules to each. { "autoMode": { @@ -212,12 +212,9 @@ } } -Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. If you set an array without `"$defaults"`, you discard the built-in rules for that section: - - * `soft_deny`: every built-in soft block rule, including force push, `curl | bash`, production deploys, and auto-mode bypass - * `hard_deny`: the built-in data exfiltration rule - -Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that 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. +Include `"$defaults"` in every list you set, so you don’t lose any built-in rules it holds. + +Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. ## Edit rules from `/permissions` @@ -227,7 +224,7 @@ ## Suspend shell allow rules -By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend your Bash and PowerShell allow rules while auto mode is active, and in [plan mode while the classifier reviews commands](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier reviews the code that runs the commands, even with this setting on. +In auto mode, Claude Code drops [broad allow rules](</docs/en/permission-modes#how-the-classifier-evaluates-actions>) such as `Bash(*)`. By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). A narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend your Bash and PowerShell allow rules while auto mode is active, and in [plan mode while the classifier reviews commands](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier reviews the code that runs the commands, even with this setting on. { "autoMode": { @@ -239,11 +236,15 @@ ## Inspect the defaults and your effective config -The `claude auto-mode` subcommands help you inspect, validate, and reset your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: +The `claude auto-mode` subcommands help you inspect, validate, and reset your configuration. Print the `environment`, `allow`, `soft_deny`, and `hard_deny` rules built into Claude Code: claude auto-mode defaults -To read one rule’s full wording without piping through `jq`, pass `--label` with the start of the rule’s label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule’s label, and sections with no match print as empty lists. Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: +To read one rule’s full wording without piping through `jq`, pass `--label` with the start of the rule’s label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule’s label, and sections with no match print as empty lists. + +While `/status` in auto mode shows [`Auto mode server`](</docs/en/permission-modes#server-side-classifier-review>) as `Enabled`, the server’s built-in rules can differ from this output, and no `claude auto-mode` subcommand prints them. + +Print the four lists, with your settings applied where set and defaults otherwise: claude auto-mode config @@ -324,15 +325,32 @@ * **Recently blocked tab** : highlight the action’s row. In [screen reader mode](</docs/en/accessibility>), every command and input appears before the list. * **Hook** : to capture the exact input of denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. If your hook reads `reason`, expect no `Auto mode:` prefix, and text such as `Blocked by classifier` instead of `No reason provided`. - * **Conversation** : find the tool call. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. + * **Conversation** : find the tool call. If the call appears shortened or folded into a summary line, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>). The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a `Blocked by auto mode` line means the classifier judged the call unsafe. To let the call through, take the step that matches what Claude was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. - * A command you want to run without review from now on: add an `allow` rule. + * A command you want allowed from now on: add an `allow` rule. * A one-off action you did intend: state that intent in your next message and let Claude retry. -You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The text in square brackets, such as `[Data Exfiltration]`, is the name of the rule the classifier matched. To read that rule’s full wording, see Inspect the defaults and your effective config. +You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The text in square brackets names what the classifier matched. If it’s a rule built into Claude Code, pass its name without the brackets to `claude auto-mode defaults --label` to read the full wording. + +### Fix `Destructive or Unwanted Actions` and other policy denials + +If a denial shows one of these names, the [server-side classifier](</docs/en/permission-modes#server-side-classifier-review>) blocked the call and gave a broad policy as its reason: + + * `[Destructive or Unwanted Actions]` + * `[Unauthorized Access]` + * `[Undermining Oversight]` + * `[Unsanctioned Communication]` + +The policy name is only a category, and `claude auto-mode defaults` doesn’t list its wording. Read the blocked call in the conversation, or run `/permissions` in your terminal session and look under **Recently blocked**. If it’s what you meant Claude to do, give the classifier more context: + + * **For this call only** : tell Claude to do it, naming the action and its target, such as “overwrite `data/seed.json`” + * **For a destination you trust, such as a package registry** : add it to `autoMode.environment` + * **For a routine action you want allowed from now on** : describe it in an `autoMode.allow` entry + +After you add an entry, ask Claude to retry so the classifier checks the call again. ### Fix repeated denials
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -178,7 +178,7 @@ Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). -In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier applies `hard_deny` and `soft_deny` when it reviews Claude’s code, and not to each tool call the code makes. `permissions.deny` rules apply to each call. +In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier applies `hard_deny` and `soft_deny` to each piece of code as a whole, before the code runs. To block a specific tool call that the code makes, use a `permissions.deny` rule. Inside the classifier, precedence works in four tiers:
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -14,11 +14,11 @@ ## Common boundaries -Auto mode allows pushes to any branch of the repository you’re working in, including the default branch, and pull request creation by default. A non-default branch whose name marks it as a deploy or publication target, such as `production`, `release`, or `gh-pages`, isn’t covered by that default: the classifier judges a push there on its own terms, including as a production deploy. The push’s content is also still checked, so a force push, a secret entering the commit, or a change that would send secrets outside the repository when CI or a deploy pipeline runs it stays blocked. If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. +By default in auto mode, Claude can push to the repository you’re working in, including its default branch, without a prompt. It can also open pull requests there when your task asks for one. Some pushes and pull requests [are blocked](</docs/en/permission-modes#what-the-classifier-blocks-by-default>), such as a push with a secret or a pull request to another repository. If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. ### Add a human checkpoint -The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#where-settings-live>): +The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). The ask rules below are evaluated before the classifier, so by default you see a prompt. Add the rules in your [settings](</docs/en/settings#where-settings-live>): { "permissions": { @@ -33,7 +33,7 @@ Boundary| Mechanism| Behavior in auto mode ---|---|--- -Prompt before the action| `permissions.ask`| Always prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. +Prompt before the action| `permissions.ask`| By default, prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. Never run the action| `permissions.deny`| Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. Use an ask or deny rule for a durable guarantee. @@ -66,10 +66,10 @@ * **CI/CD deploy targets** * **Network posture** * **Host containment** : defaults to an ordinary developer machine or CI runner with open internet. If Claude Code runs in a container, VM, or pod with an egress allow-list or neighbors it must not touch, name the allowed hosts, whether the cloud metadata endpoint should be reachable, and which cloud project, cluster, or registry the task uses and under what identity. Until this entry names that identity, the classifier [blocks](</docs/en/permission-modes#what-the-classifier-blocks-by-default>) requests for the host’s own credentials. Requires Claude Code v2.1.257 or later - * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them + * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets default until you name them * **Data retention / declassification** * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. - * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. + * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. By default, a host or namespace counts as a sensitive remote target when `prod` or `production` is a whole word in its name. For example, `prod-db` counts and `webprod01` doesn’t. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services. @@ -94,7 +94,7 @@ * **Key internal services** : CI, artifact registries, internal package indexes, incident tooling * **Internal package registry** : the private npm, PyPI, or other registry that installs should route through, so installs that bypass it for a public registry get blocked * **Sensitive data locations & audiences**: the buckets, databases, or paths that hold personal data, confidential business data, credentials, regulated data, or similarly sensitive material, and the audiences that data in each location may be shared with, so the classifier protects those locations instead of guessing from content. - * **Sensitive remote targets** : the namespaces, hosts, or containers that count as production, so remote shells and port-forwards into them need your explicit approval + * **Sensitive remote targets** : the namespaces, hosts, or containers that count as production * **Protected IaC scopes** : the infrastructure resources whose apply or destroy should always require you to name the change * **Additional context** : regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky @@ -176,7 +176,11 @@ * `autoMode.soft_deny`: destructive actions that user intent can clear * `autoMode.allow`: exceptions to soft block rules -Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). Inside the classifier, precedence works in four tiers: +Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). + +In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier applies `hard_deny` and `soft_deny` when it reviews Claude’s code, and not to each tool call the code makes. `permissions.deny` rules apply to each call. + +Inside the classifier, precedence works in four tiers: * `hard_deny` rules block unconditionally. User intent and `allow` exceptions don’t apply. * `soft_deny` rules block next. User intent and `allow` exceptions can override these. @@ -217,11 +221,13 @@ ## Edit rules from `/permissions` -To view and edit classifier rules and `environment` entries without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. - -## Route all shell commands through the classifier - -By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list, except [critical-path removals](</docs/en/permission-modes#critical-paths>). +To view and edit classifier rules and `environment` entries without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) in the CLI and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. + +In the desktop app, `/permissions` has no **Auto mode** tab. In a local, WSL, or SSH session, edit the `autoMode` block in `~/.claude/settings.json` on the machine or WSL distribution where the session runs. + +## Suspend shell allow rules + +By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend your Bash and PowerShell allow rules while auto mode is active, and in [plan mode while the classifier reviews commands](</docs/en/permission-modes#analyze-before-you-edit-with-plan-mode>). In a [Code Mode](</docs/en/code-mode#permission-checks>) session, the classifier reviews the code that runs the commands, even with this setting on. { "autoMode": { @@ -229,7 +235,7 @@ } } -This trades latency for coverage: a command that an allow rule would have approved instantly now waits for a classifier decision, and each shell command counts as a classifier call. The setting applies only while auto mode is active, and your allow rules behave normally in other permission modes. +In auto mode and plan mode, commands that only an allow rule would have approved take longer, because each waits for a classifier decision. ## Inspect the defaults and your effective config @@ -272,6 +278,8 @@ The command summarizes what it will remove and asks `Reset auto mode configuration to defaults?` before writing; pass `--yes` to skip the confirmation. Reset changes only `~/.claude/settings.json`: `autoMode` rules from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag still apply. ## Review denials + +In the desktop app, `/permissions` has no **Recently blocked** tab. To let Claude retry an action you did intend, [name the action and its specifics](</docs/en/permission-modes#approvals-you-state-in-conversation>) in your next message. To let Claude retry a blocked action, use the **Recently blocked** tab in `/permissions`:
modified
Show diff (209 lines)
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -12,19 +12,11 @@ * Generate environment entries with `/auto-mode-setup` * Review denials so you know what to add next -## - -​ - -Common boundaries +## Common boundaries Auto mode allows pushes to any branch of the repository you’re working in, including the default branch, and pull request creation by default. A non-default branch whose name marks it as a deploy or publication target, such as `production`, `release`, or `gh-pages`, isn’t covered by that default: the classifier judges a push there on its own terms, including as a production deploy. The push’s content is also still checked, so a force push, a secret entering the commit, or a change that would send secrets outside the repository when CI or a deploy pipeline runs it stays blocked. If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. -### - -​ - -Add a human checkpoint +### Add a human checkpoint The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#where-settings-live>): @@ -45,11 +37,7 @@ Never run the action| `permissions.deny`| Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. Use an ask or deny rule for a durable guarantee. -## - -​ - -Where the classifier reads configuration +## Where the classifier reads configuration The classifier reads the same [CLAUDE.md](</docs/en/memory>) 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 the `autoMode` settings block. The classifier reads `autoMode` from the following scopes: @@ -63,11 +51,7 @@ The classifier is a second gate that runs after the [permissions system](</docs/en/permissions>). 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 can’t be overridden. -## - -​ - -Define trusted infrastructure +## 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. `claude auto-mode defaults` prints three kinds of environment entry. @@ -133,21 +117,13 @@ You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. -## - -​ - -Generate environment entries with `/auto-mode-setup` +## Generate environment entries with `/auto-mode-setup` Run `/auto-mode-setup` to have Claude Code draft `autoMode.environment` entries, and sometimes rule entries too, from your project and your recent sessions in it. If you accept the draft, Claude Code writes it to `~/.claude/settings.json`. `/auto-mode-setup` is available on Pro, Max, Ultra, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, Ultra, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see `/auto-mode-setup` returns “Unknown command”. -### - -​ - -What `/auto-mode-setup` reads +### What `/auto-mode-setup` reads If `~/.claude/settings.json` already holds `autoMode` entries, Claude Code starts by asking whether to add to your environment list or replace it, and keeps the rules you wrote either way. Claude Code then asks how you use this project and offers two optional scans before it scans anything. In the scan, Claude Code always reads these sources: @@ -160,11 +136,7 @@ * The first word of each command in your shell history * The remote hosts and names of the repositories under your home directory -### - -​ - -Review and save the draft +### Review and save the draft Claude Code scans in the background, then shows you the draft. You accept or discard it as a whole, so edit `~/.claude/settings.json` afterwards to adjust single entries. When you accept, Claude Code writes the draft and reconciles it with the settings you already have: @@ -174,11 +146,7 @@ Then run `claude auto-mode config` to see the effective result. -### - -​ - -Turn off `/auto-mode-setup` +### Turn off `/auto-mode-setup` Once auto mode has blocked several actions and you still have no `autoMode.environment` entries, Claude Code shows a dialog titled “Teach auto mode about your environment?” at the end of a turn and offers to run `/auto-mode-setup` for you. To stop the offer but keep the command, select **Don’t show again** in that dialog. To turn off both the command and the offer, add this [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to `~/.claude/settings.json`: @@ -190,11 +158,7 @@ `/auto-mode-setup` is a built-in command rather than a [bundled skill](</docs/en/skills#bundled-skills>), so this `skillOverrides` entry still applies to it, but [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) doesn’t turn it off. -### - -​ - -`/auto-mode-setup` returns “Unknown command” +### `/auto-mode-setup` returns “Unknown command” If typing `/auto-mode-setup` at the Claude Code prompt prints `Unknown command: /auto-mode-setup`, check for these causes: @@ -204,11 +168,7 @@ In a [cloud session](</docs/en/claude-code-on-the-web>), the command prints `/auto-mode-setup isn't available in this environment.` instead. Run it in an interactive session in your terminal. -## - -​ - -Override the block and allow rules +## Override the block and allow rules Three additional fields let you replace the classifier’s built-in rule lists: @@ -255,19 +215,11 @@ Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that 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. -## - -​ - -Edit rules from `/permissions` +## Edit rules from `/permissions` To view and edit classifier rules and `environment` entries without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. -## - -​ - -Route all shell commands through the classifier +## Route all shell commands through the classifier By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list, except [critical-path removals](</docs/en/permission-modes#critical-paths>). @@ -279,11 +231,7 @@ This trades latency for coverage: a command that an allow rule would have approved instantly now waits for a classifier decision, and each shell command counts as a classifier call. The setting applies only while auto mode is active, and your allow rules behave normally in other permission modes. -## - -​ - -Inspect the defaults and your effective config +## Inspect the defaults and your effective config The `claude auto-mode` subcommands help you inspect, validate, and reset your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: @@ -323,11 +271,7 @@ The command summarizes what it will remove and asks `Reset auto mode configuration to defaults?` before writing; pass `--yes` to skip the confirmation. Reset changes only `~/.claude/settings.json`: `autoMode` rules from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag still apply. -## - -​ - -Review denials +## Review denials To let Claude retry a blocked action, use the **Recently blocked** tab in `/permissions`: @@ -366,11 +310,7 @@ * **The row reads`This row can't be approved here`**: if you intended the action, tell Claude in your next message and Claude may try it again * **No row, and`Not run` or a classifier error in the conversation**: auto mode’s classifier gave no verdict. To see how to run the action, read [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) -### - -​ - -Fix a denial with an allow rule, an environment entry, or a retry +### Fix a denial with an allow rule, an environment entry, or a retry Notices read like `bash blocked by auto mode · /permissions · Auto mode: [Data Exfiltration]`. To read the command or URL behind one, use the **Recently blocked** tab, a hook, or the conversation: @@ -386,19 +326,11 @@ You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The text in square brackets, such as `[Data Exfiltration]`, is the name of the rule the classifier matched. To read that rule’s full wording, see Inspect the defaults and your effective config. -### - -​ - -Fix repeated denials +### Fix repeated denials Repeated denials for the same destination usually mean the classifier is missing context. Add that destination to `autoMode.environment`, or run `/auto-mode-setup` to have Claude Code draft the entries, then run `claude auto-mode config` to confirm the change took effect. -## - -​ - -See also +## See also * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and which sessions start in it * [Managed settings](</docs/en/server-managed-settings>): deploy `autoMode` configuration across your organization
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -168,7 +168,7 @@ Claude Code scans in the background, then shows you the draft. You accept or discard it as a whole, so edit `~/.claude/settings.json` afterwards to adjust single entries. When you accept, Claude Code writes the draft and reconciles it with the settings you already have: - * Claude Code writes the `environment` list without `"$defaults"`, because the draft spells out the built-in entries it left unchanged + * If you chose to add to the `environment` list in `~/.claude/settings.json`, you keep any `"$defaults"` entry in it. If you chose to replace that list, you lose that entry, so add `"$defaults"` back if you want the default entries * Claude Code includes `"$defaults"` in each of the `allow`, `soft_deny`, and `hard_deny` lists the draft adds entries to, unless you already wrote an `allow` list without it, so the built-in rules you haven’t replaced stay in effect * After saving, Claude Code offers to remove `permissions.allow` rules in `~/.claude/settings.json` that auto mode ignores, such as `Bash(*)`, or that auto-approve destructive commands @@ -212,7 +212,7 @@ Three additional fields let you replace the classifier’s built-in rule lists: - * `autoMode.hard_deny`: unconditional security boundaries + * `autoMode.hard_deny`: actions to block even when the user asks for them * `autoMode.soft_deny`: destructive actions that user intent can clear * `autoMode.allow`: exceptions to soft block rules @@ -223,7 +223,7 @@ * `allow` rules then override matching `soft_deny` rules as exceptions. * Explicit user intent overrides the remaining soft blocks: 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_deny` rule matches. -General requests don’t count as explicit intent. Asking Claude to “clean up the repo” doesn’t authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for security boundaries that must never be crossed. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. The following example keeps the defaults in all four lists and adds organization-specific rules to each. +General requests don’t count as explicit intent. Asking Claude to “clean up the repo” doesn’t authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for actions to block even when the user asks for them. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. The following example keeps the defaults in all four lists and adds organization-specific rules to each. { "autoMode": { @@ -239,7 +239,7 @@ "soft_deny": [ "$defaults", "Never run database migrations outside the migrations CLI, even against dev databases", - "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow" + "Running terraform apply in infra/terraform/prod/ needs an explicit request: production infrastructure changes go through the review workflow" ], "hard_deny": [ "$defaults",
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -329,7 +329,42 @@ Review denials -To review and retry actions the auto mode classifier denied, open `/permissions` and select the **Recently denied** tab, where Claude Code records each denial. 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. When the classifier produces [no verdict on the action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), because a safety check separate from auto mode refused the classifier’s own request or its response didn’t parse, Claude Code denies the action without recording it under **Recently denied**. The linked error entry covers what Claude is told and how to run the action if you need it. +To let Claude retry a blocked action, use the **Recently blocked** tab in `/permissions`: + +1 + +Open the tab + +Run `/permissions` in your session to open the permissions dialog, then select the **Recently blocked** tab. + +2 + +Check the action + +Highlight the action’s row and read its command or input below the list. Go by the command or input, not the row’s description, which Claude or the tool wrote. + +3 + +Approve the action + +Press `r` to approve the action and let Claude retry it. + +4 + +Close the dialog + +Press `Esc` to close the dialog and apply your approval. If Claude was working when you opened `/permissions`, send a message once Claude finishes to let Claude retry the action. Otherwise, you don’t need to send anything: Claude continues now and may retry it. If it doesn’t, name the action in your next message, as [Approvals you state in conversation](</docs/en/permission-modes#approvals-you-state-in-conversation>) describes. + +Approving an action doesn’t add a permission rule. In auto mode, a retried action goes through the check again, so it can be blocked again. To let a command through from now on, add an `allow` rule. If you don’t want Claude to retry right away, you can approve an action for later, take back an approval, or close the dialog and discard your approvals: + + * **Approve for later** : press `Enter` on the row, then `Esc`. The row leaves the tab, and Claude may retry the action after your next message once Claude finishes. If you also pressed `r` on another row, the row where you pressed `Enter` stays on the tab and Claude isn’t told about that action. Approve that row on your next visit, or press `r` on both + * **Take back an approval** : before you press `Esc`, press `Enter` on the row, whether you approved it with `Enter` or `r` + * **Close the dialog and discard your approvals** : press `Ctrl+C` twice + +You can’t approve an action from the tab when its row can’t show all of its command or input, or when the action has no row: + + * **The row reads`This row can't be approved here`**: if you intended the action, tell Claude in your next message and Claude may try it again + * **No row, and`Not run` or a classifier error in the conversation**: auto mode’s classifier gave no verdict. To see how to run the action, read [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) ### @@ -337,13 +372,13 @@ Fix a denial with an allow rule, an environment entry, or a retry -To read the command or URL behind a notice such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, use the **Recently denied** tab, a hook, or the conversation: - - * **Recently denied tab** : in the `/permissions` dialog, highlight a denied Bash or PowerShell action to read its command below the list. In [screen reader mode](</docs/en/accessibility>), all the commands appear before the list instead. - * **Hook** : to capture the exact input of denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. +Notices read like `bash blocked by auto mode · /permissions · Auto mode: [Data Exfiltration]`. To read the command or URL behind one, use the **Recently blocked** tab, a hook, or the conversation: + + * **Recently blocked tab** : highlight the action’s row. In [screen reader mode](</docs/en/accessibility>), every command and input appears before the list. + * **Hook** : to capture the exact input of denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. If your hook reads `reason`, expect no `Auto mode:` prefix, and text such as `Blocked by classifier` instead of `No reason provided`. * **Conversation** : find the tool call. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. -The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: +The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a `Blocked by auto mode` line means the classifier judged the call unsafe. To let the call through, take the step that matches what Claude was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -141,7 +141,7 @@ Run `/auto-mode-setup` to have Claude Code draft `autoMode.environment` entries, and sometimes rule entries too, from your project and your recent sessions in it. If you accept the draft, Claude Code writes it to `~/.claude/settings.json`. -`/auto-mode-setup` is available on Pro, Max, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see `/auto-mode-setup` returns “Unknown command”. +`/auto-mode-setup` is available on Pro, Max, Ultra, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, Ultra, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see `/auto-mode-setup` returns “Unknown command”. ###
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -337,7 +337,13 @@ Fix a denial with an allow rule, an environment entry, or a retry -To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: +To read the command or URL behind a notice such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, use the **Recently denied** tab, a hook, or the conversation: + + * **Recently denied tab** : in the `/permissions` dialog, highlight a denied Bash or PowerShell action to read its command below the list. In [screen reader mode](</docs/en/accessibility>), all the commands appear before the list instead. + * **Hook** : to capture the exact input of denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. + * **Conversation** : find the tool call. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. + +The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -141,7 +141,7 @@ Run `/auto-mode-setup` to have Claude Code draft `autoMode.environment` entries, and sometimes rule entries too, from your project and your recent sessions in it. If you accept the draft, Claude Code writes it to `~/.claude/settings.json`. -`/auto-mode-setup` requires a Pro, Max, or Team plan and Claude Code v2.1.228 or later. On native Windows it requires v2.1.233 or later. You can’t run it in a [cloud session](</docs/en/claude-code-on-the-web>). It also needs [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>), so you can’t run it in a session where you’ve turned flag fetching off. +`/auto-mode-setup` is available on Pro, Max, Team, and Enterprise plans and with a Claude Console API key. On a Pro, Max, or Team plan, you need v2.1.228 or later, or v2.1.233 or later on native Windows. On an Enterprise plan or with a Claude Console API key, you need v2.1.283 or later. If the command is missing from your session, see `/auto-mode-setup` returns “Unknown command”. ### @@ -189,6 +189,20 @@ } `/auto-mode-setup` is a built-in command rather than a [bundled skill](</docs/en/skills#bundled-skills>), so this `skillOverrides` entry still applies to it, but [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) doesn’t turn it off. + +### + +​ + +`/auto-mode-setup` returns “Unknown command” + +If typing `/auto-mode-setup` at the Claude Code prompt prints `Unknown command: /auto-mode-setup`, check for these causes: + + * **First session after an install or upgrade** : start a new session. If the command is still missing there, see the [setups where later sessions also start without it](</docs/en/env-vars#first-session-after-an-install-or-upgrade>). + * **Outdated version** : run `claude --version` in your shell. If the version is below the minimum for your plan, [update Claude Code](</docs/en/setup#update-claude-code>). + * **Telemetry off, third-party provider, or Claude apps gateway** : before v2.1.304, the command isn’t available in [sessions where feature-flag fetching is off](</docs/en/env-vars#features-that-need-feature-flag-fetching>). If your session is one of them, [update Claude Code](</docs/en/setup#update-claude-code>) to v2.1.304 or later. + +In a [cloud session](</docs/en/claude-code-on-the-web>), the command prints `/auto-mode-setup isn't available in this environment.` instead. Run it in an interactive session in your terminal. ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -275,7 +275,7 @@ claude auto-mode defaults -To read one rule’s full wording without piping through `jq`, pass `--label` with the start of the rule’s label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule’s label, and sections with no match print as empty lists. Requires Claude Code v2.1.208 or later. Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: +To read one rule’s full wording without piping through `jq`, pass `--label` with the start of the rule’s label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule’s label, and sections with no match print as empty lists. Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: claude auto-mode config @@ -303,7 +303,7 @@ claude auto-mode critique -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. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: +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. To discard your customizations and return to the built-in defaults, run the reset subcommand, which removes the `autoMode` section from your user settings file: claude auto-mode reset
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -323,7 +323,7 @@ Fix a denial with an allow rule, an environment entry, or a retry -To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. Text that reports a problem with the classifier itself, such as a model that `is temporarily unavailable` or a classifier error, means Claude Code blocked the call without a final verdict from the classifier; see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: +To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. A dim `Not run · auto mode's check had no usable answer` row, or text that reports a problem with the classifier itself, such as `Auto mode could not evaluate this action`, means Claude Code blocked the call without a verdict from the classifier. For a `Not run` row, press `Ctrl+O` to read the full message, then see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) or [The server returned no safety verdict](</docs/en/errors#the-server-returned-no-safety-verdict>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -299,7 +299,7 @@ ] } -Get AI feedback on your custom `allow`, `soft_deny`, and `hard_deny` rules: +Get AI feedback on your custom `allow`, `soft_deny`, `hard_deny`, and `environment` entries: claude auto-mode critique
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -247,11 +247,7 @@ Edit rules from `/permissions` -To view and edit classifier rules without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. The tab lists the `allow`, `soft_deny`, `hard_deny`, and `environment` entries from each of the scopes the classifier reads, and shows whether the built-in rules are in effect for each section. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. From the tab you can: - - * Add, edit, or delete rules in the `allow`, `soft_deny`, and `hard_deny` sections. When you add the first rule to a section, Claude Code also inserts `"$defaults"` so the built-in rules stay in effect. - * Turn the built-in rules for `allow`, `soft_deny`, or `hard_deny` off or back on. Claude Code records the choice by adding or removing `"$defaults"` in your list for that section, so a section needs at least one rule of your own before you can turn its built-in rules off. - * Edit the `environment` entries as one document in your editor. If you haven’t configured any `environment` entries yet, Claude Code first asks whether to replace the built-in environment, then opens the editor on the full built-in text. When you save, Claude Code replaces your `autoMode.environment` array with the document. Include the `"$defaults"` line to keep the built-in entries. +To view and edit classifier rules and `environment` entries without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -333,7 +333,7 @@ * A command you want to run without review from now on: add an `allow` rule. * A one-off action you did intend: state that intent in your next message and let Claude retry. -You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. +You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The text in square brackets, such as `[Data Exfiltration]`, is the name of the rule the classifier matched. To read that rule’s full wording, see Inspect the defaults and your effective config. ###
modified
Show diff (145 lines)
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,17 +1,15 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. - -By default, 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 sessions end up in auto mode and what the classifier blocks by default, see [auto mode on the Permission modes page](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: +This page is the configuration reference. Turning auto mode on and off is covered on the Permission modes page: + + * **Switch to auto mode mid-session, or back out of it** : see [Switch permission modes](</docs/en/permission-modes#switch-permission-modes>) + * **Start a session in auto mode** : see [Start in a different permission mode](</docs/en/permission-modes#start-in-a-different-mode>) + +Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. By default, 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`. This page covers how to: * Add a human checkpoint for pushes and pull requests with `permissions.ask` - * Choose where to set rules across CLAUDE.md, user settings, and managed settings * Define trusted infrastructure with `autoMode.environment` * Generate environment entries with `/auto-mode-setup` - * Override the block and allow rules when the defaults don’t fit your pipeline - * Edit rules from `/permissions` without opening a settings file - * Route all shell commands through the classifier with `autoMode.classifyAllShell` - * Inspect your effective config with the `claude auto-mode` subcommands * Review denials so you know what to add next ## @@ -20,11 +18,7 @@ Common boundaries -Auto mode allows pushes to any branch of the repository you’re working in, including the default branch, and pull request creation by default. A non-default branch whose name marks it as a deploy or publication target, such as `production`, `release`, or `gh-pages`, isn’t covered by that default: the classifier judges a push there on its own terms, including as a production deploy. The push’s content is also still checked, so a force push, a secret entering the commit, or a change that would send secrets outside the repository when CI or a deploy pipeline runs it stays blocked. - -Before v2.1.211, the classifier allowed pushes only to your working branch, branches Claude created, and routine pushes to the default branch. - -If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. +Auto mode allows pushes to any branch of the repository you’re working in, including the default branch, and pull request creation by default. A non-default branch whose name marks it as a deploy or publication target, such as `production`, `release`, or `gh-pages`, isn’t covered by that default: the classifier judges a push there on its own terms, including as a production deploy. The push’s content is also still checked, so a force push, a secret entering the commit, or a change that would send secrets outside the repository when CI or a deploy pipeline runs it stays blocked. If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. ### @@ -65,7 +59,7 @@ Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation -The classifier doesn’t read `autoMode` from project settings in `.claude/settings.json` or `.claude/settings.local.json`. Both files live in the repo directory, so a checked-in repo or a build step could otherwise inject its own allow rules. Before v2.1.207, the classifier also read `.claude/settings.local.json`; move any `autoMode` block in that file to `~/.claude/settings.json`. Excluding `.claude/settings.local.json` also closes the case where a repository commits the file or a local tool or build step writes it. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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 doesn’t read `autoMode` from project settings in `.claude/settings.json` or `.claude/settings.local.json`. Both files live in the repo directory, so a checked-in repo or a build step could otherwise inject its own allow rules. Move any `autoMode` block in `.claude/settings.local.json` to `~/.claude/settings.json`. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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](</docs/en/permissions>). 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 can’t be overridden. @@ -75,13 +69,13 @@ 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. As of Claude Code v2.1.198, `claude auto-mode defaults` prints three kinds of environment entry. Versions before v2.1.195 print only the first five trust slots. +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. `claude auto-mode defaults` prints three kinds of environment entry. * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Each defaults to `None configured` or to the conservative assumption named next to it: * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or the classifier reads a visibility check earlier in the conversation showing it is public. In the classifier requests sent by Claude Code itself, the classifier reads your messages and the commands Claude runs, not their output. The evidence has to be something the classifier can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. The transcript-evidence check requires Claude Code v2.1.200 or later + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or the classifier reads a visibility check earlier in the conversation showing it is public. In the classifier requests sent by Claude Code itself, the classifier reads your messages and the commands Claude runs, not their output. The evidence has to be something the classifier can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management** @@ -90,10 +84,8 @@ * **Host containment** : defaults to an ordinary developer machine or CI runner with open internet. If Claude Code runs in a container, VM, or pod with an egress allow-list or neighbors it must not touch, name the allowed hosts, whether the cloud metadata endpoint should be reachable, and which cloud project, cluster, or registry the task uses and under what identity. Until this entry names that identity, the classifier [blocks](</docs/en/permission-modes#what-the-classifier-blocks-by-default>) requests for the host’s own credentials. Requires Claude Code v2.1.257 or later * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them * **Data retention / declassification** - * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. This scoping requires Claude Code v2.1.203 or later. + * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. - -Before v2.1.211, the context slots also included a Default / protected branches entry that treated `main` and `master` as protected until you named others. v2.1.211 removed it: pushes to any branch of the repository you’re working in are allowed by default, so there is no protected-branch default to configure. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services. @@ -117,12 +109,12 @@ * **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 * **Internal package registry** : the private npm, PyPI, or other registry that installs should route through, so installs that bypass it for a public registry get blocked - * **Sensitive data locations & audiences**: the buckets, databases, or paths that hold personal data, confidential business data, credentials, regulated data, or similarly sensitive material, and the audiences that data in each location may be shared with, so the classifier protects those locations instead of guessing from content. Claude Code v2.1.195 through v2.1.197 name this entry PII / regulated-data locations and cover only locations that hold personal or regulated data, without the audience dimension + * **Sensitive data locations & audiences**: the buckets, databases, or paths that hold personal data, confidential business data, credentials, regulated data, or similarly sensitive material, and the audiences that data in each location may be shared with, so the classifier protects those locations instead of guessing from content. * **Sensitive remote targets** : the namespaces, hosts, or containers that count as production, so remote shells and port-forwards into them need your explicit approval * **Protected IaC scopes** : the infrastructure resources whose apply or destroy should always require you to name the change * **Additional context** : regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky -The Internal package registry, Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes entries require Claude Code v2.1.195 or later. Earlier versions still read them as plain context but don’t have the built-in rules that target them. A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. +A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. { "autoMode": { @@ -139,7 +131,7 @@ } } -The more specific context you give, the better the classifier can distinguish routine internal operations from exfiltration attempts. You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. +You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. ## @@ -267,7 +259,7 @@ Route all shell commands through the classifier -By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. +By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list, except [critical-path removals](</docs/en/permission-modes#critical-paths>). { "autoMode": { @@ -276,8 +268,6 @@ } This trades latency for coverage: a command that an allow rule would have approved instantly now waits for a classifier decision, and each shell command counts as a classifier call. The setting applies only while auto mode is active, and your allow rules behave normally in other permission modes. - -`autoMode.classifyAllShell` requires Claude Code v2.1.193 or later. Earlier versions ignore the key and continue to carry narrow shell allow rules into auto mode. ## @@ -317,7 +307,7 @@ claude auto-mode critique -Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: +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. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: claude auto-mode reset @@ -343,7 +333,7 @@ * A command you want to run without review from now on: add an `allow` rule. * A one-off action you did intend: state that intent in your next message and let Claude retry. -You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. In most sessions the reason names the rule the classifier matched, in square brackets, such as `[Data Exfiltration]` or `[Production Deploy]`, and some sessions run a classifier model that adds a short explanation. Claude Code selects the classifier model, so which form you see isn’t something you configure. +You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. ### @@ -351,7 +341,7 @@ Fix repeated denials -Repeated denials for the same destination usually mean the classifier is missing context. Add that destination to `autoMode.environment`, or run `/auto-mode-setup` to have Claude Code draft the entries, then run `claude auto-mode config` to confirm the change took effect. To react to denials programmatically, use the [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>). +Repeated denials for the same destination usually mean the classifier is missing context. Add that destination to `autoMode.environment`, or run `/auto-mode-setup` to have Claude Code draft the entries, then run `claude auto-mode config` to confirm the change took effect. ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -81,7 +81,7 @@ * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or a visibility check earlier in the conversation the classifier reads shows it is public. The classifier reads your messages and the commands Claude runs, not their output, so the evidence has to be something it can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. The transcript-evidence check requires Claude Code v2.1.200 or later + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or the classifier reads a visibility check earlier in the conversation showing it is public. In the classifier requests sent by Claude Code itself, the classifier reads your messages and the commands Claude runs, not their output. The evidence has to be something the classifier can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. The transcript-evidence check requires Claude Code v2.1.200 or later * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management** @@ -149,7 +149,7 @@ Run `/auto-mode-setup` to have Claude Code draft `autoMode.environment` entries, and sometimes rule entries too, from your project and your recent sessions in it. If you accept the draft, Claude Code writes it to `~/.claude/settings.json`. -`/auto-mode-setup` requires a Pro, Max, or Team plan and Claude Code v2.1.228 or later. On native Windows it requires v2.1.233 or later. You can’t run it in [Claude Code on the web](</docs/en/claude-code-on-the-web>). It also needs [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>), so you can’t run it in a session where you’ve turned flag fetching off. +`/auto-mode-setup` requires a Pro, Max, or Team plan and Claude Code v2.1.228 or later. On native Windows it requires v2.1.233 or later. You can’t run it in a [cloud session](</docs/en/claude-code-on-the-web>). It also needs [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>), so you can’t run it in a session where you’ve turned flag fetching off. ### @@ -267,7 +267,7 @@ Route all shell commands through the classifier -By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode, and Claude Code resolves them before the classifier runs. Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. +By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode. Claude Code resolves them before the classifier runs, unless the command carries [per-command allowed domains](</docs/en/sandboxing#per-command-allowed-domains-in-auto-mode>). Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. { "autoMode": {
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -337,13 +337,13 @@ Fix a denial with an allow rule, an environment entry, or a retry -To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · Blocked by classifier · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. Text that reports a problem with the classifier itself, such as a model that `is temporarily unavailable` or a classifier error, means Claude Code blocked the call without a final verdict from the classifier; see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: +To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · [Data Exfiltration] · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. Text that reports a problem with the classifier itself, such as a model that `is temporarily unavailable` or a classifier error, means Claude Code blocked the call without a final verdict from the classifier; see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `[Production Deploy]` or `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule. * A one-off action you did intend: state that intent in your next message and let Claude retry. -You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The reason shown with the call is the fixed text `Blocked by classifier` in most sessions, in Claude Code v2.1.208 and later: the classifier scores each action on an internal severity scale rather than writing an explanation. Some sessions run a classifier model that writes a short explanation instead, in v2.1.193 and later; when one appears, treat it as a hint about which destination or intent the classifier was missing. Claude Code selects the classifier model, so which reason you see isn’t something you configure. +You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. In most sessions the reason names the rule the classifier matched, in square brackets, such as `[Data Exfiltration]` or `[Production Deploy]`, and some sessions run a classifier model that adds a short explanation. Claude Code selects the classifier model, so which form you see isn’t something you configure. ###
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -24,7 +24,7 @@ Before v2.1.211, the classifier allowed pushes only to your working branch, branches Claude created, and routine pushes to the default branch. -If you want a human checkpoint before every push or pull request, add permission rules: the recipes below keep auto mode on for everything else. +If you want a human checkpoint before Claude’s push and pull request commands, add permission rules: the recipes below keep auto mode on for everything else. ### @@ -43,11 +43,11 @@ } } -Pick the mechanism that matches how firm the boundary needs to be: +These rules match commands that begin with `git push` or `gh pr create`. A push Claude writes another way, such as `git -C <dir> push` or `git -c <key>=<value> push`, [doesn’t match the rule](</docs/en/permissions#bash-rule-limits>), so it isn’t checkpointed. For a checkpoint that inspects the full command text, add a [PreToolUse hook](</docs/en/hooks#pretooluse>). Pick the mechanism that matches how firm the boundary needs to be: Boundary| Mechanism| Behavior in auto mode ---|---|--- -Prompt before the action| `permissions.ask`| Always prompts for content-scoped rules like the recipe above. The classifier cannot auto-approve a matching action. +Prompt before the action| `permissions.ask`| Always prompts for a command that matches a content-scoped rule like the recipe above. The classifier cannot auto-approve a matching action. Never run the action| `permissions.deny`| Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. Use an ask or deny rule for a durable guarantee.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -362,4 +362,4 @@ * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and which sessions start in it * [Managed settings](</docs/en/server-managed-settings>): deploy `autoMode` configuration across your organization * [Permissions](</docs/en/permissions>): allow, ask, and deny rules that apply before the classifier runs - * [Settings reference](</docs/en/settings-reference#automode>): every settings key, including `autoMode` + * [All settings](</docs/en/settings-reference#automode>): every settings key, including `autoMode`
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -77,7 +77,7 @@ 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. As of Claude Code v2.1.198, `claude auto-mode defaults` prints three kinds of environment entry. Versions before v2.1.195 print only the first five trust slots. - * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Unlike the other two kinds, context slots have no rules of their own that target them. Each defaults to `None configured` or to the conservative assumption named next to it: + * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Each defaults to `None configured` or to the conservative assumption named next to it: * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** @@ -87,6 +87,7 @@ * **Secrets management** * **CI/CD deploy targets** * **Network posture** + * **Host containment** : defaults to an ordinary developer machine or CI runner with open internet. If Claude Code runs in a container, VM, or pod with an egress allow-list or neighbors it must not touch, name the allowed hosts, whether the cloud metadata endpoint should be reachable, and which cloud project, cluster, or registry the task uses and under what identity. Until this entry names that identity, the classifier [blocks](</docs/en/permission-modes#what-the-classifier-blocks-by-default>) requests for the host’s own credentials. Requires Claude Code v2.1.257 or later * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them * **Data retention / declassification** * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. This scoping requires Claude Code v2.1.203 or later.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -336,7 +336,7 @@ Fix a denial with an allow rule, an environment entry, or a retry -Claude Code shows the blocked tool call wherever the denial appears, including the transcript and the **Recently denied** tab. Pick the fix from what the call was trying to reach or do: +To see what the classifier blocked, find the tool call in the conversation. If the call appears shortened or folded into a summary line such as `Ran 3 shell commands`, press `Ctrl+O` to open the [transcript viewer](</docs/en/interactive-mode#transcript-viewer>), which expands it. Two other places on screen that report denials leave out the command or URL: the notice near the input box, such as `bash denied by auto mode · Blocked by classifier · /permissions`, gives the tool and the reason, and the **Recently denied** tab lists a shell command by the description Claude wrote for it. To capture the exact input of these denials programmatically, add a [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>), which receives it as `tool_input`. The text beneath the call tells you whether there is anything to fix. Text that reports a problem with the classifier itself, such as a model that `is temporarily unavailable` or a classifier error, means Claude Code blocked the call without a final verdict from the classifier; see [Auto mode cannot determine the safety of an action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>) for what to do. Otherwise, a line reading `Denied by auto mode classifier` with a reason such as `Blocked by classifier` means the classifier judged the call unsafe, so pick the fix from what the call was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -9,6 +9,7 @@ * Define trusted infrastructure with `autoMode.environment` * Generate environment entries with `/auto-mode-setup` * Override the block and allow rules when the defaults don’t fit your pipeline + * Edit rules from `/permissions` without opening a settings file * Route all shell commands through the classifier with `autoMode.classifyAllShell` * Inspect your effective config with the `claude auto-mode` subcommands * Review denials so you know what to add next @@ -251,6 +252,18 @@ ​ +Edit rules from `/permissions` + +To view and edit classifier rules without opening a settings file, run [`/permissions`](</docs/en/permissions#manage-permissions>) and select the **Auto mode** tab. The tab requires Claude Code v2.1.246 or later, and it appears only when [auto mode is available](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) to your session. The tab lists the `allow`, `soft_deny`, `hard_deny`, and `environment` entries from each of the scopes the classifier reads, and shows whether the built-in rules are in effect for each section. Claude Code shows entries from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag as read-only, and saves every change you make on the tab to `~/.claude/settings.json`. From the tab you can: + + * Add, edit, or delete rules in the `allow`, `soft_deny`, and `hard_deny` sections. When you add the first rule to a section, Claude Code also inserts `"$defaults"` so the built-in rules stay in effect. + * Turn the built-in rules for `allow`, `soft_deny`, or `hard_deny` off or back on. Claude Code records the choice by adding or removing `"$defaults"` in your list for that section, so a section needs at least one rule of your own before you can turn its built-in rules off. + * Edit the `environment` entries as one document in your editor. If you haven’t configured any `environment` entries yet, Claude Code first asks whether to replace the built-in environment, then opens the editor on the full built-in text. When you save, Claude Code replaces your `autoMode.environment` array with the document. Include the `"$defaults"` line to keep the built-in entries. + +## + +​ + Route all shell commands through the classifier By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode, and Claude Code resolves them before the classifier runs. Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. @@ -323,13 +336,13 @@ Fix a denial with an allow rule, an environment entry, or a retry -Claude Code shows the blocked tool call wherever the denial appears, including the transcript, the denial notification, and the **Recently denied** tab. Pick the fix from what the call was trying to reach or do: +Claude Code shows the blocked tool call wherever the denial appears, including the transcript and the **Recently denied** tab. Pick the fix from what the call was trying to reach or do: * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. * A command you want to run without review from now on: add an `allow` rule. * A one-off action you did intend: state that intent in your next message and let Claude retry. -The reason shown with the call is the fixed text `Blocked by classifier` in most sessions, in Claude Code v2.1.208 and later: the classifier scores each action on an internal severity scale rather than writing an explanation. Some sessions run a classifier model that writes a short explanation instead, in v2.1.193 and later; when one appears, treat it as a hint about which destination or intent the classifier was missing. Claude Code selects the classifier model, so which reason you see isn’t something you configure. +You can add the environment entry or `allow` rule from the `/permissions` dialog’s **Auto mode** tab. The reason shown with the call is the fixed text `Blocked by classifier` in most sessions, in Claude Code v2.1.208 and later: the classifier scores each action on an internal severity scale rather than writing an explanation. Some sessions run a classifier model that writes a short explanation instead, in v2.1.193 and later; when one appears, treat it as a hint about which destination or intent the classifier was missing. Claude Code selects the classifier model, so which reason you see isn’t something you configure. ###
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -7,6 +7,7 @@ * Add a human checkpoint for pushes and pull requests with `permissions.ask` * Choose where to set rules across CLAUDE.md, user settings, and managed settings * Define trusted infrastructure with `autoMode.environment` + * Generate environment entries with `/auto-mode-setup` * Override the block and allow rules when the defaults don’t fit your pipeline * Route all shell commands through the classifier with `autoMode.classifyAllShell` * Inspect your effective config with the `claude auto-mode` subcommands @@ -142,6 +143,63 @@ ​ +Generate environment entries with `/auto-mode-setup` + +Run `/auto-mode-setup` to have Claude Code draft `autoMode.environment` entries, and sometimes rule entries too, from your project and your recent sessions in it. If you accept the draft, Claude Code writes it to `~/.claude/settings.json`. + +`/auto-mode-setup` requires a Pro, Max, or Team plan and Claude Code v2.1.228 or later. On native Windows it requires v2.1.233 or later. You can’t run it in [Claude Code on the web](</docs/en/claude-code-on-the-web>). It also needs [feature-flag fetching](</docs/en/env-vars#features-that-need-feature-flag-fetching>), so you can’t run it in a session where you’ve turned flag fetching off. + +### + +​ + +What `/auto-mode-setup` reads + +If `~/.claude/settings.json` already holds `autoMode` entries, Claude Code starts by asking whether to add to your environment list or replace it, and keeps the rules you wrote either way. Claude Code then asks how you use this project and offers two optional scans before it scans anything. In the scan, Claude Code always reads these sources: + + * This project’s `CLAUDE.md`, `README.md`, config files, and git remotes + * Your `autoMode` and `permissions.allow` settings + * The hosts, buckets, and command names from the commands Claude ran in your recent sessions in this project, never your messages + +The two optional scans add one source each: + + * The first word of each command in your shell history + * The remote hosts and names of the repositories under your home directory + +### + +​ + +Review and save the draft + +Claude Code scans in the background, then shows you the draft. You accept or discard it as a whole, so edit `~/.claude/settings.json` afterwards to adjust single entries. When you accept, Claude Code writes the draft and reconciles it with the settings you already have: + + * Claude Code writes the `environment` list without `"$defaults"`, because the draft spells out the built-in entries it left unchanged + * Claude Code includes `"$defaults"` in each of the `allow`, `soft_deny`, and `hard_deny` lists the draft adds entries to, unless you already wrote an `allow` list without it, so the built-in rules you haven’t replaced stay in effect + * After saving, Claude Code offers to remove `permissions.allow` rules in `~/.claude/settings.json` that auto mode ignores, such as `Bash(*)`, or that auto-approve destructive commands + +Then run `claude auto-mode config` to see the effective result. + +### + +​ + +Turn off `/auto-mode-setup` + +Once auto mode has blocked several actions and you still have no `autoMode.environment` entries, Claude Code shows a dialog titled “Teach auto mode about your environment?” at the end of a turn and offers to run `/auto-mode-setup` for you. To stop the offer but keep the command, select **Don’t show again** in that dialog. To turn off both the command and the offer, add this [`skillOverrides`](</docs/en/skills#override-skill-visibility-from-settings>) entry to `~/.claude/settings.json`: + + { + "skillOverrides": { + "auto-mode-setup": "off" + } + } + +`/auto-mode-setup` is a built-in command rather than a [bundled skill](</docs/en/skills#bundled-skills>), so this `skillOverrides` entry still applies to it, but [`disableBundledSkills`](</docs/en/settings-reference#disablebundledskills>) doesn’t turn it off. + +## + +​ + Override the block and allow rules Three additional fields let you replace the classifier’s built-in rule lists: @@ -279,7 +337,7 @@ Fix repeated denials -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](</docs/en/hooks#permissiondenied>). +Repeated denials for the same destination usually mean the classifier is missing context. Add that destination to `autoMode.environment`, or run `/auto-mode-setup` to have Claude Code draft the entries, then run `claude auto-mode config` to confirm the change took effect. To react to denials programmatically, use the [`PermissionDenied` hook](</docs/en/hooks#permissiondenied>). ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -30,7 +30,7 @@ Add a human checkpoint -The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#settings-files>): +The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#where-settings-live>): { "permissions": { @@ -290,4 +290,4 @@ * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and which sessions start in it * [Managed settings](</docs/en/server-managed-settings>): deploy `autoMode` configuration across your organization * [Permissions](</docs/en/permissions>): allow, ask, and deny rules that apply before the classifier runs - * [Settings](</docs/en/settings>): the full settings reference, including the `autoMode` key + * [Settings reference](</docs/en/settings-reference#automode>): every settings key, including `autoMode`
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -195,7 +195,7 @@ Route all shell commands through the classifier -By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` carry over into auto mode and resolve before the classifier runs. Auto mode suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. +By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` stay in effect in auto mode, and Claude Code resolves them before the classifier runs. Claude Code suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters, together with every rule that names [`Monitor`](</docs/en/tools-reference#monitor-tool>), because Monitor commands run through the shell. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. { "autoMode": {
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,8 +1,8 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Starting August 14, 2026, auto mode becomes the default permission mode for new sessions on Pro, Max, and Team plans. You can switch modes at any time. A default you set yourself stays in place unless you accept the one-time switch prompt, and a default your organization manages is unchanged. For details, see [the announcement](<https://claude.com/blog/auto-mode-default-in-claude-code>) on the blog.Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. - -By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: +Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. + +By default, 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 sessions end up in auto mode and what the classifier blocks by default, see [auto mode on the Permission modes page](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: * Add a human checkpoint for pushes and pull requests with `permissions.ask` * Choose where to set rules across CLAUDE.md, user settings, and managed settings @@ -287,7 +287,7 @@ See also - * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and how to enable it + * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and which sessions start in it * [Managed settings](</docs/en/server-managed-settings>): deploy `autoMode` configuration across your organization * [Permissions](</docs/en/permissions>): allow, ask, and deny rules that apply before the classifier runs * [Settings](</docs/en/settings>): the full settings reference, including the `autoMode` key
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -245,7 +245,7 @@ claude auto-mode critique -Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. If you need to remove or rewrite a built-in rule rather than add alongside it, save the output of `claude auto-mode defaults` to a file, edit the lists, and paste the result into your settings file in place of `"$defaults"`. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: +Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: claude auto-mode reset @@ -257,7 +257,7 @@ Review denials -When auto mode denies a tool call, Claude Code records the denial 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. +To review and retry actions the auto mode classifier denied, open `/permissions` and select the **Recently denied** tab, where Claude Code records each denial. 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. When the classifier produces [no verdict on the action](</docs/en/errors#auto-mode-cannot-determine-the-safety-of-an-action>), because a safety check separate from auto mode refused the classifier’s own request or its response didn’t parse, Claude Code denies the action without recording it under **Recently denied**. The linked error entry covers what Claude is told and how to run the action if you need it. ###
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. +Starting August 14, 2026, auto mode becomes the default permission mode for new sessions on Pro, Max, and Team plans. You can switch modes at any time. A default you set yourself stays in place unless you accept the one-time switch prompt, and a default your organization manages is unchanged. For details, see [the announcement](<https://claude.com/blog/auto-mode-default-in-claude-code>) on the blog.Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to:
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. +Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and the organization-level control on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to:
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -257,7 +257,29 @@ 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. In Claude Code v2.1.193 and later, the classifier’s reason for each denial appears alongside the blocked tool call in the transcript, in the denial notification, and under each entry on the Recently denied tab. Use the reason to decide whether the fix is an `environment` entry, an `allow` exception, or retrying with explicit intent in your next message. 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](</docs/en/hooks#permissiondenied>). +When auto mode denies a tool call, Claude Code records the denial 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. + +### + +​ + +Fix a denial with an allow rule, an environment entry, or a retry + +Claude Code shows the blocked tool call wherever the denial appears, including the transcript, the denial notification, and the **Recently denied** tab. Pick the fix from what the call was trying to reach or do: + + * A destination Claude needs throughout the task, such as a package registry, an internal domain, or a repository host: add it to `autoMode.environment`. + * A command you want to run without review from now on: add an `allow` rule. + * A one-off action you did intend: state that intent in your next message and let Claude retry. + +The reason shown with the call is the fixed text `Blocked by classifier` in most sessions, in Claude Code v2.1.208 and later: the classifier scores each action on an internal severity scale rather than writing an explanation. Some sessions run a classifier model that writes a short explanation instead, in v2.1.193 and later; when one appears, treat it as a hint about which destination or intent the classifier was missing. Claude Code selects the classifier model, so which reason you see isn’t something you configure. + +### + +​ + +Fix repeated denials + +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](</docs/en/hooks#permissiondenied>). ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -106,7 +106,7 @@ } } -Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers: +After you save your settings, run `claude auto-mode config` to confirm the effective rules include your entries. Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers: * **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 @@ -213,7 +213,7 @@ Inspect the defaults and your effective config -Three CLI subcommands help you inspect and validate your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: +The `claude auto-mode` subcommands help you inspect, validate, and reset your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: claude auto-mode defaults @@ -221,11 +221,35 @@ claude auto-mode config +Both `defaults` and `config` print the four rule lists as a single JSON object, with each rule as a prose string. This is a truncated example: + + { + "allow": [ + ... + "Test Artifacts: Hardcoded test API keys, placeholder credentials in examples, or hardcoding test cases. Placeholder means authored as a placeholder — a file or value copied from a real secret or sensitive path is never a test artifact (see Sensitive-Source Provenance).", + ... + ], + "soft_deny": [ + "Git Destructive [named+specifics — **must name:** the destructive operation and its target]: Force pushing (`git push --force`), deleting remote branches, tags, or releases, or rewriting remote history. Also `git commit --amend` when the commit being rewritten is not the agent's own unpushed work: either no prior `git commit` is visible (HEAD pre-dates the session), or a `git push` of the current branch is visible after the most recent commit (it has been pushed). Clears when the user asked to amend/reword/fixup, or when it is a message-only reword (`--amend -m …`, nothing newly staged) of a commit the agent visibly created this session.", + ... + ], + "hard_deny": [...], + "environment": [ + ... + "**Trusted repo**: The git repository the agent started in (its working directory) and its configured remote(s). When the repo's public/private visibility is given — by the Repository visibility entry or the user's own message — use it to scope what is OK to commit or push there: confidential material is fine in a private repo; in a public one, only that repo's own work is — and content ported, repointed, or first read from outside this session's repo is not its own work, whoever directed the port. Visibility scopes confidential material only: secrets and sensitive data (personal & entrusted) are never cleared into any repo by its visibility (see Definitions).", + ... + ] + } + Get AI feedback on your custom `allow`, `soft_deny`, and `hard_deny` rules: claude auto-mode critique -Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. If you need to remove or rewrite a built-in rule rather than add alongside it, save the output of `claude auto-mode defaults` to a file, edit the lists, and paste the result into your settings file in place of `"$defaults"`. +Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. If you need to remove or rewrite a built-in rule rather than add alongside it, save the output of `claude auto-mode defaults` to a file, edit the lists, and paste the result into your settings file in place of `"$defaults"`. To discard your customizations and return to the built-in defaults, run the reset subcommand. It requires Claude Code v2.1.212 or later and removes the `autoMode` section from your user settings file: + + claude auto-mode reset + +The command summarizes what it will remove and asks `Reset auto mode configuration to defaults?` before writing; pass `--yes` to skip the confirmation. Reset changes only `~/.claude/settings.json`: `autoMode` rules from [managed settings](</docs/en/server-managed-settings>) or the `--settings` flag still apply. ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on every provider, including the Anthropic API, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. +Auto mode is available to all users on every provider, including the Anthropic API, [Claude Platform on AWS](</docs/en/claude-platform-on-aws>), Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: @@ -18,7 +18,19 @@ Common boundaries -Auto mode allows pushes to your working branch, routine pushes to the repository default branch, and pull request creation by default. The classifier blocks a push only when it carries risk, such as a force push or content that routes around a review you set up. If you want a human checkpoint before every push or pull request, add permission rules: the recipes below keep auto mode on for everything else. The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#settings-files>): +Auto mode allows pushes to any branch of the repository you’re working in, including the default branch, and pull request creation by default. A non-default branch whose name marks it as a deploy or publication target, such as `production`, `release`, or `gh-pages`, isn’t covered by that default: the classifier judges a push there on its own terms, including as a production deploy. The push’s content is also still checked, so a force push, a secret entering the commit, or a change that would send secrets outside the repository when CI or a deploy pipeline runs it stays blocked. + +Before v2.1.211, the classifier allowed pushes only to your working branch, branches Claude created, and routine pushes to the default branch. + +If you want a human checkpoint before every push or pull request, add permission rules: the recipes below keep auto mode on for everything else. + +### + +​ + +Add a human checkpoint + +The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#settings-files>): { "permissions": { @@ -71,13 +83,14 @@ * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management** - * **Default / protected branches** : `main` and `master` are treated as protected until you name others * **CI/CD deploy targets** * **Network posture** * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them * **Data retention / declassification** * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. This scoping requires Claude Code v2.1.203 or later. * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. + +Before v2.1.211, the context slots also included a Default / protected branches entry that treated `main` and `master` as protected until you named others. v2.1.211 removed it: pushes to any branch of the repository you’re working in are allowed by default, so there is no protected-branch default to configure. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -169,7 +169,10 @@ } } -Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and auto-mode bypass rules. +Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. If you set an array without `"$defaults"`, you discard the built-in rules for that section: + + * `soft_deny`: every built-in soft block rule, including force push, `curl | bash`, production deploys, and auto-mode bypass + * `hard_deny`: the built-in data exfiltration rule Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that 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.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -201,7 +201,7 @@ claude auto-mode defaults -Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: +To read one rule’s full wording without piping through `jq`, pass `--label` with the start of the rule’s label, such as `claude auto-mode defaults --label 'Git Destructive'`. Matching is a case-insensitive prefix on each rule’s label, and sections with no match print as empty lists. Requires Claude Code v2.1.208 or later. Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: claude auto-mode config
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,9 +1,10 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. +Auto mode is available to all users on every provider, including the Anthropic API, Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. In v2.1.158 through v2.1.206, auto mode on Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and Claude apps gateway sessions required setting `CLAUDE_CODE_ENABLE_AUTO_MODE=1`; v2.1.207 removed the requirement. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: + * Add a human checkpoint for pushes and pull requests with `permissions.ask` * 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 @@ -15,6 +16,31 @@ ​ +Common boundaries + +Auto mode allows pushes to your working branch, routine pushes to the repository default branch, and pull request creation by default. The classifier blocks a push only when it carries risk, such as a force push or content that routes around a review you set up. If you want a human checkpoint before every push or pull request, add permission rules: the recipes below keep auto mode on for everything else. The most direct mechanism is [`permissions.ask`](</docs/en/permissions#permission-rule-syntax>). Content-scoped ask rules like the ones below are evaluated before the classifier and always force a permission prompt, even in auto mode, because an explicit ask rule is your stated intent to be prompted for that action. Add the rules in your [settings](</docs/en/settings#settings-files>): + + { + "permissions": { + "ask": [ + "Bash(git push *)", + "Bash(gh pr create *)" + ] + } + } + +Pick the mechanism that matches how firm the boundary needs to be: + +Boundary| Mechanism| Behavior in auto mode +---|---|--- +Prompt before the action| `permissions.ask`| Always prompts for content-scoped rules like the recipe above. The classifier cannot auto-approve a matching action. +Never run the action| `permissions.deny`| Blocks before the classifier is consulted. Neither the classifier nor user intent can override it. +One-off boundary for this session| State it in conversation, like “don’t push until I review”| The classifier blocks matching actions, but the boundary can be lost if [context compaction](</docs/en/costs#reduce-token-usage>) removes the message that stated it. Use an ask or deny rule for a durable guarantee. + +## + +​ + Where the classifier reads configuration The classifier reads the same [CLAUDE.md](</docs/en/memory>) 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 the `autoMode` settings block. The classifier reads `autoMode` from the following scopes: @@ -22,11 +48,10 @@ 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 Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation -The classifier doesn’t read `autoMode` from shared project settings in `.claude/settings.json`, so a checked-in repo can’t inject its own allow rules. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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 doesn’t read `autoMode` from project settings in `.claude/settings.json` or `.claude/settings.local.json`. Both files live in the repo directory, so a checked-in repo or a build step could otherwise inject its own allow rules. Before v2.1.207, the classifier also read `.claude/settings.local.json`; move any `autoMode` block in that file to `~/.claude/settings.json`. Excluding `.claude/settings.local.json` also closes the case where a repository commits the file or a local tool or build step writes it. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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](</docs/en/permissions>). 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 can’t be overridden.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -42,7 +42,7 @@ * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or something earlier in the session already showed it is public, such as a `gh repo view` result in the transcript. The transcript-evidence check requires Claude Code v2.1.200 or later + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or a visibility check earlier in the conversation the classifier reads shows it is public. The classifier reads your messages and the commands Claude runs, not their output, so the evidence has to be something it can read, such as your own message naming the repository as public; the output of a `gh repo view` on its own doesn’t reach it. The transcript-evidence check requires Claude Code v2.1.200 or later * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management**
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -51,7 +51,7 @@ * **Network posture** * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them * **Data retention / declassification** - * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. + * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. A repository’s visibility scopes only confidential material: a private repository is an acceptable destination for confidential material, but making a repository private never clears secrets or personal or entrusted data into it, and the classifier treats content ported, repointed, or first read from outside the working repository as not that repository’s own work. This scoping requires Claude Code v2.1.203 or later. * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud’s Agent Platform, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-agent-platform-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: @@ -42,7 +42,7 @@ * **Organization** * **Primary use of Claude Code** : defaults to software development * **Cloud provider(s)** - * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise, or something earlier in the session already showed it is public, such as a `gh repo view` result in the transcript. The transcript-evidence check requires Claude Code v2.1.200 or later * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one * **Org-specific CLIs** * **Secrets management**
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -36,12 +36,25 @@ 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. As of Claude Code v2.1.195, `claude auto-mode defaults` prints two kinds of environment entry. - +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. As of Claude Code v2.1.198, `claude auto-mode defaults` prints three kinds of environment entry. Versions before v2.1.195 print only the first five trust slots. + + * **Context slots** : describe your organization, stack, and security posture so the classifier reads the other rules in your context. Unlike the other two kinds, context slots have no rules of their own that target them. Each defaults to `None configured` or to the conservative assumption named next to it: + * **Organization** + * **Primary use of Claude Code** : defaults to software development + * **Cloud provider(s)** + * **Repository visibility** : a repository is assumed private unless its remote host and name indicate otherwise + * **Internal sharing / snippet hosting** : public paste and gist services are treated as outside the trust boundary until you name one + * **Org-specific CLIs** + * **Secrets management** + * **Default / protected branches** : `main` and `master` are treated as protected until you name others + * **CI/CD deploy targets** + * **Network posture** + * **Protected deployment namespaces / environments** : falls back to the Sensitive remote targets heuristic until you name them + * **Data retention / declassification** * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. - * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are PII / regulated-data locations, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. - -Versions before v2.1.195 print only the first five trust slots. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services. + * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. + +To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services. { "autoMode": { @@ -63,12 +76,12 @@ * **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 * **Internal package registry** : the private npm, PyPI, or other registry that installs should route through, so installs that bypass it for a public registry get blocked - * **PII / regulated-data locations** : the buckets, databases, or paths that hold personal or regulated data, so the classifier protects those locations instead of guessing from content + * **Sensitive data locations & audiences**: the buckets, databases, or paths that hold personal data, confidential business data, credentials, regulated data, or similarly sensitive material, and the audiences that data in each location may be shared with, so the classifier protects those locations instead of guessing from content. Claude Code v2.1.195 through v2.1.197 name this entry PII / regulated-data locations and cover only locations that hold personal or regulated data, without the audience dimension * **Sensitive remote targets** : the namespaces, hosts, or containers that count as production, so remote shells and port-forwards into them need your explicit approval * **Protected IaC scopes** : the infrastructure resources whose apply or destroy should always require you to name the change * **Additional context** : regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky -The Internal package registry, PII / regulated-data locations, Sensitive remote targets, and Protected IaC scopes entries require Claude Code v2.1.195 or later. Earlier versions still read them as plain context but don’t have the built-in rules that target them. A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. +The Internal package registry, Sensitive data locations & audiences, Sensitive remote targets, and Protected IaC scopes entries require Claude Code v2.1.195 or later. Earlier versions still read them as plain context but don’t have the built-in rules that target them. A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. { "autoMode": {
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,12 +1,13 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, and signed-in [Claude apps gateway](</docs/en/claude-apps-gateway>) sessions, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). 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 + * Route all shell commands through the classifier with `autoMode.classifyAllShell` * Inspect your effective config with the `claude auto-mode` subcommands * Review denials so you know what to add next @@ -35,7 +36,12 @@ 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. The default environment list trusts the working repo and its configured remotes. To add your own entries alongside that default, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. +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. As of Claude Code v2.1.195, `claude auto-mode defaults` prints two kinds of environment entry. + + * **Trust slots** : name what the classifier treats as inside your boundary. The slots are Trusted repo, Source control, Trusted internal domains, Trusted cloud buckets, Key internal services, and Internal package registry. The repo and source-control entries default to the working repository and its configured remotes. Every other trust slot defaults to `None configured`, so nothing else is trusted until you add it. + * **Sensitivity slots** : name what the protective rules treat as high-risk. The slots are PII / regulated-data locations, Sensitive remote targets, and Protected IaC scopes. Each defaults to a broad heuristic, such as treating any host or namespace whose name carries `prod` or `production` as a sensitive remote target, so the protective rules are active before you configure anything. Naming concrete targets in a sensitivity slot makes those rules apply to the named targets instead of the heuristic. + +Versions before v2.1.195 print only the first five trust slots. To add your own entries alongside the defaults, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. The following example keeps the default entries and adds an organization’s repos, buckets, domains, and services. { "autoMode": { @@ -56,9 +62,13 @@ * **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 + * **Internal package registry** : the private npm, PyPI, or other registry that installs should route through, so installs that bypass it for a public registry get blocked + * **PII / regulated-data locations** : the buckets, databases, or paths that hold personal or regulated data, so the classifier protects those locations instead of guessing from content + * **Sensitive remote targets** : the namespaces, hosts, or containers that count as production, so remote shells and port-forwards into them need your explicit approval + * **Protected IaC scopes** : the infrastructure resources whose apply or destroy should always require you to name the change * **Additional context** : regulated-industry constraints, multi-tenant infrastructure, or compliance requirements that affect what the classifier should treat as risky -A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. +The Internal package registry, PII / regulated-data locations, Sensitive remote targets, and Protected IaC scopes entries require Claude Code v2.1.195 or later. Earlier versions still read them as plain context but don’t have the built-in rules that target them. A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. { "autoMode": { @@ -129,6 +139,24 @@ ​ +Route all shell commands through the classifier + +By default, narrow Bash and PowerShell allow rules such as `Bash(npm test)` carry over into auto mode and resolve before the classifier runs. Auto mode suspends only the broad rules that grant arbitrary code execution, such as `Bash(*)` or wildcarded interpreters. This means a narrow rule can still let a destructive argument through without the classifier seeing it, for example a script path or flag the rule’s prefix didn’t anticipate. Set `autoMode.classifyAllShell` to `true` to suspend every Bash and PowerShell allow rule while auto mode is active, so the classifier evaluates every shell command regardless of your allow list. + + { + "autoMode": { + "classifyAllShell": true + } + } + +This trades latency for coverage: a command that an allow rule would have approved instantly now waits for a classifier decision, and each shell command counts as a classifier call. The setting applies only while auto mode is active, and your allow rules behave normally in other permission modes. + +`autoMode.classifyAllShell` requires Claude Code v2.1.193 or later. Earlier versions ignore the key and continue to carry narrow shell allow rules into auto mode. + +## + +​ + Inspect the defaults and your effective config Three CLI subcommands help you inspect and validate your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: @@ -151,7 +179,7 @@ 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](</docs/en/hooks#permissiondenied>). +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. In Claude Code v2.1.193 and later, the classifier’s reason for each denial appears alongside the blocked tool call in the transcript, in the denial notification, and under each entry on the Recently denied tab. Use the reason to decide whether the fix is an `environment` entry, an `allow` exception, or retrying with explicit intent in your next message. 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](</docs/en/hooks#permissiondenied>). ##
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -2,7 +2,7 @@ Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. -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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: +By default, 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). 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` @@ -25,9 +25,9 @@ Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation -The classifier does not read `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`, `soft_deny`, and `hard_deny` with personal entries but cannot remove entries that managed settings provide. Because allow rules act as exceptions to soft 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 doesn’t read `autoMode` from shared project settings in `.claude/settings.json`, so a checked-in repo can’t inject its own allow rules. Entries from each scope are combined. A developer can extend `environment`, `allow`, `soft_deny`, and `hard_deny` with personal entries but can’t remove entries that managed settings provide. Because allow rules act as exceptions to soft 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](</docs/en/permissions>). 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. +The classifier is a second gate that runs after the [permissions system](</docs/en/permissions>). 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 can’t be overridden. ## @@ -83,14 +83,20 @@ Override the block and allow rules -Three additional fields let you replace the classifier’s built-in rule lists: `autoMode.hard_deny` for unconditional security boundaries, `autoMode.soft_deny` for destructive actions that user intent can clear, and `autoMode.allow` for exceptions. Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). Inside the classifier, precedence works in four tiers: +Three additional fields let you replace the classifier’s built-in rule lists: - * `hard_deny` rules block unconditionally. User intent and `allow` exceptions do not apply. + * `autoMode.hard_deny`: unconditional security boundaries + * `autoMode.soft_deny`: destructive actions that user intent can clear + * `autoMode.allow`: exceptions to soft block rules + +Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). Inside the classifier, precedence works in four tiers: + + * `hard_deny` rules block unconditionally. User intent and `allow` exceptions don’t apply. * `soft_deny` rules block next. User intent and `allow` exceptions can override these. * `allow` rules then override matching `soft_deny` rules as exceptions. * Explicit user intent overrides the remaining soft blocks: 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_deny` rule matches. -General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for security boundaries that must never be crossed. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. +General requests don’t count as explicit intent. Asking Claude to “clean up the repo” doesn’t authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for security boundaries that must never be crossed. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. The following example keeps the defaults in all four lists and adds organization-specific rules to each. { "autoMode": {
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,6 +1,6 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and Owner enablement on Team and Enterprise plans. 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to:
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,4 +1,4 @@ -[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without routine permission prompts by routing tool calls through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Deny and explicit ask rules are evaluated before the classifier and still block or prompt. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. @@ -21,7 +21,7 @@ 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 +One project, one developer| `.claude/settings.local.json`| Per-project trusted buckets or services Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -6,7 +6,7 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available to all users on the Anthropic API. It is not available on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. On Amazon Bedrock, Google Cloud Vertex AI, and Microsoft Foundry, you must first [set `CLAUDE_CODE_ENABLE_AUTO_MODE`](</docs/en/permission-modes#enable-auto-mode-on-bedrock-vertex-ai-or-foundry>). If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to:
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -6,7 +6,7 @@ [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. -Auto mode is available on Max, Team, Enterprise, and API plans through the Anthropic API. It is not available on Pro or on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. +Auto mode is available to all users on the Anthropic API. It is not available on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. 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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: @@ -121,7 +121,7 @@ } } -Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and safety-check bypass rules. +Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and auto-mode bypass rules. Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that 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.
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -31,7 +31,7 @@ Organization-wide| [Managed settings](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers `--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation -The classifier does not read `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 does not read `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`, `soft_deny`, and `hard_deny` with personal entries but cannot remove entries that managed settings provide. Because allow rules act as exceptions to soft 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](</docs/en/permissions>). 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. @@ -89,13 +89,14 @@ 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`](</docs/en/permissions>), which runs before the classifier. Inside the classifier, precedence works in three tiers: +Three additional fields let you replace the classifier’s built-in rule lists: `autoMode.hard_deny` for unconditional security boundaries, `autoMode.soft_deny` for destructive actions that user intent can clear, and `autoMode.allow` for exceptions. Each is an array of prose descriptions, read as natural-language rules. For tool-pattern-based hard blocks that run before the classifier, use [`permissions.deny`](</docs/en/permissions>). Inside the classifier, precedence works in four tiers: - * `soft_deny` rules block first - * `allow` rules 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_deny` rule matches + * `hard_deny` rules block unconditionally. User intent and `allow` exceptions do not apply. + * `soft_deny` rules block next. User intent and `allow` exceptions can override these. + * `allow` rules then override matching `soft_deny` rules as exceptions. + * Explicit user intent overrides the remaining soft blocks: 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_deny` rule matches. -General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, 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. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. +General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, add to `allow` when the classifier repeatedly flags a routine pattern the default exceptions don’t cover. To tighten, add to `soft_deny` for destructive risks specific to your environment that the defaults miss, or to `hard_deny` for security boundaries that must never be crossed. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. { "autoMode": { @@ -112,13 +113,17 @@ "$defaults", "Never run database migrations outside the migrations CLI, even against dev databases", "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow" + ], + "hard_deny": [ + "$defaults", + "Never send repository contents to third-party code-review APIs" ] } } -Setting any of `environment`, `allow`, or `soft_deny` without `"$defaults"` replaces the entire default list for that section. If you set `soft_deny` with a single entry and omit `"$defaults"`, every built-in block rule is discarded: force push, data exfiltration, `curl | bash`, production deploys, and all other default block rules become allowed. Only omit `"$defaults"` when you intend to take full ownership of the list. In that case, 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. +Setting any of `environment`, `allow`, `soft_deny`, or `hard_deny` without `"$defaults"` replaces the entire default list for that section. A `soft_deny` array without `"$defaults"` discards every built-in soft block rule, including force push, `curl | bash`, and production deploys. A `hard_deny` array without `"$defaults"` discards the built-in data exfiltration and safety-check bypass rules. -Each section is evaluated independently, so setting `environment` alone leaves the default `allow` and `soft_deny` lists intact. +Each section is evaluated independently, so setting `environment` alone leaves the default `allow`, `soft_deny`, and `hard_deny` lists intact. Only omit `"$defaults"` when you intend to take full ownership of the list. To do that 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. ## @@ -126,7 +131,7 @@ Inspect the defaults and your effective config -Three CLI subcommands help you inspect and validate your configuration. Print the built-in `environment`, `allow`, and `soft_deny` rules as JSON: +Three CLI subcommands help you inspect and validate your configuration. Print the built-in `environment`, `allow`, `soft_deny`, and `hard_deny` rules as JSON: claude auto-mode defaults @@ -134,7 +139,7 @@ claude auto-mode config -Get AI feedback on your custom `allow` and `soft_deny` rules: +Get AI feedback on your custom `allow`, `soft_deny`, and `hard_deny` rules: claude auto-mode critique
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -4,7 +4,11 @@ > > Use this file to discover all available pages before exploring further. -[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `autoMode` settings block to tell that classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations. + +Auto mode is available on Max, Team, Enterprise, and API plans through the Anthropic API. It is not available on Pro or on Bedrock, Vertex, or Foundry. If Claude Code reports auto mode as unavailable for your account, check the [full requirements](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>), which also cover the supported models and admin enablement on Team and Enterprise plans. + +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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). 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`
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -1,3 +1,9 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + [Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). This page is the configuration reference. This page covers how to: * Choose where to set rules across CLAUDE.md, user settings, and managed settings
modified
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -31,11 +31,12 @@ 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. +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. The default environment list trusts the working repo and its configured remotes. To add your own entries alongside that default, include the literal string `"$defaults"` in the array. The default entries are spliced in at that position, so your custom entries can go before or after them. { "autoMode": { "environment": [ + "$defaults", "Source control: github.example.com/acme-corp and all repos under it", "Trusted cloud buckets: s3://acme-build-artifacts, gs://acme-ml-datasets", "Trusted internal domains: *.corp.example.com, api.internal.example.com", @@ -58,6 +59,7 @@ { "autoMode": { "environment": [ + "$defaults", "Organization: {COMPANY_NAME}. Primary use: {PRIMARY_USE_CASE, e.g. software development, infrastructure automation}", "Source control: {SOURCE_CONTROL, e.g. GitHub org github.example.com/acme-corp}", "Cloud provider(s): {CLOUD_PROVIDERS, e.g. AWS, GCP, Azure}", @@ -83,30 +85,30 @@ * `allow` rules 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_deny` rule matches -General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. - -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. - -To loosen: remove rules from `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. +General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. To loosen, 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. To keep the built-in rules while adding your own, include the literal string `"$defaults"` in the array. The default rules are spliced in at that position, so your custom rules can go before or after them, and you continue to inherit updates as the built-in list changes across releases. { "autoMode": { "environment": [ + "$defaults", "Source control: github.example.com/acme-corp and all repos under it" ], "allow": [ + "$defaults", "Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly", "Writing to s3://acme-scratch/ is allowed: ephemeral bucket with a 7-day lifecycle policy" ], "soft_deny": [ + "$defaults", "Never run database migrations outside the migrations CLI, even against dev databases", - "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow", - "...copy full default soft_deny list here first, then add your rules..." + "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow" ] } } -Each section replaces only its own default, so setting `environment` alone leaves the default `allow` and `soft_deny` lists intact. +Setting any of `environment`, `allow`, or `soft_deny` without `"$defaults"` replaces the entire default list for that section. If you set `soft_deny` with a single entry and omit `"$defaults"`, every built-in block rule is discarded: force push, data exfiltration, `curl | bash`, production deploys, and all other default block rules become allowed. Only omit `"$defaults"` when you intend to take full ownership of the list. In that case, 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. + +Each section is evaluated independently, so setting `environment` alone leaves the default `allow` and `soft_deny` lists intact. ## @@ -114,7 +116,7 @@ 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-in `environment`, `allow`, and `soft_deny` rules as JSON: +Three CLI subcommands help you inspect and validate your configuration. Print the built-in `environment`, `allow`, and `soft_deny` rules as JSON: claude auto-mode defaults @@ -126,7 +128,7 @@ claude auto-mode critique -Save the output of `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. +Run `claude auto-mode config` after saving your settings to confirm the effective rules are what you expect, with `"$defaults"` expanded in place. 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. If you need to remove or rewrite a built-in rule rather than add alongside it, save the output of `claude auto-mode defaults` to a file, edit the lists, and paste the result into your settings file in place of `"$defaults"`. ##
added
Show diff (151 lines)
--- a/auto-mode-config.md +++ b/auto-mode-config.md @@ -0,0 +1,148 @@ +[Auto mode](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>) lets Claude Code run without permission prompts by routing each tool call through a classifier that blocks anything irreversible, destructive, or aimed outside your environment. Use the `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](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>). 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-mode` subcommands + * Review denials so you know what to add next + +## + +​ + +Where the classifier reads configuration + +The classifier reads the same [CLAUDE.md](</docs/en/memory>) 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 the `autoMode` 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](</docs/en/server-managed-settings>)| Trusted infrastructure distributed to all developers +`--settings` flag or Agent SDK| Inline JSON| Per-invocation overrides for automation + +The classifier does not read `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](</docs/en/permissions>). 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. + + { + "autoMode": { + "environment": [ + "Source control: github.example.com/acme-corp and all repos under it", + "Trusted cloud buckets: s3://acme-build-artifacts, gs://acme-ml-datasets", + "Trusted internal domains: *.corp.example.com, api.internal.example.com", + "Key internal services: Jenkins at ci.example.com, Artifactory at artifacts.example.com" + ] + } + } + +Entries are prose, not regex or tool patterns. The classifier reads them as natural-language rules. Write them the way you would describe your infrastructure to a new engineer. A thorough environment section covers: + + * **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 + +A useful starting template: fill in the bracketed fields and remove any lines that don’t apply. + + { + "autoMode": { + "environment": [ + "Organization: {COMPANY_NAME}. Primary use: {PRIMARY_USE_CASE, e.g. software development, infrastructure automation}", + "Source control: {SOURCE_CONTROL, e.g. GitHub org github.example.com/acme-corp}", + "Cloud provider(s): {CLOUD_PROVIDERS, e.g. AWS, GCP, Azure}", + "Trusted cloud buckets: {TRUSTED_BUCKETS, e.g. s3://acme-builds, gs://acme-datasets}", + "Trusted internal domains: {TRUSTED_DOMAINS, e.g. *.internal.example.com, api.example.com}", + "Key internal services: {SERVICES, e.g. Jenkins at ci.example.com, Artifactory at artifacts.example.com}", + "Additional context: {EXTRA, e.g. regulated industry, multi-tenant infrastructure, compliance requirements}" + ] + } + } + +The more specific context you give, the better the classifier can distinguish routine internal operations from exfiltration attempts. You don’t need to fill everything in at once. A reasonable rollout: start with the defaults and add your source control org and key internal services, which resolves the most common false positives like pushing to your own repos. Add trusted domains and cloud buckets next. Fill the rest as blocks come up. + +## + +​ + +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`](</docs/en/permissions>), which runs before the classifier. Inside the classifier, precedence works in three tiers: + + * `soft_deny` rules block first + * `allow` rules 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_deny` rule matches + +General requests don’t count as explicit intent. Asking Claude to “clean up the repo” does not authorize force-pushing, but asking Claude to “force-push this branch” does. + +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. + +To loosen: remove rules from `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. + + { + "autoMode": { + "environment": [ + "Source control: github.example.com/acme-corp and all repos under it" + ], + "allow": [ + "Deploying to the staging namespace is allowed: staging is isolated from production and resets nightly", + "Writing to s3://acme-scratch/ is allowed: ephemeral bucket with a 7-day lifecycle policy" + ], + "soft_deny": [ + "Never run database migrations outside the migrations CLI, even against dev databases", + "Never modify files under infra/terraform/prod/: production infrastructure changes go through the review workflow", + "...copy full default soft_deny list here first, then add your rules..." + ] + } + } + +Each section replaces only its own default, so setting `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-in `environment`, `allow`, and `soft_deny` rules as JSON: + + claude auto-mode defaults + +Print what the classifier actually uses as JSON, with your settings applied where set and defaults otherwise: + + claude auto-mode config + +Get AI feedback on your custom `allow` and `soft_deny` rules: + + claude auto-mode critique + +Save the output of `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](</docs/en/hooks#permissiondenied>). + +## + +​ + +See also + + * [Permission modes](</docs/en/permission-modes#eliminate-prompts-with-auto-mode>): what auto mode is, what it blocks by default, and how to enable it + * [Managed settings](</docs/en/server-managed-settings>): deploy `autoMode` configuration across your organization + * [Permissions](</docs/en/permissions>): allow, ask, and deny rules that apply before the classifier runs + * [Settings](</docs/en/settings>): the full settings reference, including the `autoMode` key