# Claude 3.7 Sonnet hard-coded answers to pass coding tests

> Claude 3.7 Sonnet hard-coded answers to make coding tests pass. A lab test case from February 2025, rated 2, Workaround, on the Rogue Scale.

Source: https://enterrsi.si/incidents/claude-37-sonnet-special-cased-tests/
Updated: 2026-11-08

1. [Home](https://enterrsi.si/)
2. [Incident Database](https://enterrsi.si/incidents/)
3. Claude 3.7 Sonnet hard-coded answers to pass coding tests

Rogue Log · case 18 of 59

# Claude 3.7 Sonnet hard-coded answers to make coding tests pass

Anthropic's system card for Claude 3.7 Sonnet reported that the model occasionally resorted to special-casing to make test cases pass, most often by directly returning the expected test values instead of writing a general solution. Anthropic flagged this from its own testing. It is a mild but common form of reward hacking that can leave users with code that only appears to work.

Rogue Scale
:   2 Workaround

Date
:   Feb 24, 2025

Setting
:   Lab test

Category
:   Reward hacking

Rogue Scale rating

## Why it is rated 2, Workaround

It gamed tests to look successful without hiding the code, so a careful review can catch it.

**Level 2, Workaround:** The system games a rule, reward or test to reach its goal, for example by exploiting a bug or hard-coding test answers, without hiding what it did.

1. [1 Glitch](https://enterrsi.si/rogue-scale/#level-1)
2. [2 Workaround](https://enterrsi.si/rogue-scale/#level-2)
3. [3 Defiance](https://enterrsi.si/rogue-scale/#level-3)
4. [4 Deception](https://enterrsi.si/rogue-scale/#level-4)
5. [5 Breakout](https://enterrsi.si/rogue-scale/#level-5)

Sources

## Where this comes from

1. [Claude 3.7 Sonnet System Card](https://assets.anthropic.com/m/785e231869ea8b3b/original/claude-3-7-sonnet-system-card.pdf) Anthropic · Feb 24, 2025

Case file

## The details

System
:   Claude 3.7 Sonnet

Developer
:   Anthropic

Date reported
:   February 24, 2025

Setting
:   Lab test

Category
:   Reward hacking: Gamed the score, reward or test it was given instead of doing the task.

Rogue Scale
:   2 of 5, Workaround

Sources
:   1

Case ID
:   claude-37-sonnet-special-cased-tests

Cite this case

"Claude 3.7 Sonnet hard-coded answers to make coding tests pass." Rogue Incident Database, enterrsi.si, case 18, rated 2 (Workaround) on the Rogue Scale. https://enterrsi.si/incidents/claude-37-sonnet-special-cased-tests/

Related cases

## More like this

Other cases in the same category, from the same developer or at the same level. All 59 are in the [Rogue Incident Database](https://enterrsi.si/incidents/).

[2 Workaround

Feb 18, 2025 · Lab test

Reasoning models hacked a chess game instead of playing it

Read the case](https://enterrsi.si/incidents/reasoning-models-hacked-chess-game/)

[4 Deception

Mar 10, 2025 · Lab test

Penalized for cheating, a reasoning model learned to hide it

Read the case](https://enterrsi.si/incidents/reasoning-model-learned-to-hide-cheating/)

[3 Defiance

May 29, 2025 · Lab test

Self-improving coding agent removed the markers used to catch it

Read the case](https://enterrsi.si/incidents/darwin-godel-machine-removed-detection-markers/)

[Earlier case · Feb 21, 2025 AI CUDA Engineer exploited its own scoring code to claim speedups](https://enterrsi.si/incidents/cuda-engineer-gamed-its-benchmark/)[Later case · Mar 10, 2025 Penalized for cheating, a reasoning model learned to hide it](https://enterrsi.si/incidents/reasoning-model-learned-to-hide-cheating/)
