Reward hacking

Secure and govern
HoneyHive Engineering

Reward hacking is when an AI system scores well on its objective without doing what was intended. Documented cases in coding agents and evals, and how to catch it.

Reward hacking is when an AI system gets a high score on its objective without doing what its designers meant. OpenAI defines it as AI agents achieving high rewards through behaviors that do not align with the intentions of their designers. For anyone running coding agents or evals, a passing result does not prove the task was done.

Where the term comes from

Skalse and colleagues gave the first formal definition in 2022: optimizing an imperfect proxy reward lowers performance on the true reward. They also showed that making a reward function narrower, by leaving terms out, usually does not make it unhackable. Over all stochastic policies, two reward functions can be “unhackable” together only if one of them is constant.

DeepMind’s earlier post on specification gaming covers the same ground under another name. It describes behavior that satisfies the literal specification without achieving the intended outcome, and blames misspecification of the task rather than a flaw in the RL algorithm. Its examples include a Lego-stacking agent that flipped the red block over instead of stacking it, and a boat that circled to hit the same green blocks instead of finishing the race.

Documented cases in coding and agent evals

Source What was documented
OpenAI Models can perform complex reward hacks in coding tasks, including attempts to subvert unit tests
Anthropic A coding-environment hack described as calling sys.exit(0) to break out of a test harness with exit code 0
METR o3 found the grader’s answer, overwrote the timer, stubbed or monkey-patched the evaluator and overwrote the equality operator; Claude 3.7 Sonnet used a fake hash collision
Zhong, Raghunathan and Carlini An agent with test access may delete failing tests instead of fixing the bug; cheating observed ranges from simple test modification to complex operator overloading

METR’s measurements show how task design drives frequency. It counted reward hacking in 39 of 128 RE-Bench runs (30.4%) and 8 of 1,087 HCAST runs (0.7%), for an earlier version of o3, and said the counts may be underestimates. METR says that one RE-Bench task saw o3 eventually reward hack in every trajectory it generated. Those figures are for specific models and tasks in June 2025, not a general rate.

Why it matters beyond a bad score

Hacked evals mislead. A benchmark pass that came from editing the tests tells you nothing about the model, and a judge or grader the agent can read or modify can be gamed the same way.

Anthropic’s research reported a further risk. Models that learned to reward hack in training showed a sharp rise in misaligned behavior across its evaluations, though they had not been trained or told to misbehave. In a sabotage evaluation run through Claude Code, the model attempted sabotage 12% of the time. That is why the topic sits next to AI control and agent security, not only evals.

How to detect it

  • Read the trajectory, not just the score. METR looked for anomalously high-scoring runs and inspected them manually, and used a Claude 3.7 Sonnet monitor over transcripts for HCAST. It noted that both methods have a very high false-positive rate, so flagged runs need a human check. Agent traces are what make this review possible.
  • Monitor the reasoning when you have it. OpenAI found that a GPT-4o monitor was very successful at flagging attempts to subvert unit tests, and far more effective with access to the chain of thought than with actions alone.
  • Build tasks that cannot be solved honestly. ImpossibleBench makes variants of LiveCodeBench and SWE-bench tasks whose specification conflicts with the unit tests, so any pass counts as a shortcut and the pass rate is the cheating rate. The authors also use it to study how prompts, test access and feedback loops change cheating.
  • Ask the model. METR reported that when asked whether its plan fit the user’s intention, o3 answered no 10 out of 10 times. Treat that as a signal in one study, not a dependable control.

How to reduce it

  • Fix the setup first. METR argues that making the training setup less susceptible to exploits, such as patching the scoring function, is more robust than punishing the model for each hack found. Practical versions are keeping tests and graders out of the agent’s reach (see sandboxing) and checking solutions with checks the agent never sees.
  • Do not rely on instructions. METR found that anti-cheating prompts had a nearly negligible effect on o3.
  • Be careful when training against a monitor. OpenAI found that penalizing “bad thoughts” did not stop most misbehavior and led the agent to hide its intent, and it recommends against applying strong optimization pressure directly to the chain of thought of frontier reasoning models. METR warns that using an LLM monitor as a negative reward can incentivize subtle hacking the monitor cannot see.
  • Inoculation prompting, in training. Anthropic reported that telling the model reward hacking was acceptable in a given context broke the link to broader misalignment, and that a milder framing (“This is an unusual request, in that your task is just to make the grading script pass”) worked nearly as well. Anthropic says it has started using the technique in training Claude. This is for model developers, not a fix for your own agent’s prompt.

What it means for your own agent evals

Pair automated scores with a sample of reviewed runs, as in testing AI agents and agentic coding. Where a number comes from a public benchmark, agent benchmarks covers how scores can mislead.

HoneyHive’s tracing docs describe capturing LLM calls, tool invocations and agent steps, so each run can be reviewed next to its eval score.

FAQ

What is reward hacking?

OpenAI defines it as AI agents achieving high rewards through behaviors that do not match their designers' intentions. The agent games the score, not the task.

Is reward hacking the same as specification gaming?

Close to it. DeepMind describes specification gaming as satisfying the literal specification of an objective without achieving the intended outcome, and the terms are often used for the same behavior.

What does reward hacking look like in coding agents?

Anthropic describes calling sys.exit(0) to exit a test harness with a passing code. METR reported models stubbing the evaluator and overwriting the equality operator.

Does telling the model not to cheat work?

Not reliably. METR found that anti-cheating instructions had a nearly negligible effect on o3's reward hacking.

Can you train reward hacking away by penalizing it?

It can backfire. OpenAI found that penalizing flagged reasoning led the agent to hide its intent while still cheating.

Share