Where AI-written code stops being acceptable
A line worth drawing explicitly, before somebody draws it for you after an incident.
Short answer
For non-safety logic reviewed by a competent engineer, it is a drafting tool like any other. For safety functions it is not acceptable, because a safety case requires a documented, deterministic development process and a probabilistic generator cannot provide one. The practical line runs between code that can stop production and code that can hurt somebody.
This deserves a clear answer rather than a hedge, because the alternative is that everyone quietly makes their own rule.
The line
Code that can stop production: AI assistance is fine, with review. It is a drafting tool, and a competent engineer reviewing a draft is a normal working arrangement.
Code that can hurt somebody: no. Not because the output is necessarily worse, but because a safety case is a documented argument about process, and 'a model produced it' cannot be part of that argument.
Why the standards make this decision for you
Functional safety requires traceability from requirement to implementation to verification. It requires that the same process produces the same result. A generative model is by construction non-deterministic.
You are not being asked whether the code is good. You are being asked to show how it came to exist, and to whom.
What a workable policy looks like
- Allowed: drafting non-safety logic, documentation, explanation, conversion, test case generation.
- Required: review by a competent engineer before anything is downloaded.
- Logged: what was generated, by which model, and what was accepted. This is cheap to do and answers the audit question before it is asked.
- Prohibited: anything inside a safety function, and anything that writes to a controller without a human action in between.
Common questions
- Can AI write safety PLC code?
- It should not, and in a certified environment it cannot be signed off. Functional safety standards require a documented development process with traceable requirements and verification. A generator that produces different output for the same prompt cannot satisfy that, regardless of how good the output is.
- What is a reasonable policy for AI-assisted PLC work?
- Allow it for drafting, documentation, explanation and conversion of non-safety logic, with mandatory engineer review before download. Prohibit it in safety functions. Log what was generated and what was accepted, because the audit question is not whether you used AI but whether you can show what it did.
Keep reading
- Safety
SIL or PL: which one does your machine need?
Two standards, two scales, and one machine. Which one applies, how they map to each other, and why the answer is usually ISO 13849.
- Safety
Categories B, 1, 2, 3 and 4, in plain terms
Five architectures, what a single fault does to each, and the practical wiring that goes with them.
- Safety
Safety relay or safety PLC: how to decide
One is a wiring decision, the other is a programming one. The count of safety functions, not the size of the machine, is what settles it.