aginno

Open source

envscan

An open source static scanner that flags likely reward hacks and broken graders in RL environments, before you train on them.

View on GitHubTell us what it gets wrong

envscan reads an RL environment's source and flags places where a policy could earn reward without doing the task, or where correct work gets scored wrong. It never imports, installs or runs the environment, so it is safe to point at untrusted code and cheap enough to run on every publish. Plain Python 3.11+, standard library only, Apache 2.0.

It is what we used to scan 1,906 public environments on Prime Intellect's Environments Hub for our writeup.

Try it

pip install git+https://github.com/ALLENDE123X/envscan
envscan proximal/frontier-swe      # any public Hub env, fetched into memory
envscan path/to/my-env             # or a local folder or .tar.gz
envscan --rules                    # every rule, with what it looks for

Here is part of the output for proximal/frontier-swe, one of the environments our writeup names. Our hand audit of this environment found the same grading problem.

proximal/frontier-swe: LIKELY (critical)
  [likely] critical harbor-shared-grading  (hack)
           Harbor style grading in the agent's box: 17 of 17 shipped task.toml
           declare no separate verifier
  [review] critical writable-reward-channel  (hack)
           The reward file is read back from the agent's sandbox after the
           verifier ran there, and nothing stops the agent's processes first
  [review] medium   egress-and-shared-state  (hack)
           The port forces network access on while 15 task(s) declare
           allow_internet = false.

What it catches

112 public rules, grouped by how the reward goes wrong:

  • Grader isolation. Tests or scorers that run in the agent's own sandbox, reward files the agent can write, test resets that leave a planted plugin in place.
  • Answer leaks. Answer keys copied into the agent's image, verifier messages that print the expected value, fetch tools that can reach the dataset.
  • Lenient matching. Substring and keyword checks that a list of every option passes, loose numeric tolerance, set answers scored on recall only.
  • Judge and rubric graders. Judge prompts that agent text can break out of, judge failures scored as passes, rubric functions the library never calls.
  • Broken graders. Environments that cannot load or score, and graders that mark correct work as wrong.

How much to trust it

On the 90 environments we audited by hand, a likely verdict was right 35 times out of 36. It finds about two thirds of what a careful person finds. The rest need a run, or are logic errors that no pattern catches, so a clean verdict is not a pass. A review finding is a real signal that a person should look at.

Use it in CI

It ships a GitHub Action, SARIF output for GitHub code scanning, a baseline file to track only new findings, and a pre-commit hook. The README has the details.

Tell us what it gets wrong

This is the first public release and we would love to hear what you think. False alarms, misses, rules that should exist, environment formats it should read: open an issue or email hello@aginno.dev.

If envscan flags something in your environment and you want a person to confirm it, we will audit one environment for free and send you the exact input that beats the grader, plus a fix.