Skip to main content

Approvals and safe write

Nothing an AI assistant proposes happens until a person approves it. This page explains the whole path: propose, approve, execute, the policies that decide who may approve and when, the per-tag safe write limits, and the holds that stop a tag after an unclear write.

Approvals page with the Inbox, Audit trail, Policies and Held tags tabs
Approvals page with the Inbox, Audit trail, Policies and Held tags tabs

The page is Approvals (also embedded in the Agent's Act tab). Its lead reads "Changes proposed by AI assistants wait here. Nothing happens until a person approves it." The tabs are Inbox, Audit trail, Policies and Held tags.

How it works​

Who proposes​

The server sets the source of every proposal. It is mcp (an AI assistant), rule, or user (shown as Person). A proposal cannot lie about its source.

Statuses​

Status (UI)Meaning
WaitingPending. Expires 24 hours after it was proposed ("This proposal has expired. It must be proposed again.").
Approved, not runApproved, not yet executed.
RunningExecuting.
DoneExecuted.
RejectedA person said no.
FailedExecution failed.
Outcome unknownThe execution did not report within 2 minutes.
ExpiredNot decided in time.

Execution outcomes are applied, refused, mismatch, unknown and not_applied.

What can be proposed​

"Write a tag value", "Acknowledge an alarm", "Shelve an alarm", create, change or delete a device, "Add or change tags", create or delete a rule, create, change or delete a dashboard, create or delete an uplink, and add, change or delete a plant graph link.

The two-person rule​

  • The proposer can never decide their own proposal (HTTP 403). The Inbox says "Proposed with your own access: someone else must decide." The same applies to "Record what happened".
  • Approve, reject and execute are person-only. An agent credential is refused: "agent credentials can only propose; a person must approve and execute".
  • Who may decide:
    • Dashboard proposals need approve_dashboards (administrator, analyst).
    • Any other kind needs at least one of configure_devices, configure_rules, configure_uplinks, configure_dashboards, write_tags, ack_alarms.
    • Executing also needs the capability of the underlying action, for example write_tags for a tag write. RBAC is checked again at execution, because the Console runs the action with the executor's own token.
    • A proposal's requireRoles list can restrict approvers further ("Needs one of these roles: ...").
    • Scoped users can only decide on proposals inside their access.
  • Messages you may see: "You may look, but not decide." and "You may approve; someone with the right permission must run it."

Step by step: approve a tag write​

  1. Open Approvals. Proposals appear in Inbox.
  2. Open the proposal. Read the "Reason given by the proposer (not verified)", the current value and the limits. If the proposer attached an analysis (at most 24 hours old), the server repeats its result.
  3. Approve it. The value you see now goes with the approval: "If it changed, a tag with limits is not written."
  4. Run it (execute). The proposal is claimed (approved to executing) so exactly one caller runs it. It is never retried automatically.
  5. Check the result. If the outcome is unclear, use "Record what happened" (below).

Outcome unknown: record what happened​

If the outcome is unknown, nothing is written again. A person opens the device, looks, and records the answer: "It was carried out" or "It was not carried out", with a required note ("How do you know?"). A mismatch creates a proposal to restore the earlier value; "Another person has to approve it."

Act policies (tab Policies)​

"Policies decide how many people must approve a proposal, who they are, and when it may run. Without a policy one approval is enough."

Only administrators edit policies. Saving needs the Enterprise licence feature hitl.policies; policies that already exist keep applying without a licence and can only be removed as a whole.

A policy is a set of risk classes and rules.

Risk class fieldMeaning
NameClass name.
People who must approveNumber of different people. The proposer never counts.
Each approver must hold one ofRoles.
May run onlyTime windows: days Mon to Sun, from, to, time zone. An end before the start means the next day; equal times mean the whole day.
Emergency override allowedOn or off.
Override byRoles that may use the override.
Rule fieldMeaning
Name, Class, ActiveThe rule and the class it applies.
Actions, Devices, Equipment classes, Plant paths, Equipment ids, Tag idsFilters. All filters must match; within one filter any value matches; no filter means every proposal.

If several classes match, the strictest of each setting applies. Open proposals stay bound to every version since they were proposed.

Emergency override: one person skips approvals and time windows for 15 minutes. It needs a reason of at least 10 characters and typing EMERGENCY to confirm. Only that person may run it, value limits stay in force, and it is recorded and cannot be undone.

Why a proposal is blocked is shown in the Inbox: approvals (not enough approvers), window, clock, role, approved (you already approved), emergency, or unavailable (policies cannot be read, so nothing can be approved or run).

To save: Review changes, enter the required Reason, then Save policies. Policies are versioned with optimistic locking ("Someone else changed the policies meanwhile...").

What policies do not cover

Policies apply to proposals. They do not cover "values that people with write rights write directly, values written by rules, or the runtime's own REST and MQTT write interfaces." Limit those with roles, safe write and network controls.

Safe write per tag​

Safe write adds limits and read-back to a tag. Open the tag's device form and choose its Safe write dialog (titled Safe write: <tag>). It saves immediately, separate from the device form, and the device is not reconnected.

Field (UI)Meaning
Lowest value / Highest valueAllowed range (min, max).
Largest step from the current valuemaxStep.
Tolerance when reading backtolerance.
Newest reading at most this old (ms)maxAgeMs, 1 ms to 10 min. Default: the larger of 3 times the poll interval and 2 s.
Request at most this old (ms)maxRequestAgeMs, up to 24 h. Default 5 min.
Wait before reading back (ms)verifyDelayMs, up to 10 s.
Read back within (ms)verifyWindowMs, up to 10 s.
Only if the value is still what the person sawrequireExpected.
Cannot be read back (write-only)writeOnly.
Pulse: the value returns by itselfpulse.
Value after the pulse (empty: 0 or false)pulseRest.

Buttons: Save limits and Remove limits ("Without limits, writes and rules go out plainly").

  • Supported types: bool, integer types (8 to 64 bit, signed and unsigned), float and double. Strings, bytes and arrays are not supported. Scaled tags are refused ("Safe write refuses scaled tags").
  • min must not exceed max. writeOnly cannot be combined with maxStep, requireExpected or pulse. pulse needs a bool or integer tag. Unknown keys are errors.
  • Setting limits needs the rights to write tags and to configure devices; changing or removing limits is administrator only.
  • An AI assistant may propose writes to a tag only when the lowest and highest value are set.

What the runtime does on every write​

Once per write, never retried: check the policy and value type, check limits, check request freshness, check holds, read the value before (it must be good quality and fresh), compare with the value the approver saw, check maxStep and pulse state, journal "begin", write once, wait, read back and compare.

OutcomeUI text
applied_verifiedwritten and read back
applied_unverifiedwritten, not read back
mismatchreads back differently
unknownunclear whether it was written
rejectednot written

Reject reasons: out_of_limits, step_too_large, read_bad, read_stale, expected_required, changed_since_approval, request_expired, pulse_active, held, request_id_reused, journal_unavailable, policy_required, scaled_tag, unsupported_type, bad_value.

Runtime mode: MI_SAFE_WRITE​

Set on the Site Runtime (with an optional MI_SAFE_WRITE_JOURNAL):

ValueBehaviour
off (default)Writes to tags that have limits are refused. Rules still write plainly, without limits.
tagSafe write is on for tags with limits. Other tags are written plainly.
requiredTags without limits are not written.

An unknown value is treated as required. Older runtimes report "unsupported".

Write holds (tab Held tags)​

  • After an unknown outcome a tag takes no writes.
  • After a mismatch a tag takes no writes from rules.
  • The hold lasts until a person has looked at the device and released it.

The Held tags tab lists Device, Tag, Site Runtime, After and Since. Release asks "What did you find? (required)". Releasing writes nothing and needs both write_tags and configure_devices.

MCP proposals and deciding over MCP​

Assistants propose with mii_act_propose_write_tag, mii_act_propose_ack_alarms and the mii_build_propose_* tools (see MCP server). The proposals land in the same Inbox. Per credential, at most 10 proposals per minute.

If you set MI_MCP_ALLOW_HITL_EXECUTE=true on the Console, the tools mii_act_approve, mii_act_reject and mii_act_execute become available over MCP, for people only, never for agent credentials. The default is false.

Audit​

The Audit trail tab (GET /api/v2/act/audit) records propose, approve, reject, execute and fail for every proposal: who, when and what. The general audit trail records the resulting write too.

REST​

Method and pathPurpose
GET /api/v2/act/proposals, GET /api/v2/act/proposals/{id}List and read.
POST /api/v2/act/proposals/{id}/approve, reject, execute, resolve, emergencyDecide, run, record what happened, emergency override.
GET /api/v2/act/auditProposal audit.
GET /api/v2/act/policies, PUT /api/v2/act/policiesPolicies.
GET /api/v2/write-queue, POST /api/v2/write-queueQueued writes; release a hold with {"kind": "release_hold", ...}.

Troubleshooting​

SymptomCauseFix
You cannot approveYou proposed it, or your role lacks a capability.Ask someone else with the right role.
"Blocked: window"A time window in the policy.Wait for the window, or use an emergency override if the policy allows it.
Write rejected with changed_since_approvalThe value changed after approval.Propose again and approve with the new value.
Write rejected with heldThe tag has a hold.Check the device, then release in Held tags.
Assistant cannot propose a writeThe tag has no min and max.Set limits in the Safe write dialog.
Proposal expired24 hours passed.Ask the assistant to propose again.