Harness Engineering Practices
P17. Dry Run by Default and Blast Radius Preview
🎯 Point
"Restarting 40 pods" should be presented before execution, not discovered after. Preview side effects before they happen.
📝 Overview
Actions with side effects first show a preview of their effects (which files, which lines, which pods), then pass through a gate or human confirmation before execution. Default to dry run (show results without executing), and execute only after explicit approval.
🔍 Explanation
Knowing "what the agent will do" in advance is foundational to safety. Diff previews, lists of affected services, pod restart counts, message contents — presenting these before execution enables informed human judgment. In incident response especially, presenting remediation blast radius and rollback plans together, then executing with monitoring post-approval, is an effective pattern. Making dry run the default structurally eliminates "accidental execution" risks.
🛠 How to Practice
- Implement "preview mode" for all side-effecting operations, displaying impact scope before execution
- Include quantitative info in dry run output: number of affected files, pods, changed lines, etc.
- Make dry run mandatory for irreversible operations; keep it optional for reversible ones to maintain efficiency
- Record dry run vs. actual execution discrepancies and continuously improve dry run accuracy
💼 Use Cases
- Incident response: present blast radius and rollback plan for remediation actions upfront
- Pair programming: display agent edits as diff previews before applying
- Migration: canary-apply changes to a subset first and verify before full rollout
⚠ Pitfalls
Dry runs aren't always accurate — environmental differences can cause failures at execution time that didn't appear in dry run. If dry runs become reflexively skipped, they lose meaning. Combine with P15 (revocability): execute reversible operations without dry run, require dry run only for irreversible operations.
#
HarnessEngineering# #
AIAgent#