AI Can Write Factory Code That Secretly Uses Wrong Software
One in five AI-written scripts for factory machines uses the wrong software—could cause accidents.
Language models can generate Python that drives industrial protocols on programmable logic controllers, but existing code-grounding checks ask whether an imported package or symbol exists—not whether it suits the declared industrial target. The authors build Proteus-OT, a label-free static verifier over a version-pinned graph of documented bindings.
Across 883 generated scripts, 180 carry an import-level mismatch against the declared target (20.4%); single-vendor targets give 16.3%, and requiring the offending library to reach a protocol communication call gives 14.2%. None of 28 adjudicable human control files carries one, a sample too small to estimate prevalence.
Within the balanced subset, 96.6% of mismatching scripts import packages and call methods that exist, so an existence baseline does not represent them, and every positive ships with an inspectable witness. The authors conclude vendor–protocol consistency is a useful static audit target, whereas provenance classification on repository-labelled corpora is not authorship detection.
- About 20% of AI-written scripts for factory machines use the wrong software package for the declared brand.
- Current checks only verify if a package exists, not if it's correct for the machine.
- Human-written control files didn't show this mismatch, but the sample was small.
Why It Matters
Factories using AI to write control code could face safety risks and costly errors without proper checks.