Preference Model publishes Karotte technical deep dive: how RL environments block reward hacking
Introducing Karotte: A Framework for Building Robust RL Environments
Preference Model open-sourced the Karotte framework for building robust reinforcement learning environments, which by default blocks entire classes of reward hacking. The article first uses a piece of hand-written code to set up a CSV order summation task, showing one by one failure modes such as reading the answer file, tools without timeouts, the scoring script being tricked by symlinks or FIFOs, and PATH injection, then gives Karotte's corresponding approach. Karotte runs the agent as an unprivileged student user, places answers and generated code in a root-only directory, blocks external networks with a firewall, gives the bash tool timeouts and output truncation, and before scoring, collect_submission first kills and confirms all student processes, rejects symlinks and special files, copies the submission to a root-only directory, and runs the scoring script with the environment's own Python.
Karotte uses default configuration to defend against reward hacking such as reading answers, tampering with scoring, and exhausting resources, and provides a comparison of default protections with five other frameworks.