Let an agent ask questions
Pause an agent task for a human answer and continue the saved conversation.
Interactive task or approval gate?
Section titled “Interactive task or approval gate?”Use an interactive task when the agent needs to ask a person for information before continuing. Use an approval task when your workflow needs permission to proceed. These two pauses have different inputs and resume rules.
| Interactive task | Approval gate | |
|---|---|---|
| Question | Written by the agent, adapted to earlier answers | The fixed prompt of the gate |
| Answer | Free text, or one of the agent’s choices | approve or reject |
| What it continues | The agent’s conversation, in a new turn | The tasks that depend on the gate |
| Submitted with | start({ answers }) | start({ decisions }) |
| Signed proofs | No | Optional, with authentication: "signed" |
| Definition | defineInteractiveAgentTask() | defineApprovalTask(), definePauseTask() |
Define the dialogue
Section titled “Define the dialogue”The task needs a checkpoint: it stores the questions and answers between processes.
It prints waiting-input and the agent’s first question. Outpost adds the question protocol to your brief, so the brief only describes the goal and the shape of the final JSON.
API reference: InteractiveAgentTaskOptions.
Codex, Claude Code, Copilot CLI, Kimi Code and the built-in harness are accepted. Antigravity, and a harness created with conversations: false, are rejected when the task is defined: see Conversations.
How the dialogue runs
Section titled “How the dialogue runs”Show the questions
Section titled “Show the questions”result.inputRequests lists every pending question. Independent interactive tasks can wait at the same time.
API reference: WorkflowInputRequest.
Accept an answer
Section titled “Accept an answer”Restart the same workflow with the same checkpoint and an answers entry per request.
start() runs the next turn and returns at the next question or once the task ends. Called without answers, it returns the pending questions without calling the model.
Outpost checks every answer before applying any. It rejects a stale requestId, an actor outside actors, another execution, a second answer for the same task and, when allowFreeText is false, a value outside choices.
Read the result
Section titled “Read the result”Read the completed dialogue with result.value(clarify).
API reference: InteractiveAgentResult.
result.usage adds up the attempts and tokens of every turn, repairs included. unwrap() throws while the run waits. In a workflow that also has gates, waiting-input wins over paused, and a failure or cancellation wins over both.
Keep the workspace
Section titled “Keep the workspace”Each turn opens a sandbox and closes it before the question is published. Files in the worktree carry over between turns, committed or not; the sandbox home and running processes do not.
Outpost never integrates, pushes or deletes the worktree. Review branch and merge it yourself (Repository and branch), then prune it with Retention and cleanup.
The repository, the worktree and the conversation store must stay at the same paths for the next process. A moved worktree fails with Interactive workspace moved; recover it explicitly, and a switched branch with Interactive workspace branch changed; recover it explicitly.
Recover after a crash
Section titled “Recover after a crash”A crash during a turn leaves the task incomplete, and the next start() refuses to replay it. Authorize the replay with checkpoint: { ...checkpoint, resume: "retry-incomplete" }.
The turn restarts from the last saved conversation and answer; a completed output is reused without calling the model. Partial effects of the interrupted turn may repeat. Durable runs covers replay and recovering the checkpoint’s ownership.
Write a custom interactive task
Section titled “Write a custom interactive task”defineTask() with interaction suspends any task on a question. defineInteractiveAgentTask() is built on it.
perform runs again from the start after each answer. Read interaction.state to skip finished work, and save(state) to record progress; both hold JSON only.
Limits
Section titled “Limits”- A question on the last of
maxTurnsfails the task instead of waiting. - Questions do not expire, and answers are not signed.
- Cancelling stops a running turn; a question already saved stays pending.
- Changing the agent, model, brief, repository, provider, actors or
maxTurnsmakes the saved checkpoint incompatible: start a newrunId.
A complete scenario with an approval, red tests and reviewed code: Build a development workflow.
API: defineInteractiveAgentTask · InteractiveAgentTaskOptions · InteractiveAgentResult · WorkflowInputRequest · WorkflowAnswer · TaskInteractionContext