MCP Mode Policy & Confirmation Rules

Defines how the three interaction modes (Ask, Plan, Execute) govern tool availability, mutation safety, and confirmation flows in the AMOF MCP server.

Mode Definitions

Ask Mode

PropertyValue
PurposeRead-only inspection, explanation, comparison, suggestion
MutationsForbidden. All write operations return an error with guidance to switch mode.
CLI equivalentRunning amof status, amof release status, amof ticket list

Plan Mode

PropertyValue
PurposeGather state, propose multi-step plans, preview impact, no actual mutations
MutationsForbidden (actual). All mutating tools run in dry_run=True / preview mode.
CLI equivalentRunning commands with --dry-run flag

Execute Mode

PropertyValue
PurposePerform actual mutations with appropriate confirmation gates
MutationsAllowed. Confirmation required for dangerous-write tools.
CLI equivalentRunning commands without --dry-run, with -y or --force after user confirms

Mode Lifecycle

1. Explicit per-tool parameter    (highest priority)
2. Session-level mode state       (set by amof_set_mode tool)
3. Default mode                   (ask)
ask ──────► plan ──────► execute
 ▲            │              │
 └────────────┴──────────────┘
       (any direction allowed)

Confirmation Protocol

Confirmation Types

TypeUX PatternWhen Used
noneTool executes immediatelyread-only and safe-write tools
simple"Proceed with X? [Yes/No]"Moderate-risk: push, archive, install
preview-then-confirmTool returns preview, then asks "Execute?"High-risk: release bump, promote
type-to-confirmUser types resource name to confirmCritical: discard, spin destroy

Two-Phase Confirmation Flow

Phase 1: Tool call → returns confirmation request (no mutation)
Phase 2: Client confirms → tool executes the mutation

Each confirmation request generates a UUID token that is single-use, expires after 5 minutes, and ties to the exact preview state.

Classification Matrix

#ToolSafetyAskPlanExecuteConfirm
1amof_list_ecosystemsread-onlyyesyesyesnone
2amof_get_server_statusread-onlyyesyesyesnone
8amof_install_ecosystemdangerousexplaindry-runexecutesimple
10amof_push_ecosystemdangerousexplaindry-runexecutesimple
11amof_spin_deploydangerousexplaindry-runexecutepreview
12amof_spin_destroydangerousexplaindry-runexecutetype
20amof_discard_ecosystemdangerousexplaindry-runexecutetype
26amof_release_bumpdangerousexplaindry-runexecutepreview
27amof_release_promotedangerousexplaindry-runexecutepreview

Same Intent, Three Modes

"Deploy this ecosystem"

Ask mode: Returns a description of what would happen, current state, and guidance to switch mode.

Plan mode: Runs dry-run, returns preview with provisioner, script, estimated duration, and execute hint.

Execute mode: After confirmation, queues the deployment and returns run_id for tracking.

"Discard this ecosystem"

Ask mode: Explains the irreversible action, lists what would be deleted, suggests archiving first.

Plan mode: Returns preview of branches and directories that would be deleted.

Execute mode: Type-to-confirm -- user must type the ecosystem name to proceed.