Marek SrokaArticles

Read-only by design: connecting AI to a running plant without touching the PLC

Marek Sroka · Updated 3 December 2026

The first question a plant manager asks about AI is not "how accurate is it". It is "can it stop my line". After ten years of commissioning robots, PLCs and vision systems in live plants, I think that is exactly the right question, and the answer should be a design decision, not a promise.

When I built Prevly, a predictive-maintenance system that warns before a machine breaks, I made one rule first: the software can read, and it can never write to a machine. Everything else in this article follows from that rule.

Why read-only is the starting point

An AI model that predicts a bearing failure is useful. An AI model that can change a setpoint is a new safety risk that has to be validated like any other change to a control system. In a regulated plant (I modernised a packaging machine in an FDA / ISO 13485 medical-device plant) every change to the control layer goes through validation. A read-only data path keeps the AI outside that loop: it informs people, and people decide.

Read-only also makes the conversation with the plant's OT and IT teams much shorter. "It reads tags over OPC UA and sends an alert" is a request they can approve. "It needs write access to the PLC" is a project.

The data path, layer by layer

LayerWhat I useWhy
Controllerexisting PLC (Siemens, Rockwell and others), no program changesthe line keeps running exactly as validated
ProtocolOPC UA, read-only user, Sign & Encryptthe server itself refuses writes, and traffic is authenticated
Older machinesa protocol gateway or retrofit sensors that bypass the PLCno change to old controllers that have no OPC UA
Edgea small computer on site that runs the model offlinedata does not have to leave the plant
Networkoutbound-only connections from the edgenothing outside can open a session into the plant network

The important part is that "read-only" is enforced in more than one place. The OPC UA user has no write rights. The edge software has no write code path. And the repository has a CI rule that fails the build if any code could write to a PLC tag. If one layer is misconfigured, the others still hold.

Zones and conduits, in plain words

IEC 62443 is the standard plant security teams use for industrial automation. Its core idea is simple: split the plant into zones with similar security needs (the machine network, the plant IT network, the cloud) and allow traffic between them only through defined conduits.

For AI on the shop floor that means:

I design to security level 1 of IEC 62443-3-3 as the floor. It is not a certificate, but it gives the plant's security team a vocabulary they already use to check the design.

What the AI actually sends

The output is an alert for maintenance, not an action on the machine: which asset, what is likely to fail, how confident the model is and what to check. The decision to stop a machine, order a part or plan a repair stays with people, inside the plant's existing maintenance process.

This is also why I keep the model honest about uncertainty. A warning that says "probably the motor bearing, check vibration on the drive end" is more useful to a maintenance technician than a confident number with no explanation.

A short checklist before you connect AI to machines

  1. Can the AI write to any controller? If yes, why, and who validated it?
  2. Is read-only enforced by the OPC UA server, by the software and by a test in the build?
  3. Which zone does the edge computer sit in, and which conduits does it use?
  4. Is all traffic outbound-only and encrypted? Is there an offline option?
  5. Who receives the alert, and what do they do with it?

If you are planning something similar for your plant, I am happy to compare notes. My background is in exactly this overlap: the PLC and the AI, and the plant network in between.

Marek SrokaAI engineer with ten years of industrial automation: robots, PLCs and vision in live plants, now AI agents, evals and machine-data ML. CV and projects