Every category but read, memory and task is refused outright — the callback is not even consulted, since there is nothing to decide. The refusal names the mode and says the user will switch it to execute.
// What the model receives when it tries to write in plan mode
"Refused: plan mode is read-only. Present the plan; the user will switch mode to execute it."# What the model receives when it tries to write in plan mode
"Refused: plan mode is read-only. Present the plan; the user will switch mode to execute it."The instruction is the real feature
The system prompt tells the agent, in plan mode, to investigate and then present a clear plan with todo_write. So it spends its steps reading and reasoning instead of discovering one refusal at a time.
What it can still do
- Read, list, glob and grep the whole workspace.
- Search the web and open pages.
- Read connected storages with
query_storage. - Read its long-term notes, and search earlier sessions with
recall. - Delegate investigation to subagents —
taskis allowed, and its children are in plan mode too. - Write a plan with
todo_write.
The two-phase pattern
const agent = api.agents.create({
runtime: "local", machine: pc, model: "gemini-3.5-flash",
memory: true, // so the plan survives into the second phase
mode: "plan",
});
const plan = await agent.run({ inputs: "Migrate the date handling to UTC everywhere." });
console.log(plan.text, plan.todos);
// The person reads it and agrees
agent.setMode("auto");
await agent.run({ inputs: "Do it." });agent = api.agents.create(
runtime="local", machine=pc, model="gemini-3.5-flash",
memory=True, # so the plan survives into the second phase
mode="plan",
)
plan = agent.run(inputs="Migrate the date handling to UTC everywhere.")
print(plan["text"], plan["todos"])
# The person reads it and agrees
agent.set_mode("auto")
agent.run(inputs="Do it.")With memory: true the second run already holds everything the first one read, so the plan is executed without re-investigating.
Nothing is spent beyond the turns
money is refused like the rest, so a plan-mode run cannot buy space. Paid reads — a search, a page capture — are read and still happen, so a planning run is not free.