Real Package, Wrong Controller: Static Auditing of Vendor--Protocol Mismatches in LLM-Generated PLC Code
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 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. 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. 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. 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. 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. Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. 4%); restricting to
single-vendor targets gives 16. Across 883 generated scripts, 180 carry an importlevel mismatch against the declared target (20. 4%); restricting to
single-vendor targets gives 16. 4%); restricting to
single-vendor targets gives 16. 3%, and additionally requiring the
offending library to reach a protocol communication call gives
14. 4%); restricting to
single-vendor targets gives 16. 3%, and additionally requiring the
offending library to reach a protocol communication call gives
14. 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. 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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. 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. 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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. 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.Where the paper says it
Where the paper says it
Where the paper says it
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 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. 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. 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. 4) and ip address (85. These are
the signatures of a test suite against a standalone script, which
is what the corpus contains. 4) and ip address (85. These are
the signatures of a test suite against a standalone script, which
is what the corpus contains. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95. The trailing newline present
in 95. 2% of human files and in none of the generated ones
separates the classes on its own. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
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.<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 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. 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. 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. 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. 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 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.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
References
The paper references numerous works concerning LLM-generated code and security machine learning.<ref:2611.33227#pg5, 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]. 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]. Tian et al. , “CodeHalu: Investigating Code Hallucinations in LLMs via
Execution-based Verification,” arXiv:2405. Tian et al. , “CodeHalu: Investigating Code Hallucinations in LLMs via
Execution-based Verification,” arXiv:2405. 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. 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. The remainder of the paper proceeds as follows. Section II
positions the work against generation, package-existence and
evaluation-hygiene literature. The remainder of the paper proceeds as follows. Section II
positions the work against generation, package-existence and
evaluation-hygiene literature. 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]. 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]. 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. 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. 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. 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. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95. 000 under task, model and vendordisjoint partitions and survive comment removal, an AST round
trip and identifier anonymisation. The trailing newline present
in 95. The trailing newline present
in 95. 2% of human files and in none of the generated ones
separates the classes on its own. The trailing newline present
in 95. 2% of human files and in none of the generated ones
separates the classes on its own. The remainder of the paper proceeds as follows. Section II
positions the work against generation, package-existence and
evaluation-hygiene literature. The remainder of the paper proceeds as follows. Section II
positions the work against generation, package-existence and
evaluation-hygiene literature. The remainder of the paper proceeds as follows. Section II
positions the work against generation, package-existence and
evaluation-hygiene literature. 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. 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. 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. 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. 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. 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. • 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. • 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. • 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. 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 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 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. Finally, the mismatch rate by supplied-context level is
14. 4% (low, n=340), 14. Finally, the mismatch rate by supplied-context level is
14. 4% (low, n=340), 14. Finally, the mismatch rate by supplied-context level is
14. 4% (low, n=340), 14. 4% (low, n=340), 14. 2% (medium, n=316) and 37. 4% (low, n=340), 14. 2% (medium, n=316) and 37. 4% (low, n=340), 14. 2% (medium, n=316) and 37. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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.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. 1Where the paper says it
Where the paper says it
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. 5Where the paper says it
Where the paper says it
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. 1Where the paper says it
Where the paper says it
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. 1Where the paper says it
Where the paper says it
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. 1Where the paper says it
Where the paper says it
Leakage and the reproducibility crisis in machine learning-based science [21]
>. The paper cites work on character ngrams for detection. p. 1Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
--- 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 7]
Human control 0 28 0. Inclusive audit rates with Wilson intervals and library–target pairings.Where the paper says it
--- 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
-
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. -
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.
-
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.
-
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.
-
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
- AutoAttacker: A Large Language Model Guided System to Implement Automatic Cyber-attacks
- Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Code
- CodeHalu: Investigating Code Hallucinations in LLMs via Execution-based Verification
- Can AI-Generated Text be Reliably Detected?
Related papers
- RustMizan: A Compilable, Contamination-Aware Benchmarking Framework for Rust Vulnerabilities
- Introducing the Generative Application Firewall (GAF)
- Opal: Private Memory for Personal AI
- Fuel as Identity: Authenticating Inter-Satellite Laser Links after Total Key Compromise
- Merkle Trees Minimize Verifier Complexity in the ROM
- VulCPE: Context-Aware Cybersecurity Vulnerability Retrieval and Management