Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions

· Source: cs.AI updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Cybersecurity & Data Privacy, Software Development & Engineering · Depth: Expert, extended

Summary

CodeTracer is a novel forensic framework designed to attribute malicious code completions generated by large language models (LLMs) back to the specific backdoored fine-tuning data responsible for them. Operating under realistic post-deployment constraints, CodeTracer does not require gradients or attacker-specific information. It extracts a structured behavioral fingerprint from compromised outputs, narrows the search to semantically relevant code samples using a pre-trained code encoder like UniXcoder, and employs an external LLM (e.g., GPT-4.1) for fine-grained attribution. Evaluated across three vulnerability cases and ten backdoor attacks, CodeTracer consistently achieved low false negative rates (below 0.03), high detection accuracy, and strong robustness against adaptive attacks, completing analysis within 47.10 seconds at a cost of \$0.33 per malicious completion.

Key takeaway

For AI Security Engineers or ML Engineers deploying code completion models, CodeTracer offers a critical post-attack forensic capability. If your model produces a malicious completion, you can use this framework to identify and remove the specific poisoned training examples, significantly reducing the attack success rate to 0.03 or lower. This enables effective diagnosis and auditing of fine-tuning pipelines without full retraining.

Key insights

CodeTracer forensically traces backdoored code completions to their poisoned training data without gradients.

Principles

Method

CodeTracer extracts a structured fingerprint, narrows the search space using code-to-code retrieval and snippet-level cosine similarity, then uses an external LLM for fine-grained attribution analysis.

In practice

Topics

Best for: Research Scientist, CTO, VP of Engineering/Data, AI Scientist, AI Security Engineer, Machine Learning Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.AI updates on arXiv.org.