Safe automation validation
Preflight before any write
A safe change starts with an approved scope, a fresh baseline, known model and capabilities, authorized identity, independent management access, explicit rollback plan and a maintenance window where required. For our fictional R1 description change, the scope is one interface and one field, with expected revision 7. A real team would review the exact diff, validate schema and service dependencies, and save the baseline securely. If approval, freshness, target identity, permission or rollback evidence is missing, the mock gate blocks. A read-only audit can proceed only within its own authorized scope.
Transaction scope matters
With appropriate NETCONF capabilities, a candidate datastore permits staging before commit; confirmed commit can revert an unconfirmed change after its timeout. Check support for candidate, validation and confirmed commit individually and coordinate locking and persistence. A gNMI SetRequest is transactional on the target according to the specification; do not extend that guarantee to multiple requests or devices. RESTCONF and vendor APIs have their own operation semantics. If R1 accepts a change and R2 fails, a fleet-wide workflow must stop and reconcile partial results; it cannot assume all devices reverted. The mock exercise has one target and models recovery decisions only.
Postconditions are stronger than acknowledgements
Imagine R1 returns a successful response. Read the owned field again; its value must match uplink-core. Separately check management reachability, expected permitted service behavior, denied access behavior and critical operational health against the baseline. A description-only change should not alter interface state or routes, so unexpected service loss is a stop condition even if the description matches. Our table lists synthetic Boolean evidence, not actual pings or API calls. Treat missing evidence as failure to verify, not success. A confirmation decision must arrive before any applicable rollback deadline; a late response is not proof the change remains active.
Scenario | preflight | write | readback | service checks | decisionA | pass | known | match | pass | accept if within deadlineB | fail | none | n/a | n/a | blockC | pass | unknown | missing | unknown | stop and reconcileD | pass | known | match | fail | recover; verify baselineRecover without making the incident worse
If the preflight fails, make no change. If a response is uncertain, halt further writes and obtain readback. If a postcondition fails after a known write, stop rollout and invoke the previously reviewed recovery plan through an authorized path. Where a confirmed-commit mechanism is supported, it may revert automatically; verify the baseline afterward. Without such a mechanism, a reviewed inverse change can restore owned values, provided the revision and concurrent changes are checked. Do not restore an entire stale configuration over unrelated edits. In the mock gate, rollback failure or missing readback leads to escalation, not another blind write.
Keep a useful audit trail
Record target identity, model revision, approved change identifier, expected and observed values, timestamps, gate decisions and recovery result. Redact secrets and sensitive configuration in both normal output and errors; a diff can expose secrets even when no change is applied. Test negative cases, including stale revisions, missing evidence and a failed recovery. For the fictional change, acceptance requires the preflight and all postconditions plus a valid confirmation window if applicable. These local decisions are useful preparation for network-as-code CI, but do not validate device behavior, a real transaction, access control or an actual incident response.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Safe automation validation Quiz
Reason about management APIs, convergence and safe change validation.
Preflight lacks rollback evidence. What does the mock gate do?
Does one gNMI SetRequest transaction guarantee fleet-wide atomicity?
Readback matches but service checks fail. What next?
What does a confirmed commit timeout require you to check?
What if recovery fails and no safe readback is available?