From Exploit Generation to Defensive Security While Laying the Foundation for Future Multi-Agent Development
Introduction
Security research often balances a fine line between offensive and defensive applications. When techniques for finding vulnerabilities—such as the A1 exploit generation system—are published, the challenge becomes how to adapt these powerful methodologies for educational and defensive purposes.
This post examines the transformation of an AI-driven exploit generation framework into a comprehensive security analysis tool, alongside experimentation with multi-agent development workflows using git worktrees and Claude Code.
The source code for this project is available on GitHub.
The Worktree Setup
Instead of switching branches repeatedly, multiple git worktrees were set up to explore different development approaches simultaneously. Using Claude Code for planning and specification generation, four parallel tracks emerged: enhanced-mocks for realistic implementations, defensive-analysis for security tooling, educational-features for logging and tracing, and paper-comparison for methodology alignment.
This setup enabled distinct AI agents to work on separate system aspects without conflicts. Initially, these tracks were addressed sequentially to validate the approach.
Key Technical Achievement
A core breakthrough involved successfully inverting the A1 methodology from offensive to defensive purposes. Rather than generating exploits for profit, the approach created a comprehensive vulnerability assessment system that identifies security weaknesses and provides mitigation guidance.
The DefensiveAnalysisTool embodies this transformation—analyzing the same contracts targeted by A1 but producing structured security recommendations instead of attack vectors. This system preserves A1’s multi-tool coordination strategy while serving educational and protective objectives.
The Enhancement Journey
Beginning with basic mock implementations returning minimal placeholder data, each tool was systematically enhanced to deliver realistic, educational value. The SourceCodeFetcher evolved from returning simple comments to generating complete smart contracts embedded with actual vulnerability patterns. The ConstructorParameterTool advanced to provide thorough deployment analysis accompanied by security assessments.
This enhancement facilitated multi-source data integration, combining source code analysis, blockchain state data, and deployment information for comprehensive security evaluation. The DefensiveAnalysisTool illustrates this in practice by analyzing VulnerableDeFiPool, identifying a CRITICAL risk with 8 vulnerabilities including reentrancy issues, and offering specific recommendations for checks-effects-interactions patterns. Proxy contracts receive HIGH risk flags for access control concerns with timelock recommendations, while even low-risk tokens obtain appropriate mitigation guidance.
Future Work
This initial exploration opens several promising research directions. The immediate next step involves fully utilizing the parallel worktree setup, allowing different AI agents to simultaneously develop enhanced tools, testing infrastructure, and core iteration logic improvements.
From a technical standpoint, replacing the MockLLM with genuine intelligent decision-making capabilities would enable true iterative, LLM-guided security analysis. Expanding vulnerability detection patterns and exploring applications of this defensive framework in other security research methodologies also present valuable opportunities.
Longer-term, this work has potential to contribute to automated security analysis tools for smart contract development, educational resources for blockchain security, and frameworks for ethically adapting offensive security research.
Conclusion
This exploration demonstrates that offensive security research can be meaningfully transformed for defensive and educational purposes. By systematically enhancing mock implementations and inverting the A1 methodology, a comprehensive vulnerability assessment system was created that preserves the original’s technical sophistication while serving protective goals.
The multi-agent development approach with git worktrees shows promise for accelerating complex software projects, even when applied sequentially in initial stages. Most importantly, this work illustrates how the security research community can adapt powerful AI-driven techniques for education and defense, fostering a more secure blockchain ecosystem.