P5: Safe Retries and Explicit Mutation Boundaries

Definition

Every CLI MUST support --dry-run so agents can preview any command before committing it. Write operations MUST clearly separate destructive actions from read-only queries. An agent that cannot distinguish a safe read from a dangerous write will either avoid the tool or execute mutations blindly — both are failure modes.

Why Agents Need It

Agents retry failed operations by default. If a write operation is not idempotent, a retry creates duplicates, corrupts data, or trips rate limits. When destructive operations require explicit confirmation (--force, --yes) and support preview (--dry-run), an agent can safely explore what a command would do before committing to it. Read-only tools are inherently safe for retries, but they still benefit from help text that names the mutation contract — "this does not modify state" is a better sentence to put in --help than to assume.

Requirements

MUST:

SHOULD:

Evidence

Anti-Patterns

Measured by check IDs p5-dry-run, p5-destructive-guard. Run agentnative check --principle 5 . against your CLI to see each.