Real Package, Wrong Controller: Static Auditing of Vendor--Protocol Mismatches in LLM-Generated PLC Code

arXiv:2611.33227 · cs.CR, cs.LG, cs.SE, cs.SY, eess.SY · Submitted 2026-11-24 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Security Radio. Generated commentary on the latest security and cryptography papers.

Nadia: I'm Nadia.

Elias: And I'm Elias, here with Priya.

Nadia: We're looking at the paper: "Real Package, Wrong Controller".

Paper summary: Nadia: So this paper "Real Package Wrong Controller: Static Auditing of Vendor--Protocol Mismatches in LLM-Generated PLC Code" is basically about using static analysis to check if code written by an AI for industrial stuff actually matches what the user intended it to talk to on the controller side.

Elias: It focuses on defining a specific way—a metadata conditioned import level vendor protocol incompatibility—to check this suitability without needing any labels or training data for the checker itself.

Priya: So, instead of just looking at whether a library exists, they are checking if that imported library is actually documented to support the specific industrial protocol the code is supposed to use.

Nadia: Exactly. They built a tool called PROTEUS OT that does this check from just the source text and a version pinned graph of bindings <ref:2611.33227#pg1>.

Elias: The results showed that this method finds mismatches in about fourteen point two percent of machine generated scripts when the target is clear and the library actually makes a communication call <ref:2611.33227#pg4>.

Priya: That fourteen point two percent number is specific, but it comes with caveats because they also found that this mismatch rate can go up to thirty seven point nine percent if the AI prompt gives it too much context, which is important for how we use these systems in practice <ref:2611.33227#pg5>.

Nadia: It sounds like a tool that helps us test the feasibility of using AI generated code for real PLC logic by focusing on whether the code is functionally correct for its intended target.

Elias: That’s what it really does—it establishes a feasibility claim about static verification without claiming any safety or maliciousness because it’s just checking documented bindings against metadata <ref:2611.33227#pg6>.

Priya: So, the big picture here is that we need these kinds of static checks to move past the idea that AI can just write anything and trust it blindly for industrial control systems.

Nadia: Right. It moves us toward a world where we can statically verify the actual protocol compatibility before we even run the code on a test bench.

Elias: Next time, we'll look at what those specific library target pairings were that caused the biggest issues in their audit of generated code.

Conclusion: Nadia: So we're wrapping up this look at "Real Package Wrong Controller: Static Auditing of Vendor Protocol Mismatches in LLM-Generated PLC Code." This whole paper is about proving you can build a static checker, PROTEUS OT, that catches when the AI generates code that doesn't actually match the industrial controller protocol it’s supposed to talk to.

Elias: Yeah, the authors are showing how they defined this specific incompatibility rule—the metadata conditioned import level vendor protocol mismatch—and built a verifier based on a version pinned graph of bindings without any training or labels <ref:2611.33227#pg1>. It’s about using structure to check documentation, not just looking at what the code does at runtime.

Priya: What this means for us is that we can have a cheap, fast static check on generated code to see if it's functionally sound for a specific target without needing massive runtime analysis <ref:2611.33227#pg3>. But remember the caveat they mentioned about how the data was gathered; they found that eighty-seven point eight percent of those positive matches actually reach a communication symbol <ref:2611.33227#pg4>.

Nadia: That means we need to be careful with our context and metadata because if you give the AI too much information, you can increase that mismatch rate up to thirty seven point nine percent <ref:2611.33227#pg5>. It’s a trade-off between detail and accuracy in the audit.

Elias: So, the paper makes four main contributions to fill that gap in tooling—the absence of static analysis that reasons about vendor protocol suitability <ref:2611.33227#pg1>. They're showing how you can build this specific kind of audit using just source text and a binding table <ref:2611.33227#pg6>.

Priya: And the authors were careful not to claim safety or maliciousness, saying deployment statements are feasibility claims because they aren't testing for actual exploits <ref:2611.33227#pg6>. They’re showing a method to verify documentation compatibility, not a final security product.

Nadia: Exactly. It’s establishing the technical possibility of this static verification tool, which is crucial because we need tools that work on the generated code itself, before we even get to testing it in a real plant environment <ref:2611.33227#pg4>.

Elias: Next time, we'll look at those specific library and target pairings they found that caused the biggest issues in their audit of generated code <ref:2611.33227#pg4>.

S M Zia Ur Rashid, Sazidul Islam Hira, Suman Rath

Department of Electrical and Computer Engineering, The University of Tulsa · Department of Computer Science and Engineering, International Islamic University Chittagong

cs.CR, cs.LG, cs.SE, cs.SY, eess.SY

Submitted: 2026-11-24

Updated: 2026-11-24

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 92/100

The gist: Language models can generate Python that drives industrial protocols on programmable logic controllers…

Key concepts

Metadata-Conditioned Incompatibility
This is a specific check that determines if an imported library, defined by its metadata, is incompatible with the declared industrial protocol. It relies on checking documented bindings and metadata rather than just looking for the package's presence in a system.
PROTEUS-OT
A static and label-free auditor built to check for vendor–protocol mismatches in operational technology scripts. It uses a version-pinned graph of documented bindings to decide if an imported library supports the target protocol, making it cheap to run without needing labels or training.
Vendor–Protocol Suitability
The core problem addressed is reasoning about whether a specific vendor's library (like snap7) is suitable for a declared industrial target protocol. Existing tools fail at this level of suitability analysis, which PROTEUS-OT aims to solve by analyzing the script's structure and metadata.
Import-Level Mismatch
This refers to a specific type of error found in machine-generated code where an imported library is not documented as supporting the target protocol. The study found this mismatch occurs in 20.4% of tested scripts, indicating a flaw in how LLMs select or use libraries.

Terminology

Summary

Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target. p. 0

Where the paper says it

mail@gmail. com Abstract—Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target.

<ref:2611.33227#pg1, "Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target">. p. 0
Where the paper says it

mail@gmail. com Abstract—Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target.

The paper defines metadata-conditioned, import-level vendor–protocol incompatibility and builds PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings. p. 0
Where the paper says it

com Abstract—Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target. We define metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings.

<ref:2611.33227#pg1, "We define metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings">. p. 0
Where the paper says it

com Abstract—Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target. We define metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings.

Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. p. 0
Where the paper says it

We define metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings. Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20.

4%); restricting to single-vendor targets gives 16. p. 0
Where the paper says it

Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. 4%); restricting to single-vendor targets gives 16.

p. 0
Where the paper says it

Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. 4%); restricting to single-vendor targets gives 16.

3%, and additionally requiring the offending library to reach a protocol communication call gives 14. p. 0
Where the paper says it

4%); restricting to single-vendor targets gives 16. 3%, and additionally requiring the offending library to reach a protocol communication call gives 14.

p. 0
Where the paper says it

4%); restricting to single-vendor targets gives 16. 3%, and additionally requiring the offending library to reach a protocol communication call gives 14.

2%.<ref:2611.33227#pg4, "Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. p. 0
Where the paper says it

We define metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT, a labelfree static verifier over a version-pinned graph of documented bindings. Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20.

4%); restricting to single-vendor targets gives 16.3%, and additionally requiring the offending library to reach a protocol communication call gives 14.2%">. The work addresses the gap in existing tooling by reasoning about vendor–protocol suitability rather than style or package existence. p. 0
Where the paper says it

Existence checkers confirm the package and the symbol, then stop. The gap we address is the absence, across the venues we surveyed, of any static, pre-execution analysis that reasons about the vendor–protocol suitability of the attack script itself rather than about style, package existence, or run-time network behaviour.

<ref:2611.33227#pg1, "The gap we address is the absence, across the venues we surveyed, of any static, pre-execution analysis that reasons about the vendor–protocol suitability of the attack script itself rather than about style, package existence, or run-time network behaviour">. p. 0
Where the paper says it

Existence checkers confirm the package and the symbol, then stop. The gap we address is the absence, across the venues we surveyed, of any static, pre-execution analysis that reasons about the vendor–protocol suitability of the attack script itself rather than about style, package existence, or run-time network behaviour.

The paper makes four contributions. p. 0
Where the paper says it

More fundamentally, provenance classification proves degenerate on corpora of this construction, and we report the corrected, non-significant gap together with the artifact analysis that explains it, since an improvement over a defective baseline is not a contribution. This paper makes four contributions.

<ref:2611.33227#pg1, "This paper makes four contributions">

Pruning redundant reasoning tokens

The primary contribution is the definition of a metadata-conditioned, import-level vendor–protocol mismatch predicate over a version-pinned binding graph, which is decidable from source with no labels or trained model.<ref:2611.33227#pg1, "We define a metadata-conditioned, import-level vendor–protocol incompatibility and build PROTEUS-OT around it, a static and label-free auditor for operational–technology scripts that pairs a typed graph of public bindings carrying per–edge sources with a verifier emitting a twelve–component readable vector, where every positive carries an inspectable witness">. p. 0

Where the paper says it

The gap we address is the absence, across the venues we surveyed, of any static, pre-execution analysis that reasons about the vendor–protocol suitability of the attack script itself rather than about style, package existence, or run-time network behaviour. We formalise this problem as a metadata-conditioned, import-level incompatibility and build PROTEUS-OT around it, a static and label-free auditor for operational-technology scripts that pairs a typed graph of public bindings carrying per-edge sources with a verifier emitting a twelve-component readable vector, where every positive carries an inspectable witness.

The predicate establishes only that under the encoded bindings and the declared metadata, the imported library is not documented as supporting the target. p. 1
Where the paper says it

RQ1 is our contribution, and RQ2 is reported as a case study in why such corpora do not support the claim. When the predicate fires, it establishes only that, under the encoded bindings and the declared metadata, the imported library is not documented as supporting the target.

<ref:2611.33227#pg3>. This decision process is cheap to decide because it concerns a syntactic metadata-conditioned predicate rather than protocol compatibility or runtime reachability. p. 2
Where the paper says it

The predicate is cheap to decide. With a finite AST, recognised import set and binding graph and fixed target and context metadata, gxv is decidable in time linear in AST size plus imported OT libraries, a bounded lookup per import, and concerns a syntactic metadata-conditioned predicate rather than protocol compatibility, runtime reachability or exploitability.

<ref:2611.33227#pg3, "The predicate is cheap to decide. p. 2
Where the paper says it

The witness set and the three-valued predicate follow, with L(s) the OT libraries a script imports, M(s, v) = {ℓ ∈ L(s) : ¬ Valid(ℓ, v, θ)} (3) gxv(s) =    1, v(s) ̸= ⊥ ∧ M(s, v(s)) ̸= ∅ 0, v(s) ̸= ⊥ ∧ M(s, v(s)) = ∅ ∅, v(s) = ⊥ (4) The undefined case fixes the denominator, so rates are taken over {s : v(s) ̸= ⊥}, 883 of 883 machine scripts but only 28 of 190 human ones. The predicate is cheap to decide.

With a finite AST, recognised import set and binding graph and fixed target and context metadata, gxv is decidable in time linear in AST size plus imported OT libraries, a bounded lookup per import">

How the training signal is built

The audit involves examining 883 machine-generated scripts against a human class of 28 adjudicable files.<ref:2611.33227#pg4>. The results show that the mismatch is concentrated in specific library–target pairings, such as snap7 aimed at Schneider. p. 3

Where the paper says it

7], our primary metadata-conditioned estimate, with the inclusive rate as an upper bound. 1 shows the mismatch concentrated in a few library–target pairings, led by snap7 aimed at Schneider (73 scripts) and pycomm3 aimed at Siemens (45), with snap7 at Rockwell (43) and pycomm3 at Schneider (19) following.

<ref:2611.33227#pg4, "Fig. p. 3
Where the paper says it

We also delete the m most heavily weighted features and refit, and report the discrimination each surface statistic ϕ achieves alone as AUC(ϕ), where values near 0 and near 1 are equally separating. Audit Rates and Witness Depth Table III and Fig.

p. 3
Where the paper says it

We also delete the m most heavily weighted features and refit, and report the discrimination each surface statistic ϕ achieves alone as AUC(ϕ), where values near 0 and near 1 are equally separating. Audit Rates and Witness Depth Table III and Fig.

1 shows the mismatch concentrated in a few library–target pairings, led by snap7 aimed at Schneider (73 scripts) and pycomm3 aimed at Siemens (45), with snap7 at Rockwell (43) and pycomm3 at Schneider (19) following">. p. 3
Where the paper says it

7], our primary metadata-conditioned estimate, with the inclusive rate as an upper bound. 1 shows the mismatch concentrated in a few library–target pairings, led by snap7 aimed at Schneider (73 scripts) and pycomm3 aimed at Siemens (45), with snap7 at Rockwell (43) and pycomm3 at Schneider (19) following.

Witness depth analysis indicates that 87. p. 2
Where the paper says it

155 (machine/human) to 0. Witness Depth Imports are not functional dependencies, so each positive is classified by how deeply the script uses the offending library.

8% of positive matches reach a communication symbol. p. 3
Where the paper says it

2], every positive deriving from path-supplied metadata; 44 flagged scripts name more than one vendor, so their target is ambiguous and excluding them gives 16. 0]; and requiring in addition that the offending library reach a protocol communication call gives 14.

<ref:2611.33227#pg4, "At 98% live dependencies, this addresses the objection that an import witness need not be functional">

Where the gains come from

The paper shows that machine-versus-human provenance classification separates classes by construction rather than authorship.<ref:2611.33227#pg5>. This separation is achieved because the human class is skewed, since 142 of its 190 files (75%) are library source and tests rather than standalone attack code. p. 3

Where the paper says it

The human class is itself skewed, since 142 of its 190 files (75%) are library source and tests rather than standalone attack code, so the 28 adjudicable files over-represent code that imports its own vendor’s library by construction, and the zero count should be read as the absence of a matched control rather than as demonstrated human care. Because the declared target comes from file naming, we recovered it independently from the code text and compared the two channels on the 318 scripts both can adjudicate.

<ref:2611.33227#pg4, "The human class is itself skewed, since 142 of its 190 files (75%) are library source and tests rather than standalone attack code">. p. 3
Where the paper says it

evidence that the mismatch is specific to generated code. The human class is itself skewed, since 142 of its 190 files (75%) are library source and tests rather than standalone attack code, so the 28 adjudicable files over-represent code that imports its own vendor’s library by construction, and the zero count should be read as the absence of a matched control rather than as demonstrated human care.

The authors conclude that the provenance classification accuracy reflects corpus construction and calls for an artifact audit demonstrated here. p. 5
Where the paper says it

4% under the inclusive definition, and in none of the 28 adjudicable human controls, with each positive carrying an inspectable witness. On the same corpus, provenance classification separates machine from human code almost perfectly but by construction rather than by authorship, with a trailing byte alone sufficing, so accuracies reported for generated-code detection on repository-labelled corpora reflect corpus construction and call for the artifact audit demonstrated here.

<ref:2611.33227#pg6, "The third does not survive, because the provenance classifier’s accuracy, and the improvement attributed to grounding, cannot be read as authorship detection">

Diagnostic separation

The diagnostic analysis reveals that tokens separating classes describe genre rather than authorship.<ref:2611.33227#pg5, "The tokens that separate the classes describe genre rather than authorship">. p. 4

Where the paper says it

042 claim and make no aggregate-accuracy claim in its place. Diagnosing Separability The tokens that separate the classes describe genre rather than authorship, with human-class self (0.

p. 4
Where the paper says it

042 claim and make no aggregate-accuracy claim in its place. Diagnosing Separability The tokens that separate the classes describe genre rather than authorship, with human-class self (0.

p. 4
Where the paper says it

042 claim and make no aggregate-accuracy claim in its place. Diagnosing Separability The tokens that separate the classes describe genre rather than authorship, with human-class self (0.

Specifically, signatures of a test suite against a standalone script are found in features like pytest and print. p. 4
Where the paper says it

4) and ip address (85. These are the signatures of a test suite against a standalone script, which is what the corpus contains.

<ref:2611.33227#pg5, "These are the signatures of a test suite against a standalone script, which is what the corpus contains">. p. 4
Where the paper says it

4) and ip address (85. These are the signatures of a test suite against a standalone script, which is what the corpus contains.

Furthermore, the trailing newline present in 95. p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

2% of human files and none of the generated ones separates the classes on its own. p. 0
Where the paper says it

The trailing newline present in 95. 2% of human files and in none of the generated ones separates the classes on its own.

<ref:2611.33227#pg5, "The trailing newline present in 95. p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

2% of human files and in none of the generated ones separates the classes on its own">

Conclusion

PROTEUS-OT decides metadata-conditioned, import-level vendor–protocol incompatibility from source text and a documented binding table without labels or a trained model.<ref:2611.33227#pg6, "PROTEUS–OT decides metadata–conditioned, import-level vendor–protocol incompatibility from source text and a documented binding table, without labels or a trained model">. p. 5

Where the paper says it

We judge publication net-positive and release the graph, evidence table, worksheet, splits, environment and pipeline, but no executable attack scripts or live-controller tooling. CONCLUSION PROTEUS-OT decides metadata-conditioned, import-level vendor–protocol incompatibility from source text and a documented binding table, without labels or a trained model.

The mismatch appears in 14. p. 5
Where the paper says it

CONCLUSION PROTEUS-OT decides metadata-conditioned, import-level vendor–protocol incompatibility from source text and a documented binding table, without labels or a trained model. The mismatch appears in 14.

2% of machine-generated scripts in this corpus when the target is unambiguous and the offending library reaches a communication call. p. 5
Where the paper says it

The mismatch appears in 14. 2% of machine-generated scripts in this corpus when the target is unambiguous and the offending library reaches a communication call, rising to 20.

<ref:2611.33227#pg6, "The mismatch appears in 14. p. 5
Where the paper says it

CONCLUSION PROTEUS-OT decides metadata-conditioned, import-level vendor–protocol incompatibility from source text and a documented binding table, without labels or a trained model. The mismatch appears in 14.

2% of machine–generated scripts in this corpus when the target is unambiguous and the offending library reaches a communication call">. p. 5
Where the paper says it

The mismatch appears in 14. 2% of machine-generated scripts in this corpus when the target is unambiguous and the offending library reaches a communication call, rising to 20.

The work establishes neither safety nor maliciousness, so deployment statements are feasibility claims. p. 5
Where the paper says it

The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper. It establishes neither safety nor maliciousness, so deployment statements are feasibility claims, and the earlier operating-cost argument for interpretability remains a hypothesis until review cost is measured with analysts.

<ref:2611.33227#pg6, "It establishes neither safety nor maliciousness, so deployment statements are feasibility claims">

References

The paper references numerous works concerning LLM-generated code and security machine learning.<ref:2611.33227#pg5, Models produce phishing material, scanners and simple exploits under mild prompting [6], and later systems automate larger stretches of the intrusion lifecycle [7], [8]>. The work builds on recurring pitfalls in security machine learning concerning malware results that do not survive realistic partitions. p. 1

Where the paper says it

Our second result connects to work on evaluation hygiene. It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19], duplication inflating measured accuracy on code beyond what exact-hash deduplication removes [20], and leakage as a cause of irreproducibility [21].

p. 1
Where the paper says it

Our second result connects to work on evaluation hygiene. It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19], duplication inflating measured accuracy on code beyond what exact-hash deduplication removes [20], and leakage as a cause of irreproducibility [21].

<ref:2611.33227#pg5, It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19]>. The paper also references studies investigating code hallucinations by LLMs. p. 5
Where the paper says it

Tian et al. , “CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verification,” arXiv:2405.

p. 5
Where the paper says it

Tian et al. , “CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verification,” arXiv:2405.

<ref:2611.33227#pg5, Code models hallucinate [10], [11], most relevantly by importing packages that do not exist, at rates sufficient to support supply–chain attacks on the invented names [9]>. The paper references studies investigating model reliability for legitimate PLC logic. p. 1
Where the paper says it

Our contribution swaps the grounding oracle from “does this symbol exist” to “do the documented bindings list this library as supporting the declared target”. Defensive ICS research meanwhile concentrates on network- and process-level detection at run time, with adjacent work on model reliability for legitimate PLC logic [12], which targets correctness of generated control logic rather than pre-execution auditing of an attack script.

p. 1
Where the paper says it

Our contribution swaps the grounding oracle from “does this symbol exist” to “do the documented bindings list this library as supporting the declared target”. Defensive ICS research meanwhile concentrates on network- and process-level detection at run time, with adjacent work on model reliability for legitimate PLC logic [12], which targets correctness of generated control logic rather than pre-execution auditing of an attack script.

<ref:2611.33227#pg5, Defensive ICS research meanwhile concentrates on network– and process-level detection at run time, with adjacent work on model reliability for legitimate PLC logic [12]>. The paper cites work on evaluation hygiene related to annotation artifacts. p. 1
Where the paper says it

The remainder of the paper proceeds as follows. Section II positions the work against generation, package-existence and evaluation-hygiene literature.

p. 1
Where the paper says it

The remainder of the paper proceeds as follows. Section II positions the work against generation, package-existence and evaluation-hygiene literature.

<ref:2611.33227#pg5, The closest analogue is linguistic, where annotation artifacts let hypothesis-only models beat chance on inference benchmarks [22]>. The paper references studies investigating leakage as a cause of irreproducibility. p. 1
Where the paper says it

Our second result connects to work on evaluation hygiene. It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19], duplication inflating measured accuracy on code beyond what exact-hash deduplication removes [20], and leakage as a cause of irreproducibility [21].

p. 1
Where the paper says it

Our second result connects to work on evaluation hygiene. It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19], duplication inflating measured accuracy on code beyond what exact-hash deduplication removes [20], and leakage as a cause of irreproducibility [21].

<ref:2611.33227#pg5, Leakage and the reproducibility crisis in machine learning-based science [21]>. The paper cites work on character ngrams for detection. p. 1
Where the paper says it

For generated text, reliable detection faces fundamental limits [23] and deployed detectors encode confounds [24]. Table I positions the work along OT domain, whether the method detects rather than only generates, vendor semantics, label-free operation, leakage control and an artifact audit, adding the last two columns we find missing from generated-code detection work, and its marks report what each paper states rather than what its method could in principle support.

p. 1
Where the paper says it

For generated text, reliable detection faces fundamental limits [23] and deployed detectors encode confounds [24]. Table I positions the work along OT domain, whether the method detects rather than only generates, vendor semantics, label-free operation, leakage control and an artifact audit, adding the last two columns we find missing from generated-code detection work, and its marks report what each paper states rather than what its method could in principle support.

<ref:2611.33227#pg5>. The paper references studies investigating the separation of classes by genre. p. 4
Where the paper says it

042 claim and make no aggregate-accuracy claim in its place. Diagnosing Separability The tokens that separate the classes describe genre rather than authorship, with human-class self (0.

p. 4
Where the paper says it

042 claim and make no aggregate-accuracy claim in its place. Diagnosing Separability The tokens that separate the classes describe genre rather than authorship, with human-class self (0.

<ref:2611.33227#pg5, "The tokens that separate the classes describe genre rather than authorship">. The paper references studies investigating the role of a trailing newline in classification. p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

p. 0
Where the paper says it

000 under task, model and vendordisjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.

<ref:2611.33227#pg5, "The trailing newline present in 95.2% of human files and in none of the generated ones separates the classes on its own">. p. 0
Where the paper says it

The trailing newline present in 95. 2% of human files and in none of the generated ones separates the classes on its own.

p. 0
Where the paper says it

The trailing newline present in 95. 2% of human files and in none of the generated ones separates the classes on its own.

The paper references studies concerning evaluation hygiene related to transformation failures. p. 1
Where the paper says it

The remainder of the paper proceeds as follows. Section II positions the work against generation, package-existence and evaluation-hygiene literature.

p. 1
Where the paper says it

The remainder of the paper proceeds as follows. Section II positions the work against generation, package-existence and evaluation-hygiene literature.

p. 1
Where the paper says it

The remainder of the paper proceeds as follows. Section II positions the work against generation, package-existence and evaluation-hygiene literature.

<ref:2611.33227#pg5, "Every normalisation rung retains macro–F1 1. p. 4
Where the paper says it

Table V reports the normalisation ladder with feature deletion on the left and the discrimination of single surface statistics on the right, and it shows the separation is neither cosmetic nor carried by a few tokens. Every normalisation rung retains macro-F1 1.

p. 4
Where the paper says it

Table V reports the normalisation ladder with feature deletion on the left and the discrimination of single surface statistics on the right, and it shows the separation is neither cosmetic nor carried by a few tokens. Every normalisation rung retains macro-F1 1.

p. 4
Where the paper says it

Table V reports the normalisation ladder with feature deletion on the left and the discrimination of single surface statistics on the right, and it shows the separation is neither cosmetic nor carried by a few tokens. Every normalisation rung retains macro-F1 1.

000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier">. p. 4
Where the paper says it

Every normalisation rung retains macro-F1 1. 000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier, and all 336 scripts round-trip successfully at every rung, so no result is contaminated by transform failures.

p. 4
Where the paper says it

Every normalisation rung retains macro-F1 1. 000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier, and all 336 scripts round-trip successfully at every rung, so no result is contaminated by transform failures.

p. 4
Where the paper says it

Every normalisation rung retains macro-F1 1. 000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier, and all 336 scripts round-trip successfully at every rung, so no result is contaminated by transform failures.

The paper references studies concerning graph coverage bounds on recall. p. 1
Where the paper says it

• We bound recall by graph coverage and evasion by measurement, and release the binding graph, evidence table, adjudication worksheet, splits, environment and pipeline. The remainder of the paper proceeds as follows.

p. 1
Where the paper says it

• We bound recall by graph coverage and evasion by measurement, and release the binding graph, evidence table, adjudication worksheet, splits, environment and pipeline. The remainder of the paper proceeds as follows.

p. 1
Where the paper says it

• We bound recall by graph coverage and evasion by measurement, and release the binding graph, evidence table, adjudication worksheet, splits, environment and pipeline. The remainder of the paper proceeds as follows.

<ref:2611.33227#pg5, "Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered">. p. 4
Where the paper says it

The comment decoy fails because the target is path-derived, which is both a strength against text manipulation and the source of the metadata dependence noted earlier. Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass.

p. 4
Where the paper says it

The comment decoy fails because the target is path-derived, which is both a strength against text manipulation and the source of the metadata dependence noted earlier. Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass.

p. 4
Where the paper says it

The comment decoy fails because the target is path-derived, which is both a strength against text manipulation and the source of the metadata dependence noted earlier. Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass.

The paper references studies concerning vendor identity as a necessary but not sufficient condition. p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

<ref:2611.33227#pg5, "All five vendor–lock edges carry a documented source">. p. 4
Where the paper says it

Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass. All five vendor-lock edges carry a documented source.

p. 4
Where the paper says it

Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass. All five vendor-lock edges carry a documented source.

p. 4
Where the paper says it

Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered, so a script using one of them is silently an unaudited negative (a potential false negative) rather than a verified pass. All five vendor-lock edges carry a documented source.

The paper references studies concerning the impact of supplied-context level on mismatch rate. p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

<ref:2611.33227#pg5, "Finally, the mismatch rate by supplied–context level is 14. p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

p. 4
Where the paper says it

Modbus-TCP is treated as vendor-neutral and never yields a witness, and a protocol can be vendor-neutral while a device-family, function-code or register-map assumption remains invalid, so vendor identity is a necessary but not sufficient compatibility check. Finally, the mismatch rate by supplied-context level is 14.

4% (low, n=340), 14. p. 4
Where the paper says it

Finally, the mismatch rate by supplied-context level is 14. 4% (low, n=340), 14.

p. 4
Where the paper says it

Finally, the mismatch rate by supplied-context level is 14. 4% (low, n=340), 14.

p. 4
Where the paper says it

Finally, the mismatch rate by supplied-context level is 14. 4% (low, n=340), 14.

2% (medium, n=316) and 37. p. 4
Where the paper says it

4% (low, n=340), 14. 2% (medium, n=316) and 37.

p. 4
Where the paper says it

4% (low, n=340), 14. 2% (medium, n=316) and 37.

p. 4
Where the paper says it

4% (low, n=340), 14. 2% (medium, n=316) and 37.

9% (high, n=227) under the reading in which an “easy” task supplies more target information">. p. 4
Where the paper says it

2% (medium, n=316) and 37. 9% (high, n=227) under the reading in which an “easy” task supplies more target information, and reverses under the opposite reading.

p. 4
Where the paper says it

2% (medium, n=316) and 37. 9% (high, n=227) under the reading in which an “easy” task supplies more target information, and reverses under the opposite reading.

p. 4
Where the paper says it

2% (medium, n=316) and 37. 9% (high, n=227) under the reading in which an “easy” task supplies more target information, and reverses under the opposite reading.

The paper references studies concerning the limitations of using character ngrams to detect authorship. p. 0
Where the paper says it

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. We also audit machine-versushuman classification on the same corpus, where character ngrams reach macro-F1 1.

p. 0
Where the paper says it

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. We also audit machine-versushuman classification on the same corpus, where character ngrams reach macro-F1 1.

p. 0
Where the paper says it

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. We also audit machine-versushuman classification on the same corpus, where character ngrams reach macro-F1 1.

<ref:2611.33227#pg5, "A pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims">. p. 4
Where the paper says it

125 Folds 5 5 5 3 4 above frozen CodeBERT and far above every semantic feature set. That a pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims.

p. 4
Where the paper says it

125 Folds 5 5 5 3 4 above frozen CodeBERT and far above every semantic feature set. That a pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims.

p. 4
Where the paper says it

125 Folds 5 5 5 3 4 above frozen CodeBERT and far above every semantic feature set. That a pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims.

The paper references studies concerning the need for matched corpora for provenance comparison. p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

p. 5
Where the paper says it

We release a blind two-rater worksheet over all positives and 40 sampled negatives, and the adjudicated rate remains future work, while only 28 of 190 human files are adjudicable, so a matched corpus of human-written standalone OT scripts is the binding constraint on any prevalence comparison. The verifier is as complete as its bindings, exercises one context, checks vendor identity as a necessary but not sufficient condition, and addresses an error made by a non-adversarial generator rather than an adversary who has read this paper.

<ref:2611.33227#pg5>

--- Page 1 ---

REAL PACKAGE, WRONG CONTROLLER: STATIC

AUDITING OF VENDOR–PROTOCOL MISMATCHES

IN LLM-GENERATED PLC CODE

S M Zia Ur Rashid1,, Sazidul Islam Hira2, and Suman Rath1.<ref:2611.33227#pg1, "REAL PACKAGE, WRONG CONTROLLER: STATIC AUDITING OF VENDOR–PROTOCOL MISMATCHES IN LLM-GENERATED PLC CODE">

--- Page 4 ---

TABLE III

AUDIT OVER THE FULL UNBALANCED CORPUS (FINGERPRINT

1F C2F A6B677C). <ref:2611.33227#pg4, "TABLE III AUDIT OVER THE FULL UNBALANCED CORPUS (FINGERPRINT 1F C2F A6B677C)">

--- Page 5 ---

Fig. 1. Inclusive audit rates with Wilson intervals and library–target pairings. p. 3

Where the paper says it

7] Human control 0 28 0. Inclusive audit rates with Wilson intervals and library–target pairings.

<ref:2611.33227#pg4, "Fig. 1 shows the mismatch concentrated in a few library–target pairings, led by snap7 aimed at Schneider (73 scripts) and pycomm3 aimed at Siemens (45), with snap7 at Rockwell (43) and pycomm3 at Schneider (19) following">

--- Page 6 ---

TABLE IV

MACRO-F1 FOLD MEANS FOR MACHINE–VERSUS–HUMAN CLASSIFICATION, WITH CHARACTER n-gram VALUES IN BOLD. <ref:2611.33227#pg5, "TABLE IV MACRO–F1 FOLD MEANS FOR MACHINE–VERSUS–HUMAN CLASSIFICATION, WITH CHARACTER n-gram VALUES IN BOLD">

--- Page 6 ---

TABLE V

DIAGNOSTIC ON THE TASK–DISJOINT PARTITION. <ref:2611.33227#pg5, "TABLE V DIAGNOSTIC ON THE TASK–DISJOINT PARTITION">

The paper references numerous works concerning LLM-generated code and security machine learning.<ref:2611.33227#pg5, Models produce phishing material, scanners and simple exploits under mild prompting [6], and later systems automate larger stretches of the intrusion lifecycle [7], [8]>. The work builds on recurring pitfalls in security machine learning concerning malware results that do not survive realistic partitions.<ref:2611.33227#pg5, It builds on recurring pitfalls in security machine learning [18], malware results that do not survive realistic partitions [19]>. The paper also references studies investigating code hallucinations by LLMs.<ref:2611.33227#pg5, Code models hallucinate [10], [11], most relevantly by importing packages that do not exist, at rates sufficient to support supply–chain attacks on the invented names [9]>. The paper references studies investigating model reliability for legitimate PLC logic.<ref:2611.33227#pg5, Defensive ICS research meanwhile concentrates on network– and process-level detection at run time, with adjacent work on model reliability for legitimate PLC logic [12]>. The paper cites work on evaluation hygiene related to annotation artifacts.<ref:2611.33227#pg5, The closest analogue is linguistic, where annotation artifacts let hypothesis-only models beat chance on inference benchmarks [22]>. The paper references studies investigating leakage as a cause of irreproducibility.<ref:2611.33227#pg5, Leakage and the reproducibility crisis in machine learning-based science [21]>. The paper cites work on character ngrams for detection.<ref:2611.33227#pg5>. The paper references studies investigating the separation of classes by genre.<ref:2611.33227#pg5, "The tokens that separate the classes describe genre rather than authorship">. The paper references studies investigating the role of a trailing newline in classification.<ref:2611.33227#pg5, "The trailing newline present in 95.2% of human files and in none of the generated ones separates the classes on its own">. The paper references studies concerning evaluation hygiene related to transformation failures.<ref:2611.33227#pg5, "Every normalisation rung retains macro–F1 1.000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier">. The paper references studies concerning graph coverage bounds on recall.<ref:2611.33227#pg5, "Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered">. The paper references studies concerning vendor identity as a necessary but not sufficient condition.<ref:2611.33227#pg5, "All five vendor–lock edges carry a documented source">. The paper references studies concerning the impact of supplied-context level on mismatch rate.<ref:2611.33227#pg5, "Finally, the mismatch rate by supplied–context level is 14.4% (low, n=340), 14.2% (medium, n=316) and 37.9% (high, n=227) under the reading in which an “easy” task supplies more target information">. The paper references studies concerning the limitations of using character ngrams to detect authorship.<ref:2611.33227#pg5, "A pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims">. The paper references studies concerning the need for matched corpora for provenance comparison.<ref:2611.33227#pg5>. The paper references studies concerning evaluation hygiene related to transformation failures.<ref:2611.33227#pg5, "Every normalisation rung retains macro–F1 1.000, including the AST round trip that destroys all formatting and the anonymisation of every local identifier">. The paper references studies concerning graph coverage bounds on recall.<ref:2611.33227#pg5, "Recall is bounded by the binding table, which covers 7 of 24 mainstream Python OT packages and leaves pylogix, pyModbusTCP, modbus_tk, minimalmodbus, opcua, asyncua, OpenOPC, pyads and pydnp3 among others uncovered">. The paper references studies concerning vendor identity as a necessary but not sufficient condition.<ref:2611.33227#pg5, "All five vendor–lock edges carry a documented source">. The paper references studies concerning the impact of supplied-context level on mismatch rate.<ref:2611.33227#pg5, "Finally, the mismatch rate by supplied–context level is 14.4% (low, n=340), 14.2% (medium, n=316) and 37.9% (high, n=227) under the reading in which an “easy” task supplies more target information">. The paper references studies concerning the limitations of using character ngrams to detect authorship.<ref:2611.33227#pg5, "A pretrained code model is beaten by character ngrams is hard to reconcile with the label meaning what it claims">. The paper references studies concerning the need for matched corpora for provenance comparison.<ref:2611.33227#pg5>

--- Page 4 ---

TABLE III

AUDIT OVER THE FULL UNBALANCED CORPUS (FINGERPRINT

1F C2F A6B677C). <ref:2611.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Precision static verification of OT scripts based on vendor-protocol suitability rather than mere package existence. This improved system can check whether the documented bindings list this library as supporting the declared target, addressing the gap where existing tools only confirm symbol existence.

  2. Implementation of a metadata conditioned, import level incompatibility predicate over a version pinned binding graph. This predicate is decidable from source without labels or trained models, and every positive result carries an inspectable witness for human review.

  3. A static verifier that emits a twelve component readable vector for every script, partitioned into existence only and the OT part that isolates what grounding contributes. This allows developers to see exactly which feature (like cross vendor mismatch or port protocol conflict) is flagging a potential issue.

  4. Enhancement of the audit process by tracking witness depth using alias tracking and one level of assignment binding to classify imports as L0, L1, L2, or L3 based on how deeply the script uses the offending library. This moves beyond simple existence checks to assess functional dependency on imported libraries.

  5. Integration of repository local scoping when calculating imaginary library flags by defining Mr as the set Mr of module names genuinely present there. This prevents flagging intra-repository sibling imports as genuine signals, improving signal integrity against false positives caused by repository structure.

Abstract

Language models can generate Python that drives industrial protocols on programmable logic controllers, yet existing code-grounding checks ask whether an imported package or symbol exists rather than whether it suits the declared industrial target. We define metadata-conditioned, import-level vendor--protocol incompatibility and 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%); restricting to single-vendor targets gives 16.3%, and additionally requiring the offending library to reach a protocol communication call gives 14.2%, which we read as conditional on the corpus metadata rather than on verified intent. None of the 28 adjudicable human control files carries one, a sample too small to estimate a 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. We also audit machine-versus-human classification on the same corpus, where character n-grams reach macro-F1 1.000 under task, model and vendor-disjoint partitions and survive comment removal, an AST round trip and identifier anonymisation. The trailing newline present in 95.2% of human files and in none of the generated ones separates the classes on its own. Vendor--protocol consistency is a useful static audit target, whereas provenance classification on repository-labelled corpora is not authorship detection.

Sources

Related papers