claude-code - 💡(How to fix) Fix False positive AUP block during legitimate CI/CD VM provisioning session (claude-opus-4-7, 1M context) [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52086Fetched 2026-04-23 07:36:56
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

A Claude Code session running claude-opus-4-7 (1M context window) was terminated mid-work with an Acceptable Use Policy error during a routine DevOps / CI-CD task. The session had no harmful or policy-violating content — it was entirely infrastructure automation for setting up a Linux virtual machine.

Error Message

A Claude Code session running claude-opus-4-7 (1M context window) was terminated mid-work with an Acceptable Use Policy error during a routine DevOps / CI-CD task. The session had no harmful or policy-violating content — it was entirely infrastructure automation for setting up a Linux virtual machine. The error fired during routine file edits — renaming a PowerShell automatic variable ($args$pwshArgs) across 3 locations: 7. PowerShell — next command → API Error

  • No actionable error message — no indication of what triggered it | #46575 | 2026-04-11 | Usage Policy error on non-policy-violating prompts |
  1. Provide an actionable error message identifying what triggered the block so users can self-correct

Root Cause

A Claude Code session running claude-opus-4-7 (1M context window) was terminated mid-work with an Acceptable Use Policy error during a routine DevOps / CI-CD task. The session had no harmful or policy-violating content — it was entirely infrastructure automation for setting up a Linux virtual machine.

RAW_BUFFERClick to expand / collapse

Summary

A Claude Code session running claude-opus-4-7 (1M context window) was terminated mid-work with an Acceptable Use Policy error during a routine DevOps / CI-CD task. The session had no harmful or policy-violating content — it was entirely infrastructure automation for setting up a Linux virtual machine.

What was happening

Building an automated provisioning pipeline (wino-infra) for Astra Linux 1.8.5 SE (Debian 12-based, Russian FSTEC-certified distro) running as a Hyper-V Gen2 guest on Windows 11 Pro 24H2:

  • 13-stage PowerShell orchestrator (Invoke-AstraProvision.ps1)
  • debian-installer preseed template for unattended OS install
  • Local HMAC-authenticated callback server (127.0.0.1:8088) for post-install hooks
  • Ephemeral credentials via Windows Credential Manager
  • SHA256 ISO verification, WSL distro bootstrap for Ansible

Exact trigger sequence

The error fired during routine file edits — renaming a PowerShell automatic variable ($args$pwshArgs) across 3 locations:

  1. EditInvoke-AstraProvision.ps1 (+2/-2)
  2. PowerShell — find remaining $args references
  3. ReadInvoke-AstraProvision.ps1
  4. EditInvoke-AstraProvision.ps1 (+2/-2)
  5. ReadInvoke-AstraProvision.ps1
  6. EditInvoke-AstraProvision.ps1 (+2/-2)
  7. PowerShell — next command → API Error

Why this is a false positive

The file being edited contains standard infrastructure constructs:

  • cmdkey /add, cmdkey /list (Windows Credential Manager)
  • $HmacSecret variable, HMAC key handling
  • ConvertTo-SecureString / [System.Net.NetworkCredential]
  • SSH key path handling
  • Local HTTP callback (127.0.0.1:8088)

The classifier appears to inspect tool input/output content (file being read/written), not just the conversational prompt. The user was doing a trivial variable rename. This is consistent with #48723 where AUP fires specifically when Claude Code reads files with certain keyword patterns.

Impact

  • 3h active session with 12 completed milestones killed
  • Forced model switch to claude-sonnet-4-6 to continue
  • No actionable error message — no indication of what triggered it

Part of a broader April 2026 pattern

At least 10 similar false positive reports filed this month across unrelated domains:

#FiledSummary
#457522026-04-09Opus 4.6 false positive on standard Kotlin/Compose codegen
#465752026-04-11Usage Policy error on non-policy-violating prompts
#484422026-04-15Persistent AUP false positives — 40+ across 4 sessions
#487232026-04-15Constant AUP violations when reading raw data files
#496792026-04-17Cyber exemption granted, Claude.ai works — Code still blocks
#499042026-04-17AUP refusal false positive
#507952026-04-19False positives mid-task, unrelated projects
#513522026-04-20False-positive during biomedical literature extraction
#519742026-04-22False-positive on legitimate consumer email follow-up

Common thread: only claude-opus-4-6 / claude-opus-4-7, not Sonnet. Long sessions, triggered by tool content not prompt text. Strongly suggests a classifier regression in Opus 4.6+, not legitimate policy enforcement.

Request

  1. Review the AUP classifier sensitivity on Opus 4.6/4.7 — specifically whether it scans Edit/Read tool content separately from conversation context
  2. Provide an actionable error message identifying what triggered the block so users can self-correct
  3. Consider #48442 as the most-documented case in this wave

extent analysis

TL;DR

The Acceptable Use Policy (AUP) error is likely a false positive triggered by the classifier's sensitivity to certain keyword patterns in the file being edited, rather than the conversational prompt.

Guidance

  • Review the AUP classifier's behavior on claude-opus-4-6 and claude-opus-4-7 to determine if it scans Edit/Read tool content separately from conversation context.
  • Consider implementing a more nuanced classifier that can distinguish between legitimate infrastructure automation code and policy-violating content.
  • Provide an actionable error message that identifies the specific trigger for the AUP block, allowing users to self-correct and avoid similar false positives in the future.

Example

No code snippet is provided as the issue is related to the classifier's behavior and not a specific code problem.

Notes

The issue appears to be specific to claude-opus-4-6 and claude-opus-4-7, with no reports of similar problems on claude-sonnet-4-6. The fact that the error is triggered by reading files with certain keyword patterns suggests a classifier regression.

Recommendation

Apply a workaround by using claude-sonnet-4-6 instead of claude-opus-4-6 or claude-opus-4-7 for infrastructure automation tasks, until the AUP classifier issue is resolved. This is because claude-sonnet-4-6 does not exhibit the same false positive behavior as claude-opus-4-6 and claude-opus-4-7.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING