How eaxScada protects tag writes
Migrated page, not yet verified against the current code. Treat values, paths and examples as indicative until this notice is removed.
A button on a screen is only one way to write a tag. A script, an API client, a NATS command, an assistant’s approved setpoint and a recipe can write the same tag. eaxScada therefore protects writes in three places, and each one protects against different things.
Three levels
Section titled “Three levels”- Service or process
- Device or controller
- Field equipment
- Person or role
- External system
- Command to equipment
Read as text
A write is protected in three places: on the screen, in the eaxScada server and in the PLC. An operator passes all three. Other writers that go through eaxScada skip the screen. An unsigned NATS command names no user, so it passes without the permission check. A writer outside eaxScada reaches the PLC directly, so only the PLC can stop it.
Parts
- The screen (layer 1): Stops a command that should not be pressed now, and says why.
- The eaxScada server (layer 2): Checks every write that arrives through eaxScada, whatever sent it.
- The PLC (layer 3): Stops everything, whoever sends the command. Safety belongs here.
- On the screen (service or process): disabled buttons, input limits, confirmation dialog
- Write policy, in order (service or process): 0 the user's permission 1 the tag exists 2 the screen: access level, parameters 3 the limits 4 the engineering range 5 screen interlocks 6 confirmation and e-signature. The first check that fails refuses the write; nothing is sent to the device.
- Control program (device or controller): and the hardwired safety circuit
- Equipment (field equipment)
- Operator (person or role)
- Other writers (service or process): screen scripts, API clients, NATS command, assistant setpoint
- Outside eaxScada (external system): a PLC program, an engineering tool
Connections
- Operator → On the screen (command to equipment)
- Other writers → Write policy, in order (command to equipment). A NATS command carries no screen and names no user: the two screen checks never apply to it, and the permission check is made only for the person who signed it. An unsigned command is refused for a tag that needs a signature or a confirmation.
- Outside eaxScada → Control program (command to equipment). These writes reach the device without eaxScada: the server cannot stop them.
- On the screen → Write policy, in order (command to equipment)
- Write policy, in order → Control program (command to equipment)
- Control program → Equipment (command to equipment)
| Level | What it is | What it stops | What it cannot stop |
|---|---|---|---|
| The screen | Disabled buttons, the “why” tooltip, the input’s own limits, the keypad’s range, the confirmation dialog | An operator pressing a command that should not be pressed now, with an explanation | Any write that does not come from that screen |
| The eaxScada server (the write policy) | Checks every write that arrives through eaxScada’s API, whatever sent it | Unknown tags, values outside the limits, writes a simple screen interlock would block, missing confirmations and signatures | Writes that reach the device without eaxScada: a PLC program, another SCADA, an engineering tool on the network |
| The PLC | The control program and the hardwired safety circuit | Everything, whoever sends the command | Nothing: this is where safety belongs |
What the server checks, and in which order
Section titled “What the server checks, and in which order”Every write through POST /api/tags/write (the operator runtime, screen scripts, API clients), a NATS command (uns.command.write), and an assistant setpoint when it is staged and again when it is approved, goes through the checks below, in this order. The first check that fails refuses the write; nothing is sent to the device. A NATS command has no signed-in user and no screen, so checks 0 and 2 do not apply to it as they are written here: see Commands that arrive over NATS.
| Order | Check | Refused with | Journaled as |
|---|---|---|---|
| 0 | Permission: the user’s write (publish) right on the tag path, from the permission rules of their roles, groups and account. For a user who is not an administrator, a write that no rule allows is refused. | 403 |
WRITE_DENIED, on every refusal: the write request records it, with the user and the tag. Also AUTHZ_DENIED when a deny rule on the tag or on one of its containers is what refused it: the permission rules record that one, with the rule. A write refused only because no rule allows it has WRITE_DENIED alone. |
| 1 | The tag exists: an eaxTag, a driver tag mapping or a tag the tag engine holds. A write never creates a tag. The plant emergency-stop signal always exists. | 404 unknown_tag |
WRITE_DENIED_UNKNOWN_TAG |
| 2 | The screen, for a write sent from a screen. First the access level: the writer must be allowed to open that screen (its Required Access Level); a user who may not open a screen may not send its commands either. Then the screen parameters: a write sent from a screen opened with parameters must be one that screen admits with those values. | 403 screen_access_denied, then 403 parameters_refused |
WRITE_DENIED_SCREEN_ACCESS, then WRITE_DENIED_SCREEN_PARAMETERS |
| 3 | The limits: every screen limit on the tag (an input’s minimum, maximum and step, a bound limit tag, a faceplate’s setpoint limits) and the tag’s own write range (minimum, maximum, step, allowed values; for a text tag the length and the allowed texts). The strictest of all applies. A bound limit tag that is missing or not Good refuses every value. | 400 out_of_range, with min and max |
WRITE_DENIED_OUT_OF_RANGE |
| 4 | The engineering range of the tag. | 422 refused |
WRITE_DENIED_OUT_OF_ENG_RANGE |
| 5 | Screen interlocks: refused when every screen object that sends this value to this tag is disabled by an active, simple interlock. | 409 interlocked, with the interlock and the objects |
WRITE_DENIED_INTERLOCK |
| 6 | Confirmation and electronic signature that any object writing the tag asks for. A signature that is given and wrong is refused even on a tag that needs none: a wrong password is never ignored. | 403 confirmation_required or signature_required; a wrong signature: 403 signature_rejected |
WRITE_DENIED_CONFIRMATION_REQUIRED, WRITE_DENIED_SIGNATURE_REQUIRED; a wrong signature on a tag that needs one: WRITE_DENIED_SIGNATURE_REQUIRED, on a tag that needs none: WRITE_DENIED_SIGNATURE_REJECTED |
Raising the plant emergency-stop signal is exempt from the limits and the interlocks.
Limits and interlocks come before the signature on purpose: a signature, a confirmation or a supervisor’s approval never overrides a limit or an interlock, and a password is never asked for a write that would be refused anyway.
The user is always the signed-in session’s. An AI co-pilot account and an API token never sign, so a tag that needs a signature can never be written by an assistant.
Which writers are covered
Section titled “Which writers are covered”| Writer | Server checks |
|---|---|
Operator runtime, screen scripts (system.tag.write), API clients |
all |
NATS uns.command.write |
checks 1, 3, 4, 5 and 6 always; never the two screen checks (a command carries no screen); the permission check only for a command a person signed. See Commands that arrive over NATS |
An assistant’s setpoint (scada_stage_tag_write), at staging and at approval |
all; the approver’s signature is checked after the limits and interlocks |
| Dashboard command cards (push button, batch reactor START / STOP, pump, PID controller) | all; a card’s Confirmation (none, require, e-signature) and Interlock tag (active when not 0) are required by the server for the card’s tags, as for a screen button. The reactor’s E-STOP is never asked and never interlocked. A card without an interlock tag is not counted as an unblocked command. |
| A recipe download | the tag’s write range, checked again by the driver just before the device |
| Drivers, server scripts, eaxTags scripts, the simulator, high-availability replication | not the write policy: they are the plant’s own data paths. An eaxTags script made by an AI client is checked before it is saved (see AI changes on the emergency-stop signal and safety tags) |
Commands that arrive over NATS
Section titled “Commands that arrive over NATS”A command on uns.command.write is an external write: the server sees a path and a value, and no signed-in user and no screen. What it checks depends on how the command is signed.
| The command | Who is checked | What is checked | Journaled as |
|---|---|---|---|
| Unsigned (a path and a value) | Nobody. The command names no person, so the permission check (check 0) is not made. | Checks 1, 3, 4 and 5, then check 6: the command is refused for a tag that needs a signature (signature_required) and for a tag that needs a confirmation (confirmation_required), because a command cannot show a dialog. |
A refusal: the code of the check, for example WRITE_DENIED_SIGNATURE_REQUIRED or WRITE_DENIED_CONFIRMATION_REQUIRED. An accepted command has no signature record. |
| Signed by a person, with a one-time ticket | The person the ticket was issued to, when the ticket is redeemed at check 6: the ticket is for exactly this tag and value, the account is still active, it is not the AI co-pilot’s, and it has the write (publish) right on the tag. | Checks 1, 3, 4 and 5 first, then the ticket. | NATS_COMMAND_SIGNED under the person’s name, with the meaning they gave (NATS_COMMAND_SIGNED_FAILED when the write then fails). A person who may not write the tag: WRITE_DENIED. |
Signed by an integration (signer, sig, ts, nonce) |
The integration identity, at check 6: it is registered and enabled, the time is inside the window, the signature is its own, the nonce was not used before, its role may write, and one of its own tag patterns covers the tag. A person’s permission rules play no part. | Checks 1, 3, 4 and 5 first, then the identity. | INTEGRATION_COMMAND_VERIFIED or INTEGRATION_COMMAND_REJECTED, then SYSTEM_COMMAND_AUTHENTICATED (..._FAILED when the write then fails). It is an authenticated system command, never a person’s electronic signature. |
| Signed both ways (a ticket and an integration’s signature) | - | Refused: a command is signed by a person or by an integration, not both. | WRITE_DENIED_SIGNATURE_REQUIRED on a tag that needs a signature, WRITE_DENIED_SYSTEM_SIGNATURE_INVALID on any other |
| Carrying a password | - | Refused before any other check, whatever the tag. The password is never read or verified. | NATS_COMMAND_PASSWORD_REJECTED |
A tag needs a signature from a NATS command when a screen object that writes it asks for one, or when the tag’s e-signature for external writers attribute (esign_external) is set, on the tag or on a container above it. A verified signature, a person’s or an integration’s, also counts as the confirmation.
Two more things differ from a write sent from a screen. The two screen checks (check 2) never apply. And in the interlock check (check 5), a NATS command is checked as a writer who may open only the screens that have no Required Access Level. A command on a screen that has one (a restricted screen) is not the NATS writer’s, and it counts in one direction only:
- While it is enabled, it is not counted as a way for the value to pass. It cannot cancel an active interlock on another screen’s command that sends the same value.
- While an interlock disables it, it counts as disabled, as for any writer: the value is refused unless an enabled command on a screen without a Required Access Level sends the same value in the same copy of the screens (see Deployed and saved copies).
- Being left out is not a refusal. A value that only enabled commands of restricted screens send is not refused by the interlock check: the limits (checks 3 and 4) have already been applied to it, and the signature and the confirmation (check 6) still decide.
What this means when you decide whether to accept NATS commands:
- An unsigned command is not held back by anyone’s permission rules. Anything that can publish on
uns.command.writecan write every tag that asks for neither a signature nor a confirmation, inside its limits and interlocks. - To make a tag writable only by a named person or a registered integration, set its e-signature for external writers attribute. Unsigned commands for it are then refused, and every accepted one is journaled with who signed it.
- Give an integration tag patterns that cover only the tags it has to write: they are the integration’s only permission.
The formats, the ticket and the integration identities are in Signed commands.
Writes to an eaxPLC variable
Section titled “Writes to an eaxPLC variable”A tag under an eaxPLC’s prefix is a variable of that PLC. GET /api/plc/paths lists these leaves for the tag browser and the code editor, each with what the PLC told about it:
| Field | Meaning |
|---|---|
writable |
The effective answer: access read-write, not a constant, and inside the PLC’s writable patterns. Only such a leaf is written. |
access |
The PLC’s own external access of the variable (read or read_write). |
constant |
The variable is a VAR CONSTANT. |
min, max |
The PLC’s write range, only when the variable is bounded. |
enum |
The enumeration’s values (name, value), only for an enumeration. |
meta |
true when the PLC told this metadata. An older PLC does not; then eaxScada checks no value against it and the PLC decides alone. Missing metadata never makes a leaf writable. |
read_only_why |
Why it is not writable: a CONSTANT, its external access is read, or not writable from the network on this PLC (access read-write, but outside the PLC’s writable patterns). |
The tag browser and the inputs grey out a leaf that is not writable before anyone tries.
POST /api/tags/write to a leaf is checked against this metadata before it is signed or sent. A value outside min..max answers 409 PLC_VALUE_OUT_OF_RANGE; a value that is not one of the enumeration’s values answers 409 PLC_VALUE_NOT_IN_ENUM. The answer carries min, max or enum; the value is never clamped or rounded, nothing is sent, and the refusal is journaled as MANUAL_OVERRIDE_REFUSED. A value that passes is still the PLC’s to refuse; its answer and reason are shown to the operator, and the write is never sent again.
Simple interlocks: what the server can evaluate
Section titled “Simple interlocks: what the server can evaluate”The server enforces a screen interlock only when it is a simple tag comparison, the subset of the screen’s expression language the server can evaluate exactly as the browser does:
tag('Plant/Processing/Pump1/Trip') == 1{Plant/Processing/Tank1/Level} > 95 || {Plant/Processing/Tank1/Door} != 0!(tag('Plant/Processing/Line/Permissive') == 1)A tag (tag('...'), {...}, [...] or a plain path) compared with ==, !=, >, >=, < or <= to a number or true / false; comparisons joined by &&, ||, ! and parentheses, at most 8. Anything else (arithmetic, functions, ===, two tags compared with each other, a script) disables the button on the screen only. The designer marks every interlock Enforced by the server or Screen only, and the Problems panel lists screen-only interlocks (interlock-client-only).
Value by value. The server refuses only what the screen would refuse. A START button (sends 1, interlocked by a trip) and a STOP button (sends 0, no interlock) write the same tag: while the trip is active, a write of 1 is refused and a write of 0 always goes through. A momentary button’s release is never refused. If any object can send the value without an interlock, the value is allowed.
Bad values. If a tag an interlock reads is missing or Bad, the interlock counts as active (the command is disabled), unless the object’s If the interlock reads a Bad value is Allow. For a stop or trip command choose Allow: a failed sensor must never stop an operator from stopping. The lint rule command-stop-blocks-on-bad-quality warns about the opposite.
Deployed and saved copies
Section titled “Deployed and saved copies”When a screen is saved but not deployed, the operators run the deployed copy while the studio holds the new one. The server applies the strictest of both: a confirmation or signature either copy asks for, every limit of both, and every interlock of both. Saving can therefore only add protection; removing an interlock, a limit or a signature takes effect only when you deploy.
What the operator sees
Section titled “What the operator sees”The screen explains what the server enforces:
- a disabled command shows its disabled look and a tooltip that says why: the interlock and its condition, the role it needs, a Bad value, or the part of the action that is not configured (Style object states);
- an input refuses an out-of-range value before sending, with the reason;
- a write the server refuses returns the server’s reason, and the field returns to the live value.
These screen checks save the operator a round trip. The server’s checks are the ones that count.
AI changes on the emergency-stop signal and safety tags
Section titled “AI changes on the emergency-stop signal and safety tags”The write policy checks each write. A second server check stops an AI client from changing what can write: an MCP client or the in-product AI assistant never adds or changes a command, a write access, a staged value or a script write on the plant emergency-stop signal or on a tag watched by a safety alarm (category Safety, or a built-in alarm). Such a proposal is refused when it is proposed and again when a person applies it, against the alarms as they are then; nothing is saved and nothing is written. An AI-made eaxTags script is analysed from its source, never run: a tags.set(...) that can reach one of these tags, under any name, alias or computed path, is refused, and so is a script whose writes cannot be derived. Reading the signal (a display, a condition in a script) stays allowed. If the check cannot run, the change is refused.
What people see: an MCP client gets the reason (refused: ... AI clients cannot add or change commands on it - a person does that in the Studio); the AI assistant panel shows the proposal as Refused by the safety check, with the tag and the reason, and no Apply button; every refusal is journaled as AI_PROPOSAL_REFUSED.
To change such a command on purpose, a person does it in the Studio under their own engineering account, journaled under their name; with Require an e-signature to deploy it goes live only with their signature, and a command set to Require E-Signature makes every operator write signed. The details, and the list of what is refused, are in MCP AI gateway.