Change a setpoint with approval
What you build
A controlled change of the Filler SpeedSetpoint, the writable register 1!40020, from 120 to 100 bottles per minute. Nobody writes to the machine directly. A value is proposed, a second person approves it, it is executed with limits and a read-back check, and every step is audited.
Time: about 45 minutes.
- You finished Your first pipeline. The simulator
demo-simruns; it accepts writes to40020and moves the Filler speed with the setpoint. - Two people (or two accounts): an admin who prepares the tag, and a second user who approves. Use a role with the right to write tags, for example
senior_operator. - Safe write turned on in the runtime (step 3).
- This tutorial uses an agent credential or a JSON call to make the proposal. If you want the assistant version, read Claude with MCP first.
Why this order
| Layer | What it does |
|---|---|
| Write attribute | A tag can only be written if its attribute includes Write. |
| Safe-write limits | Lowest and highest value, largest step, read-back check. An assistant may only propose a write to a tag whose lowest and highest value are set. |
| Propose | A proposal changes nothing. It waits 24 hours for a person. |
| Approve | Another person decides. The proposer can never approve their own proposal. |
| Execute | The runtime checks the policy, reads the value first, writes once, waits and reads back. It never retries. |
| Audit | Propose, approve, execute and the write itself are recorded. |
Step by step
1. Make SpeedSetpoint a writable tag
-
Open Connectivity → Devices and edit
line1-modbus(row action Edit). Open Groups & tags and the group fast. -
Click Add tag:
Field Value Name SpeedSetpointAttribute Read and Write (tick both pills) Type UINT16 Address 1!40020Unit bottles/min -
Leave Decimal empty. A scaled tag cannot use safe write.
-
Click Save. The new tag is bound to the Filler.
-
Check the value in Plant → Plant graph, node Filler:
SpeedSetpointis 120.

2. Set the safe-write limits
Only an administrator may change limits. The setting is saved at once and the device is not reconnected.
-
In the tag list click the shield icon (Safe write) on the row
SpeedSetpoint. The dialog "Safe write: SpeedSetpoint" opens. -
Fill:
Field Value Meaning Lowest value 60Below this, the write is refused ( out_of_limits).Highest value 140Above this, refused. Largest step from the current value 30A jump from 120 to 60 is refused ( step_too_large).Tolerance when reading back 0The device must report exactly the value. Only if the value is still what the person saw on If someone changed the setpoint after the approver looked, nothing is written. -
Leave the timing fields at their defaults.
-
Click Save limits.
Without limits "writes and rules go out plainly" and an assistant cannot propose a write to this tag.
3. Turn safe write on in the runtime
The runtime decides how safe write behaves with the environment variable MI_SAFE_WRITE:
| Value | Effect |
|---|---|
off (default) | Writes to tags with limits are refused. Rules still write plainly. |
tag | Safe write applies to tags with limits. Other tags are written plainly. |
required | Tags without limits are not written at all. |
For this tutorial set MI_SAFE_WRITE=tag in the environment of the Lite process. Optionally set MI_SAFE_WRITE_JOURNAL to a file path for the runtime journal.
- Linux
- Windows
- Docker
sudo systemctl edit makeintelligent
Add, then save:
[Service]
Environment=MI_SAFE_WRITE=tag
sudo systemctl restart makeintelligent
setx /M MI_SAFE_WRITE tag
Restart-Service MakeIntelligent
Add -e MI_SAFE_WRITE=tag to the docker run command and recreate the container. The volume mii-data keeps your data.
The Lite components inherit the environment of the service. Set the variable in the service environment as shown, not in config/mii.env, which is documented for ports, admin name, log level and the public data listeners only.
An older runtime that does not know safe write reports "unsupported".
4. Create the second person and the proposer
- Open Settings → Users (admin) and click Add user. Username
shift-lead, a password of at least 12 characters, rolesenior_operator. This person approves and runs. The role carries the right to write tags (write_tags). - Open Settings → AI connections. Under "Credentials" fill Name
Setpoint assistantand choose the Access ceiling Engineer (read + propose changes and tag writes). Click Create credential. - Copy the secret (
mii_ac_…) with Copy secret. It is shown once and not stored. Click I have saved it.
The credential can read and propose. It cannot approve, reject or execute. The server answers such a try with 403 "agent credentials can only propose; a person must approve and execute".

5. Propose the change
Use an assistant (see Claude with MCP) or the JSON calls below. The calls are the same as the assistant makes.
Set two shell variables:
export URL=https://<console>/api/v2/mcp
export H="Authorization: Bearer $MII_MCP_TOKEN" # the mii_ac_... secret
5.1 Find the tag. mii_find turns a name into ids:
curl -s -H "$H" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' "$URL" -d '{
"jsonrpc":"2.0","id":1,"method":"tools/call",
"params":{"name":"mii_find","arguments":{"query":"Filler SpeedSetpoint","kind":"tag"}}}'
If the answer is needs_clarification, choose the candidate that is the Filler tag. Note the tagId and the deviceId (mii_see_describe shows the device of a tag).
5.2 Read the current value.
curl -s -H "$H" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' "$URL" -d '{
"jsonrpc":"2.0","id":2,"method":"tools/call",
"params":{"name":"mii_see_read","arguments":{"tagIds":["<tagId>"]}}}'
You should get value 120, quality good.
5.3 Propose the write.
curl -s -H "$H" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' "$URL" -d '{
"jsonrpc":"2.0","id":3,"method":"tools/call",
"params":{"name":"mii_act_propose_write_tag","arguments":{
"deviceId":"<deviceId>","tagId":"<tagId>","value":100,
"reason":"Label roll is nearly empty; slow the Filler to 100 bottles/min until the roll is changed."}}}'
The result is a pending proposal with an id. Nothing was written. Check:
curl -s -H "$H" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' "$URL" -d '{
"jsonrpc":"2.0","id":4,"method":"tools/call",
"params":{"name":"mii_act_proposal_get","arguments":{"id":"<proposalId>"}}}'
The status is pending. The simulator still reports SpeedSetpoint = 120.
6. Review and approve as the second person
-
Sign out and sign in as
shift-lead. -
Open Administration → Approvals. The tab Inbox shows the proposal with the status Waiting and the source "AI assistant (MCP)".
-
Open it and check the details:
Item What you should see Device, Tag, Address, Type line1-modbus,SpeedSetpoint,1!40020, UINT16Now 120, quality good, a few seconds old Requested 100 Limits 60 to 140, largest step 30 Reason "Reason given by the proposer (not verified)" followed by the text -
Click Approve and confirm with Approve and run. The note "The value you see now goes with the approval. If it changed, a tag with limits is not written." tells you why you should look at the current value first.
If you may approve but not run, the button reads Approve and a person with the right permission uses Run now later.

If you made the proposal with your own access, the Console says "Proposed with your own access: someone else must decide." That is the two-person rule. Sign in as the second user.
7. Check the execution
- The proposal moves to Running and then Done. The Result shows the write outcome: written and read back (
applied_verified). - In Plant → Plant graph, node Filler:
SpeedSetpointis 100. - Open Monitoring → Trends with
SpeedSetpointandSpeed. After a few seconds the speed falls from about 115 to about 90 to 98 bottles per minute.
Possible outcomes:
| Outcome | Meaning | What to do |
|---|---|---|
applied_verified | Written and read back. | Nothing. |
applied_unverified | Written, not read back. | Check the value by hand. |
mismatch | The device accepted the write but reads back something else. | Look at the machine. A proposal to restore the old value is created and another person must approve it. |
unknown | Unclear whether it was written. The tag is held. | Check the device, then use Record what happened and release the hold under the tab Held tags. |
rejected / "Refused" | Not written. Reason such as out_of_limits or changed_since_approval. | Fix the cause and propose again. |
8. Try the guard rails
Propose 200 the same way as in step 5.3. After approval the outcome is Refused with out_of_limits, "Nothing was written." Propose 50: out_of_limits again. Propose 60 from a current value of 120: refused with step_too_large. These tries show that an approved proposal still cannot break the limits.
9. Restore the setpoint
Propose 120 with the reason "Label roll changed." Approve and run it as shift-lead. The Filler returns to 110 to 120 bottles per minute.
10. Read the audit trail
- In Administration → Approvals open the tab Audit trail. You see the events propose, approve and execute with Time, User, Event, Proposal and Detail.
- As admin or auditor open Administration → Audit log. Filter Action to Write and Resource to Tag. The write row shows the value and the actor.
- Click Check integrity. The result "The audit log is intact." means the hash chain is unbroken.
- Ask for what the change did: the tool
mii_act_outcomereturns the evidence tags before and after.

Check it works
-
SpeedSetpointhas the attributes Read and Write and a safe-write limit of 60 to 140. - The proposal was Waiting and the simulator value was still 120 before approval.
- The approver was a different person from the proposer's owner.
- The status is Done and the Plant graph shows 100.
- The Filler
Speedfell to about 90 to 98 and came back after the restore. - A write of 200 was Refused with
out_of_limits. - The audit trail lists propose, approve and execute for each change.
Next steps
Approvals and safe write
Policies, emergency override, holds.
Writes
Every way a value reaches a device.
Audit trail
Hash chain, export, retention.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| The assistant says the write is not allowed to be proposed | The tag has no lowest and highest value. | Set the limits in step 2. |
| Proposal refused: "tag … is not writable; use attribute write" | The tag has only Read. | Tick Write in the tag. |
| The shield icon is missing | The device is not saved yet, the tag has no Write attribute, or the tag is scaled. | Save the device, tick Write, clear Decimal. |
| Safe write refuses every write | MI_SAFE_WRITE is off (default) and the tag has limits. | Step 3: set tag. |
| Approval says "You may look, but not decide." | Your role has none of the needed rights. | Use a role with write_tags, for example senior_operator. |
| "Proposed with your own access: someone else must decide." | Proposer and approver are the same person. | Sign in as the second user. |
| "This proposal has expired. It must be proposed again." | Proposals expire after 24 hours. | Propose again. |
Refused with changed_since_approval | The setpoint changed after the approver looked. | Propose again with the new current value. |
| Status Outcome unknown | The runtime did not report within 2 minutes. | Check the machine, then Record what happened. Nothing is written again. |
| The tag is held after an unknown or mismatch result | The hold protects the machine. | Look at the device, then release it under Held tags with a note. |
| 403 on execute from the assistant | Agent credentials can only propose. | A person approves and runs in Approvals. |