Thomas Joshi tested whether coding agents would follow rules while auditing Python projects for a cryptography migration. He used GEPA, an optimizer in the DSPy framework he co-authored, to turn lessons from failed training runs into checks that could block tool calls. His test measured what the agent actually installed or wrote in an isolated test environment, not just what it said it did.
A guard can stop one action and miss another
The generated checks blocked all nine attempts to install a stand-in for an unvetted package. With no checks, the agent installed it in eight of nine attempts. But the generated policy contained no rule for the tested TLS downgrade, which would weaken how a connection is protected. It let that change through in eight of nine attempts. Hand-written checks stopped all nine in that case, but the people writing them knew which cases the test would cover.
Across all five attack scenarios, generated checks allowed 8 of 45 attempts, versus 10 of 44 for the same rules in the prompt. The study did not establish that the generated checks were better overall. Test runs reused projects and varied the model’s random seed, so they were not independent. Ordinary work suffered too: with generated checks, the agent finished five of nine clean audits, down from seven of nine without checks.
Check the result as well as the tool call
Keep audit agents read-only by default. Enforce package permissions outside the model. If an audit can propose a policy file, have a separate validator check the final file against rules your team owns before anyone applies it. Keep those rules in review even if a model helps write new checks. Test cases the optimizer never saw, and run ordinary audits too. Score the actions blocked, the work completed and any real findings missed.
Caveat: This was a controlled test with one model, three repositories and synthetic attacks. It documents no production compromise.