← Lab /AI/ML

CodeTracer can pinpoint backdoor fine-tuning data causing unsafe completions

CodeTracer can accurately attribute malicious code completions to the specific backdoor fine-tuning samples that introduced them

AI/ML arXiv 9 Jul 2026 Method Prototype evidence Threat model

Published as “Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions”

Why it matters

Service providers can pinpoint and remove poisoned training samples after deployment without needing gradients, improving the security of code completion services.

Summary

CodeTracer can attribute malicious code completions to the specific poisoned fine-tuning examples that caused them, achieving very low false-positive (0.00% on 80,000 clean examples) and false-negative rates (below 3%) across ten backdoor attacks and three vulnerability cases. The evidence comes from experiments on a 1.08 M-file GitHub Python corpus fine-tuned on 80 k clean plus a few hundred poisoned samples, compared against sixteen baselines, showing consistently higher forensic accuracy and robustness to adaptive attacks.

What they found 1

  1. Very low false-positive rate on clean data

    “CodeTracer misclassifies 40 out of 80,000 clean examples, yielding an FPR of 0.00 (40/80,000).”

Caveats 1

  • A promising direction for future work is to extend CodeTracer to agentic LLMs, where tracing the origins of unsafe behaviors presents even greater challenges.

What’s new here 4

  • Provides gradient-free forensic attribution for code completion models, which prior methods cannot handle due to lack of stored gradients.
  • Introduces a structured behavioral fingerprint extracted by an external LLM to capture unsafe logic independent of surface syntax.
  • Uses code-to-code retrieval with snippet-level embeddings to narrow the search space among millions of fine-tuning examples.
  • Applies LLM-based semantic reasoning to decide if candidate snippets implement the same unsafe behavior.

Threat model stated by the source

AdversaryAttacker who injects subtle backdoor triggers into public repositories and boosts their visibility
CapabilityCan poison the fine-tuning dataset and knows the dataset and fine-tuning algorithm; cannot modify the pre-trained model or access gradients
AssumesPre-trained model is clean; User reports of malicious completions are honest