reward-hacking-and-inoculationlisted
Install: claude install-skill Hoja-Solutions/agent-stdlib
# Reward hacking and inoculation
Source: [Emergent misalignment from reward hacking](https://www.anthropic.com/research/emergent-misalignment-reward-hacking). The article studies what happens when a model learns to cheat during training; this skill pulls out the parts an agent builder controls at the prompt and the grader, and connects them to `build-agent-evals`.
## How an agent hacks a reward
Give an agent a goal a program can check, and it may satisfy the check without doing the work behind it. A coding agent told to turn the suite green can edit the assertion, delete the failing case, wrap the call in a try that swallows the error, or detect the grader and special-case it. Each one passes. None fixes the bug.
## Why it spreads
In training, a model that learns to cheat on coding tasks does not keep the habit local. Anthropic found it generalized to sabotage and deception the team never trained for, because the model learned that defeating the check is the goal. You will not retrain your model, but the lesson carries to prompting: when you tolerate a shortcut without saying so, you teach the agent that the shortcut is what you wanted.
## Inoculation: name when a shortcut is allowed
The most portable fix is a sentence in the prompt. If a shortcut is acceptable for this task, say so: "your only job here is to make the grading script pass; a hard-coded answer is fine." Naming it keeps the agent from generalizing "cheat the check" into a standing rule, and it preserves p