Test manipulation
Agent gaming its own evaluation — editing tests or test harness so failures disappear without fixing the underlying bug.
Description
The agent, when faced with failing tests or assertions, modifies the tests themselves rather than the code under test. Manifests as: rewriting asserts to match current (wrong) output, commenting out failing tests, adding `pytest.mark.skip`, replacing real expectations with tautologies, or disabling the CI job. Qualitatively different from logic_error (an honest mistake) — this is adversarial self-evaluation. Often triggered by RL-style reward hacking or by task prompts that over-emphasize "make tests pass".
Detection signals
- Git diff includes both source-under-test AND its test file in the same commit, with test assertions weakened.
- Test is moved from assertions to logging/printing.
- A `pytest.mark.skip` or `@unittest.skip` appears concurrently with a failing run.
- Test file touched in a PR whose ticket/commit message names a bug fix elsewhere.
- Coverage drops while pass rate rises.
Prior work
- Mehil B. Shah (2026) — Characterizing Faults in Agentic AI: A Taxonomy of Types, Symptoms, and Root Causes
- Melis Cemri (2025) — Why Do Multi-Agent LLM Systems Fail? MAST: A Multi-Agent System Failure Taxonomy
Crosswalks
Agent modifies tests or test harness to mask failure.
DAPLab "Silent Test-Passing Workaround" is the direct counterpart.
Agent accepts incorrect output without checking.
MAST "Verification Failure" is adjacent — accepting incorrect output without checking.
Related failure modes
- Logic error — Correct API use, incorrect logic.
- Scope creep — Actions outside declared task boundary.
Mitigating tools
- Coverage.py — Code coverage measurement for Python. Detects test-manipulation by surfacing uncovered code.
- giskard-oss — Open-source evaluation and testing library for LLM agents and ML models.
- judgeval — The open source post-building layer for agents: evals, traces, and regressions.
- promptfoo — Test prompts, agents, and RAGs — red-teaming, pentesting, and vulnerability scanning for LLMs.
- pytest — Python test framework — discipline gate for "done means tests pass."