Skip to content

Plan Mode, approvals and undo

Plan Mode makes an external agent wait for you before it changes the editor. This page covers what it checks, what you can approve on this version, and which changes Ctrl+Z can take back.

Plan Mode

Plan Mode is the setting Review each external edit, under Settings, Editor safety in the Hayba MCP Toolkit tab. It is on by default in a new project.

It applies to every command that changes scene or asset state: anything that creates, adds, sets, deletes, removes, duplicates, imports or renames. It also covers python_run, actor_call_function, editor_run_console_command, editor_batch, editor_save_all_and_quit and editor_pie_click_actor. Reads, searches, validation and captures are never held.

When an external agent sends one of these commands while Plan Mode is on:

  1. The plugin does not run it. It freezes the exact command, its parameters and its target into a review card in the toolkit's Agent view, and replies plan_mode_required with a proposal id.
  2. You read the card and choose Approve operation, or reject it.
  3. The agent sends the same command again. It runs once. Any retry, even after a failure, needs a new card and a new approval.

An approval is tied to the exact parameters and to the target's state when the card was made. It is refused if the target changes before you approve, if the card is older than five minutes, if the agent disconnects, or if a lease named in the request has expired.

What can be approved

On this version, the exact review supports edits to one existing actor, named by actor_id:

The name must match exactly one actor. Every other held command is refused with exact_approval_unavailable while Plan Mode is on, because the plugin cannot yet freeze its target for review. That includes spawning actors, creating or editing assets (Blueprints, materials, widgets, PCG graphs), batches and python_run.

To build with an agent, turn Review each external edit off in a scratch project, ideally one under source control. The other checks stay on: leases, Play-In-Editor state, editor health and the save guards described in the safety model, and the approvals in the built-in chat.

The in-editor chat's Production mode asks for the same exact review on every write, even when the setting is off, so it has the same limits. Use Draft for creation work. See In-editor chat.

Written plans

An agent can show you a step-by-step plan with hayba_propose_plan and mark progress with hayba_mark_plan_step. The plan appears in the toolkit so you can follow along. It is context, not permission: approving a written plan does not let a held command through. Only the exact review above does.

A prompt that asks for a plan first:

Prompt
Before changing anything, propose a plan with hayba_propose_plan that lists each actor you will move and where. Wait for me to say go, then mark each step as you finish it.

Undo

Most commands that change the editor run inside an Unreal undo transaction named Hayba: <command>. Each one is a single entry in Edit, Undo History, and Ctrl+Z takes it back. This is separate from Plan Mode: it applies whether or not the command needed approval.

These are not recorded, so Ctrl+Z will not undo them:

Other python_run scripts run inside a transaction, but only changes to objects that record themselves for undo can be taken back. Treat Python changes as permanent.

Two asset types stage their edits until you commit them:

Use source control on any project an agent edits. Undo is a convenience, not a backup.