AI
New system makes AI code generation auditable by tracking which AI writes each part
Researchers introduce AuditCoder, a multi-agent approach that generates code while maintaining a complete record of which AI agent wrote each piece and why.
A new research system addresses a growing gap in AI-assisted programming: when large language models generate code from high-level plans, it's often impossible to trace which parts of the final code came from which planning steps. This gap creates headaches during code reviews and maintenance.
Researchers have proposed AuditCoder, a multi-agent framework that tackles the problem head-on by maintaining detailed ownership records as code gets written and assembled. Rather than treating code generation as a black box, the system assigns stable identifiers to each task before implementation begins, creating an audit trail that connects every piece of generated code back to its original planning commitment.
How the approach works#
The core innovation is a contract-annotated task graph — essentially a plan where each step is tagged with a unique ID before the actual coding starts. As AI agents build the program, these same IDs track which code implements each subproblem. The system records not just the final code, but also versioned test results and a full repair history, allowing human reviewers to inspect exactly what happened at each stage.
When the system encounters a failure, it takes a measured approach: it only repairs code in a bounded scope supported by failure evidence, marks any expansion to that scope, and leaves unchanged code outside the repair zone. If no clear boundary is supported by evidence, the system abstains rather than making a risky edit.
Performance and validation#
Testing on a 200-task subset of the APPS programming benchmark and the ClassEval dataset, AuditCoder stayed competitive with existing code generation systems across two different AI models, all within a single-round feedback constraint. A DeepSeek-based version also held its own on 22 exploratory cross-domain tasks.
An audit of the DeepSeek run on APPS revealed strong record-keeping: 97.25% of final code blocks retained all required metadata — code content, contract specification, provenance information, and test results. All 44 repair attempts adhered to the recorded accept/rollback policy, with 30 passing held-out tests. Repair operations averaged 22% of the graph's nodes, suggesting focused, targeted fixes.
Why it matters#
The approach addresses a real friction point in software development: as AI code generation becomes more common, the ability to audit decisions and understand responsibility chains becomes critical. By making the generation process transparent and auditable, AuditCoder could help teams integrate AI-written code more confidently into production systems.

