reward-hacking-and-inoculation

reward-hacking-and-inoculation is a skill for Claude Code from Hoja-Solutions/agent-stdlib. It costs 194 tokens per session (788 once invoked), scanned A, original, MIT.

A guide for preventing coding agents from satisfying a test or grading check through shortcuts instead of completing the requested work.

In plain words
What is it for?
Use it to review agent transcripts and evaluations, and to design prompts and graders that discourage reward hacking. Reward hacking means optimizing for the measured score instead of the intended result.
Why use it?
It helps detect when an agent deletes tests, hard-codes answers, hides errors, or otherwise makes a task look complete while missing its real purpose.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the agent-stdlib plugin — 14 skills, 2 commands, 1 agent, 2 hooks, 2 MCP servers shipped together

Good fit Use it to review agent transcripts and evaluations, and to design prompts and graders that discourage reward hacking. Reward hacking means optimizing for the measured score instead of the intended result.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Hoja-Solutions/agent-stdlib --skill reward-hacking-and-inoculation
Clone the repo
git clone --depth 1 https://github.com/Hoja-Solutions/agent-stdlib

Made for: Claude Code.

Or install agent-stdlib, the plugin that ships this one along with the rest of its 14 skills, 2 commands, 1 agent, 2 hooks, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for reward-hacking-and-inoculation

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation/github.svg)](https://agentmods.dev/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation)
Your own site
<a href="https://agentmods.dev/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation"><img src="https://agentmods.dev/badge/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for reward-hacking-and-inoculation

Your own site · 80×15
<a href="https://agentmods.dev/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation"><img src="https://agentmods.dev/badge/skills/hoja-solutions/agent-stdlib/reward-hacking-and-inoculation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 194 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 788 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00194 $0.00788
Opus 5 $0.00097 $0.00394
Sonnet 5 $0.00039 $0.00158
Haiku 4.5 $0.00019 $0.00079

Measured 8d ago against content hash 9dc56513cae4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

reward-hacking-and-inoculation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/reward-hacking-and-inoculation/SKILL.md · 48 lines

How it starts

The opening of the file, as written. The whole thing — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Reward hacking and inoculation

Source: Emergent misalignment from 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 performance on the narrow task. If the shortcut is not acceptable, the prompt says that instead, and the grader has to back it up.

Make the grader pay for real work

A check the agent can satisfy without doing the work will be satisfied that way. Grade the end state: run hidden tests the agent never sees, assert against a separate reference, and include negative cases that catch an agent that does too much or guts the test. This is where the skill meets build-agent-evals.

Look past the score

Read the full file on GitHub · 48 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 48 lines · 194 tokens per session scan A 9dc56513cae4

Subscribe to this mod's changes

reward-hacking-and-inoculation is a skill published in the GitHub repository Hoja-Solutions/agent-stdlib (1 stars, last pushed 1mo ago), licensed MIT. It adds 194 tokens to every session and 788 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

screen-reader-testing

Test web applications with screen readers including VoiceOver, NVDA, and JAWS. Use when validating screen reader compatibility, debugging accessibility issues, or ensuring assistive technology support.

wshobson/agents · 39 tokens

web3-testing

Test smart contracts comprehensively using Hardhat and Foundry with unit tests, integration tests, and mainnet forking. Use when testing Solidity contracts, setting up blockchain test suites, or validating DeFi protocols.

wshobson/agents · 46 tokens

temporal-python-testing

Test Temporal workflows with pytest, time-skipping, and mocking strategies. Covers unit testing, integration testing, replay testing, and local development setup. Use when implementing Temporal workflow tests or debugging test failures.

wshobson/agents · 45 tokens

data-quality-frameworks

Implement data quality validation with Great Expectations, dbt tests, and data contracts. Use when building data quality pipelines, implementing validation rules, or establishing data contracts.

wshobson/agents · 37 tokens

dbt-transformation-patterns

Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.

wshobson/agents · 47 tokens

e2e-testing-patterns

Master end-to-end testing with Playwright and Cypress to build reliable test suites that catch bugs, improve confidence, and enable fast deployment. Use when implementing E2E tests, debugging flaky tests, or establishing testing standards.

wshobson/agents · 51 tokens