Define the action
Describe the expected input, output and side effects. Separate read-only checks from actions that change a system.
Review before changing state
Use dry runs where possible and keep approval explicit for destructive operations. Treat external input as data, not as instructions.
Keep an audit trail
Record decisions and results without exposing secrets. Prefer small, reversible steps and stop when an unexpected condition appears.
A workflow with an approval gate
Consider a documentation publishing workflow. First, inspect the input and calculate checksums; next, produce a staging artifact. A human reviews the diff and approves the release. Only then does a narrowly scoped deployment step replace the public files. A separate health check verifies the result. The read-only phase does not need deployment privileges.
Design explicit stop conditions
If the checksum differs, the target path is unexpected or a post-deployment check fails, stop and retain the evidence. A failed operation is not permission to widen access or retry blindly. Record the expected result, observed result and remaining uncertainty. A rollback must restore a known version rather than guess which files changed.