Killing Coding Agent Slop Using Adversarial Self-Play Techniques
Telos introduces a method to eliminate low-quality code generated by autonomous agents through adversarial self-play. This approach forces agents to stress-test their own code against opposing agent models.
Impact: Medium
Why it matters
You can integrate adversarial testing cycles into your agentic CI/CD pipelines to catch bad logic before production.
TL;DR
- 01Traditional unit tests are insufficient for complex agentic logic; adversarial models are required to stress-test generated code.
- 02Setting up iterative generator-adversary loops yields tighter, cleaner, and less bloated code.
Eliminating Agent Slop in Production
Adversarial self-play addresses the ongoing challenge of bloated and unreliable code produced by LLM agents. Rather than relying entirely on static analysis or manual reviews, developers deploy an agentic framework where a secondary "adversary" agent actively attempts to find edge cases, security exploits, or performance bottlenecks in the primary agent's output.
Structural Multi-Agent Feedback Loops
- Generation: The coder agent writes a solution based on user prompts.
- Attack: The adversarial agent targets the proposed solution with dynamic, negative unit testing.
- Refinement: The coder agent refactors its output iteratively until all adversarial checks pass successfully.
✓ When to use
- Building automated code generation pipelines in agentic IDEs.
- Setting up autonomous refactoring loops for legacy codebases.
✕ When NOT to use
- Simple script writing where deterministic linter checks and unit tests are sufficient.
What to do today
- Implement a secondary LLM pipeline in your CI that writes negative test scenarios against agent-generated pull requests.
Sources