GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • anc.dev the agent-native standard
  • Leaderboards
  • Audit
  • Install
  • Skill
  • About
  • ◂ prevP4 · Fail Fast with Actionable Errors

This view

  • Original page
  • New address

GeezerVison is showing anc.dev — P5: Safe Retries and Explicit Mutation Boundaries

P5MUST

Safe Retries and Explicit Mutation Boundaries

Definition

Every CLI with write operations MUST support --dry-run so agents can preview a mutation before committing it. Commands MUST make the read-vs-write distinction visible from name and --help alone, and destructive writes MUST require explicit confirmation. 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

Agent harnesses commonly retry failed operations. 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.

Audited live by anc audit <tool> --principle 5: behavioral and source checks.

Requirements

MUST:

  • (Applies when: CLI has destructive operations.) Destructive operations (delete, overwrite, bulk modify) require an explicit confirmation flag. --yes and --force are the recommended names; a flag under another name satisfies the requirement when the command's --help documents it as the flag that confirms the operation without a prompt (terraform destroy -auto-approve). Without the flag, the tool refuses the operation or enters dry-run mode. It MUST NOT mutate silently.
  • (Applies when: CLI has both read and write operations.) The distinction between read and write commands is clear from the command name and help text alone. An agent reading --help immediately knows whether a command mutates state.
  • (Applies when: CLI has write operations.) A --dry-run flag is present on every write command. When set, the command validates inputs and reports what it would do without executing. Dry-run output respects --output json so agents can parse the preview programmatically.

SHOULD:

  • Write operations are idempotent where the domain allows it. Running the same command twice produces the same end state, not a doubled effect.

Evidence

  • --dry-run flag on commands that create, update, or delete resources.
  • A confirmation flag on destructive commands: --yes or --force, or a documented equivalent such as -auto-approve on terraform destroy.
  • Command names that signal intent: add, remove, delete, create for writes; list, show, get, search for reads.
  • Dry-run output that shows what would change without executing.

Anti-Patterns

  • A delete command that executes immediately without --force or confirmation.
  • Write commands sharing a name pattern with read commands (e.g., a sync that silently overwrites local state).
  • No --dry-run option on bulk operations, where a preview prevents costly mistakes.
  • Operations that fail on retry because the first attempt partially succeeded: non-idempotent writes without rollback.

Measured by audit IDs p5-force-yes, p5-read-write-distinction, p5-dry-run. Run anc audit --principle 5 . against the CLI under test to see each.

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.