The Deska blog
Adversarial Verification: Agents Refuting Agents
Improve LLM reliability through adversarial verification. Learn how having agents refute agents on an infinite canvas leads to higher orchestration quality.
· 10 min read
The reliability of autonomous software development hinges on a process known as adversarial verification. As large language models (LLMs) take on more complex tasks, the risk of hallucinations and logic errors increases. Relying on a single agent to both write and validate its own code is a recipe for failure. Instead, developers are turning to architectures where one agent proposes a solution and a second, independent agent attempts to refute it. This structured disagreement ensures that only the most robust logic survives the development cycle.
The Problem with Self-Correction
Most current AI coding tools rely on a loop where the same model generates code and then attempts to fix its own errors. This approach often fails because the model is biased toward its initial logic. If a model misunderstands a library requirement or a security constraint, it is likely to maintain that misunderstanding during the debugging phase.
Adversarial verification breaks this cycle by introducing a critic. In this framework, the Proposer creates a pull request or a script, while the Verifier acts as a hostile code reviewer. The Verifier is specifically prompted to find edge cases, security vulnerabilities, or architectural flaws. This creates a competitive environment where the quality of the output is forced to improve through iterative refutation.
Architectures for Adversarial Verification
Implementing adversarial verification requires a workspace that can handle multiple simultaneous agentic processes. You cannot effectively run this workflow in a single chat window or a linear terminal. The environment must support concurrency and visibility across different modules of the codebase.
The Proposer-Verifier Loop
In a standard proposer-verifier setup, the workflow follows a specific sequence. First, the Proposer analyzes the task and generates the implementation. Second, the Verifier receives the code and a set of constraints. The Verifier does not try to "help" the Proposer; its only goal is to prove the Proposer wrong. If the Verifier finds a flaw, it sends a detailed report back. The Proposer then must defend its choice or provide a fix.
Multi-Agent Consensus
Some advanced teams use a "Council of Agents" approach. This involves three or more agents with different underlying models. For example, a GPT-based agent might propose the code, a Claude-based agent might audit the security, and a third agent might check for performance regressions. This diversity in model training helps catch errors that a single family of models might overlook.
Orchestration Quality on an Infinite Canvas
For a developer to manage these adversarial interactions, they need a workspace that provides a bird's eye view of the entire process. Traditional IDEs often hide agent activity in background logs or nested tabs. This lack of transparency makes it difficult to step in when the verification loop gets stuck or goes in the wrong direction.
Deska offers a unique environment for this through its infinite canvas. Instead of switching between files, you can place panels for different agents side by side. You can have a panel running Claude Code as the Proposer and another panel running Codex CLI as the Verifier. Because you can zoom out to see everything, the flow of information between agents becomes visual and manageable.
Monitoring Local-First Agents
When running these high-intensity loops, data privacy and latency become critical concerns. A local-first approach ensures that the code being passed between the Proposer and the Verifier never leaves your machine unless you are using a managed inference provider. Deska stores all sessions and files locally, meaning your proprietary logic stays on your hardware while the agents work through their adversarial cycles.
Practical Implementation Steps
To set up an adversarial verification workflow, you should follow these technical guidelines:
- Define specific personas. The Verifier should have a system prompt that encourages skepticism and strict adherence to documentation.
- Use distinct models. If the Proposer is optimized for speed, the Verifier should be optimized for reasoning.
- Establish a stop condition. The loop should terminate after a set number of iterations or once the Verifier issues a "no flaws found" signal.
- Maintain a shared context. Both agents must have access to the same file system and terminal output to ensure they are arguing over the same reality.
Within Deska, you can use terminals to run test suites that the Verifier triggers. If the tests fail, the output is immediately visible to the Proposer in an adjacent panel. This eliminates the context switching that usually plagues multi-agent development.
Comparison of Verification Approaches
Different tools handle agentic verification in various ways. It is important to choose the method that fits your specific project needs.
| Approach | Strength | Weakness |
|---|---|---|
| Self-Correction | Low latency and low cost. | High risk of persistent hallucinations. |
| Rule-based Linting | Consistent and predictable results. | Cannot catch logical or architectural errors. |
| Adversarial Verification | High accuracy and catches complex bugs. | Requires more tokens and orchestration effort. |
| Human-in-the-loop | Highest reliability for critical systems. | Slows down the automated pipeline significantly. |
Tools like AutoGPT or specialized IDE extensions differ in approach. Some focus on fully autonomous loops, while others require constant human approval. Deska strikes a balance by allowing coding agents to run autonomously in panels while providing the developer with Ask Deska, a voice and chat assistant that can jump into any panel to provide manual guidance or reconfigure the workspace.
Remote Monitoring of Verification Loops
Adversarial verification can be computationally expensive and time-consuming. Sometimes a complex refutation cycle might take fifteen minutes to resolve. Developers do not want to be tethered to their desks during these periods.
The Deska mobile app allows you to monitor these local sessions through a secure relay. Since the mobile device pairs directly with your desktop, you can check the progress of the Verifier while away from your computer. If you see that the Proposer and Verifier are in an infinite loop of disagreement, you can pause the session or send a command to break the deadlock.
FAQ
How to prevent agents from agreeing on wrong code?
To prevent collusion or shared hallucinations, you must ensure the Verifier has a different system prompt and, ideally, a different underlying model. You should also provide the Verifier with external sources of truth, such as official documentation or a set of pre-written unit tests that it must execute.
Is adversarial verification too expensive for small projects?
While it uses more tokens, the cost is often offset by the reduction in time spent on manual debugging. For small projects, you can limit the verification to the most critical functions rather than the entire codebase. Using the BYOK model in Deska allows you to manage these costs directly through your own API providers.
Can agents run shell commands during verification?
Yes, in a robust verification environment, agents must be able to run compilers, linters, and test runners. In Deska, agents operate within panels that have access to the local shell. This allows the Verifier to actually run the code to prove it fails rather than just guessing based on the text.
Enhance Your Workflow with Deska
Adversarial verification is the next step in the evolution of AI-assisted development. By moving away from single-agent systems toward a model of refutation and critique, you can produce higher quality code with fewer manual interventions.
Deska provides the necessary infrastructure to manage these complex agent threads without losing track of the bigger picture. With its infinite canvas, local-first architecture, and support for multiple side-by-side agents, it is built for the era of sophisticated AI orchestration. You can start building your own multi-agent verification environment today.
Download Deska for Mac, Windows, or Linux and take control of your agentic workflows.