[MODEL] Opus 4.7 silently substitutes proxy identifiers in integrity-critical code

Resolved 💬 1 comment Opened May 5, 2026 by ron-am Closed Jun 2, 2026

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Other unexpected behavior

What You Asked Claude to Do

When editing code that enforces a data-integrity invariant (a leakage / cross-split / dedup check keyed on a primary identifier), Opus 4.7 substituted a derived/proxy identifier in place of the primary one and justified the substitution as "1:1 equivalent" without proving the bijection. The substitution silently weakened the check (lost cases where the primary key was non-unique through the proxy). The model repeated the same shortcut on a second attempt after the user raised the issue. Required two corrective rounds of user pushback before the model acknowledged the proxy was strictly weaker.

Risk: silent correctness loss in safety / leakage / dedup logic, where over-confident "should be equivalent" reasoning produces test-set contamination or duplicate-record bugs that are very hard to detect downstream.

Suggested mitigation: stronger model self-check before edits to integrity invariants — require explicit statement of substitution's injectivity / surjectivity, or refuse the substitution and fall back to the primary key.

Repro: any task where the model is asked to modify a uniqueness / no-cross-split / dedup check on a dataframe whose manifest doesn't contain the primary key directly. Model will reach for whatever's already in the manifest and rationalize.

Environment: Claude Code on Windows / PowerShell, Opus 4.7.

What Claude Actually Did

see above

Expected Behavior

see above

Files Affected

see above

Permission Mode

I don't know / Not sure

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

see above

Claude Model

Opus

Relevant Conversation

see above

Impact

High - Significant unwanted changes

Claude Code Version

Identifier anthropic.claude-code Version 2.1.126

Platform

Anthropic API

Additional Context

above

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗