← Resources
AI·7 min read·

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.

Safety does not run through the PLCE-StopStart / StopSafety relayrated, redundantStandard PLCnot ratedContactorThe safety path can drop the contactor on its own. The PLC cannot override it.

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