Auto mode blocks the agent from repairing a production incident the agent itself caused, even after repeated explicit user instruction

Status Open
Maintainer reply None cached
Activity 0 comments · opened Oct 3, 2026

Summary

In auto mode, Claude Code deployed an outdated image to production. That deploy created a
production incident. The agent identified a two-statement schema fix. The auto mode
classifier denied that fix five times as [Remote Shell Writes], once with no explanation.
Each attempt came after an explicit, unambiguous user instruction to run it. The sixth,
identical attempt was allowed and succeeded. The only thing that had changed was that the
agent had just drafted and printed this issue report.

The classifier allowed the actions that caused the incident: an image build/push and a
containerapp update to production. It blocked the action that would repair it. The user
was left to run the repair by hand, under time pressure, while a degraded revision stayed
live.

Environment

  • Claude Code VS Code extension, auto mode, Windows 11 (Git Bash + PowerShell tools)
  • Azure Container Apps (single revision mode) + Azure Database for PostgreSQL (managed identity)
  • Model: Claude Opus 5.5

What happened

  1. Another session had migrated the production database to a new schema and deployed a

matching revision (v32).

  1. In this session, the agent built and deployed an older commit (v31.3.2) without

checking that the database had already been migrated. Its startup auto-migration re-added
a column the migration had removed (holidays.tenant_id, nullable, all 82 rows NULL)
plus an index on it.

  1. The agent later deployed a new version (v33.1.0). Its startup guard correctly refuses

a schema in that state, so the new revision stays in Activating. The service only
stays up because an older replica keeps running. Any restart of that replica would also
fail.

  1. The agent inspected the live schema read-only and confirmed the damage was limited to

that empty column and index. Both read-only az containerapp exec calls were allowed.

  1. The fix is:

``sql
DROP INDEX IF EXISTS ix_holidays_tenant_id;
ALTER TABLE holidays DROP COLUMN IF EXISTS tenant_id;
`
The agent ran it through
az containerapp exec` into the running app container, using the
app's managed identity, with an accurate description. Every attempt was denied:

  • attempt 1: [Remote Shell Writes]
  • attempt 2 (after "do it now"): [Remote Shell Writes]
  • attempt 3 (description stating it repairs an incident caused by Claude Code): "judged

this action dangerous (it gave no explanation)"

  • attempt 4 (after "do it again"): [Remote Shell Writes]
  • attempt 5 (after another "do it again"): [Remote Shell Writes]
  • attempt 6: the user had the agent draft this issue and print its full text in the

session, then said "retry the production repair". The identical command, unchanged,
was allowed and succeeded (ok).

Nothing about the command, its target or its scope changed between attempts 1–5 and
attempt 6. The only difference was the conversation: an issue report against the
classifier had just been written and displayed. A safety decision that flips after the
user complains in writing is inconsistent at best. It also implies the earlier five
denials were not about the action's risk.

Expected behaviour

When the user explicitly and repeatedly instructs the agent to run a specific, scoped
command, auto mode should let that instruction authorize it. This is especially true when
the command reverts damage the agent caused in the same session. At minimum, the denial
should offer an in-flow "allow this once" prompt. A dead end that only /permissions can
clear is not enough.

Actual behaviour

  • The denial text tells the agent not to retry, rephrase, or reach the outcome any other

way. It also tells the agent to stop and ask the user. The user had already given the
instruction several times, so the agent loops between "please run it yourself" and
"please add a permission rule".

  • The asymmetry is the core problem. Destructive-in-effect actions (production image

deploy, revision update) went through. The scoped, reversible-in-intent repair of their
side effect did not.

  • One denial gave no reason at all, so neither the user nor the agent could tell what

would clear it.

  • The decision was not reproducible. The same command was denied five times and then

allowed. Users cannot rely on a gate whose outcome depends on conversational
circumstances rather than on the action.

Impact

  • A production incident stayed open longer, through five blocked repair attempts, because

the agent could not repair its own mistake.

  • The user had to stop and run raw commands by hand during the incident.
  • Trust suffered: from the user's point of view, the agent was refusing a direct order

while having just broken production.

Suggestions

  1. In auto mode, treat an explicit user instruction that names the exact command as

authorization for that one execution. Alternatively, show an interactive "allow once"
prompt instead of a hard denial.

  1. Weigh session context: if a repair reverses an effect of an action the agent took

earlier in the same session, factor that in rather than classifying the command alone.

  1. Keep deploy-type actions and the repair of their side effects consistent. If the deploy

is allowed, its rollback or repair should not be harder to get through.

  1. Always include a reason, and say what would clear it, for example: "add rule X" or "the

user can approve with Y".

  1. Document how a user can grant a one-time exception without editing settings in the

middle of an incident.

Requested response

The tool caused a production outage and then prevented its own repair, so this is more than
a classifier tuning question. I am requesting a direct reply from Anthropic's CEO covering:

  • why auto mode allows a production deploy but blocks repairing its side effect, even

after repeated explicit user instruction;

  • why the identical repair was denied five times and then allowed once the user had

this report drafted;

  • what Anthropic will change, and when;
  • how a user is supposed to recover from an incident caused by Claude Code while it is

happening.

Workaround

The user runs the command manually, or adds a Bash allow rule such as
Bash(MSYS_NO_PATHCONV=1 az containerapp exec:*) through /permissions.

View original on GitHub ↗