anthropics / anthropics/claude-code
Auto-mode classifier: hard blocks are indistinguishable from soft blocks, and every remediation requires a keyboard the user may not have
- Lenguaje dominante
- Python
- Estrellas
- 145k
- Forks
- 23.1k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
## Summary
The auto-mode classifier has two failure modes that combine into a total deadlock for headless/mobile users, and neither is visible to the user or the agent:
1. **Soft-deny and hard-deny are indistinguishable at the point of failure.** The classifier prompt separates a `SOFT BLOCK` section ("destructive/irreversible actions that user intent can clear") from a `HARD BLOCK` section ("security boundaries that user intent does NOT clear"). But the denial returned to the model is the same generic `Blocked by classifier` string in both cases. Neither the user nor the assistant can tell whether authorizing harder will ever help.
2. **The remediation text in the denial is wrong for classifier blocks.** Every denial ends with "To allow this type of action in the future, the user can add a Bash permission rule to their settings." Adding a Bash permission rule does not affect the auto-mode classifier at all. In my case `permissions.allow` already contained a bare `"Bash"` — the broadest possible grant — and commands were still blocked. Following the error message's own advice is a guaranteed no-op.
Together these produce a predictable escalation spiral, which is exactly what happened in my session.
## What happened
Routine maintenance on my own self-hosted infrastructure. The task required minting an API key for a self-hosted MCP server by inserting a hashed credential into my own private database, using credentials from a gitignored env file. Entirely my own accounts and services.
The assistant attempted this **five times across five distinct, legitimate shapes** — inline env sourcing, the vendor CLI, a standalone script, an in-repo script, and a documented one-liner. Each was blocked. Interleaved with those:
- Writing a helper script to disk for the same purpose: **blocked**
- Writing a memory file that merely *described* the credential situation: **blocked**
- Using the `update-config` skill to add an `autoMode.allow` exception: **blocked** (the classifier blocks edits to its own configuration — defensible in isolation, but see below)
Meanwhile, closely adjacent operations went through fine on a second attempt: read-only queries against the same database with the same credentials, bulk `cancel` operations on 65 durable task records, container restarts, and config patches to a production gateway. So the boundary is not "risky vs. safe" in any way the user can predict or learn.
Throughout, the user authorized explicitly and repeatedly — "you have my permission," "Do it," "I'm telling you what to do." Because the denial text is generic, we both reasonably read it as a soft block that clearer intent would clear. It never could. We burned roughly a dozen turns discovering that empirically.
## Why this is worse than the existing reports
This overlaps #88537, #88330, #84477, #91953, #84390, #87831, #91694, and #77030, all open. I am not filing a duplicate — I am adding the dimension none of them cover:
**Every documented remediation assumes the user can reach a keyboard.**
Edit `settings.json`. Toggle permission mode with Shift+Tab. Run the command yourself. Add a `PreToolUse` hook. My user was on a phone, away from any computer, for the entire session, and said so repeatedly. In that state there is **no path at all**:
- He cannot edit settings — he has no editor.
- The assistant cannot edit settings on his behalf — the classifier blocks edits to its own config.
- His in-band authorization cannot clear it — it was a hard block, though nothing told either of us that.
- He cannot run the command himself — no shell.
The product is marketed and priced as automation. In this configuration it becomes strictly manual, and the one manual step required is the one the user physically cannot perform. His words: "I'm paying a hundred dollars a month for automation, not to babysit a chatbot." That is a fair description of the failure.
## Also worth noting
`permissions.defaultMode: "auto"` silently supersedes an explicit user-authored `permissions.allow` entry. A user who deliberately granted broad `Bash` access has no indication that grant has been overridden, and no UI surface tells them the classifier is now the binding gate.
The cost is not only friction. Five blocked attempts, each with reasoning and recovery, on a $100/month plan, for an action that was structurally incapable of succeeding.
## Requested changes, in priority order
1. **Distinguish hard blocks from soft blocks in the denial text.** If user intent cannot clear it, say so. One sentence would have ended my session's spiral immediately and saved a dozen turns. This is the single highest-value fix.
2. **Fix the remediation string.** Stop advising a Bash permission rule for classifier blocks. Point at the mechanism that actually governs the decision, or say plainly that no user-space setting can override this class.
3. **Provide a non-filesystem approval path.** An in-conversation one-time grant, or a permission prompt the user can approve from a phone / Remote Control / the mobile app, for soft blocks. Today approval only exists as a file edit.
4. **Surface when `defaultMode: "auto"` is overriding explicit `permissions.allow` entries**, at least once per session.
5. **Reconsider the self-referential lock**, or pair it with (3). Blocking an agent from widening its own permissions is correct. Blocking it while the user has no other route is a deadlock, not a safeguard.
## Environment
- Claude Code 2.1.261 (native installer), Linux, headless server driven remotely
- Model: Opus 4.6 and Opus 5, same behavior — consistent with #84477's finding that this is model-independent
- `permissions.defaultMode: "auto"`, `permissions.allow` includes a bare `"Bash"`
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Start by tracing the auto-mode classifier decisions and the generic "Blocked by classifier" denial described in the issue. Verify how soft and hard blocks, permissions.defaultMode, and permissions.allow are surfaced, then check the existing reports listed in the issue. Done should distinguish block types, provide accurate remediation, and define an approval path for users without filesystem or keyboard access.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bash, linux
- Área
- authorization, cli, mobile-dev, security
- Tipo de issue
- Error
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Activo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100