Make “ask a human” a structured output like any other tool, and the agent stops being something a person sits in front of. This is factor 7 of 12-Factor Agents, and it’s the one idea in that document with no prior equivalent in this vault.

The mechanic

By default an LLM API forces a high-stakes choice on the first token of every turn: plain text to the user, or structured data for a tool. Horthy’s suggestion is to remove the choice — have the model always emit JSON, and let it declare intent in natural language:

class RequestHumanInput:
  intent: "request_human_input"
  question: str
  context: str
  options: Options   # urgency: low|medium|high, format: free_text|yes_no|multiple_choice, choices: [...]

In the loop, this intent breaks execution rather than executing anything:

if next_step.intent == 'request_human_input':
  thread.events.append({type: 'human_input_requested', data: next_step})
  thread_id = await save_state(thread)
  await notify_human(next_step, thread_id)
  return   # break the loop; a webhook resumes us later

The human answers through Slack, email, or SMS. A webhook loads the thread by id, appends a response_from_human event, and the loop continues from exactly where it stopped. done_for_now is the same shape: even “I’m finished, here’s the answer” is a tool call.

The thread then reads as one continuous record:

<slack_message>   From: @alex   Text: Can you deploy backend v1.2.3 to production? </slack_message>
<request_human_input>  question: "Proceed with deploying v1.2.3 to production?"  urgency: high  format: yes_no </request_human_input>
<human_response>  response: "yes please proceed"  approved: true  user: alex@company.com  timestamp: ... </human_response>
<deploy_backend>  tag: v1.2.3  environment: production </deploy_backend>
<deploy_backend_result>  status: success </deploy_backend_result>

Note what that log is: an audit trail with the approver, the question asked, and the action taken, in causal order. You did not build it. It’s a side effect of treating the thread as the state.

Why it isn’t just ergonomics: inner loop vs outer loop

The real consequence is a reversal of who initiates.

Inner loopOuter loop
Control flow startsHuman → AgentAgent → Human
TriggerSomeone typing in a chat windowCron, webhook, alert, event, another agent
Human’s roleDriverApprover, unblocker, escalation target
Human’s attentionHeld for the whole runRequested at specific moments

ChatGPT-shaped products are all inner loop. The agent can only act while a person is watching it. Once “contact a human” is a durable tool call, the agent can be started by an outage at 3am, work for ninety minutes, hit a decision it shouldn’t make alone, page someone, and sit patiently until an answer arrives.

This is the missing half of Loop Engineering. Osmani’s loops answer “who prompts the agent when I’m not there.” Factor 7 answers “what does the agent do when it needs me and I’m not there.” A loop without it must either restrict itself to safe operations or run unsupervised on unsafe ones.

The precondition

This only works if you can pause between tool selection and tool invocation and persist. Approval that happens after deploy_backend already ran is not approval. See the “gap that actually matters” section of Agent State and Resumability.

Concretely, it requires:

  1. Factor 5 — state is a serializable thread, so pausing is just saving.
  2. Factor 6 — a resume API a webhook can call without knowing your orchestrator.
  3. Factor 8 — you own the control flow, so certain intents can break the loop instead of dispatching.
  4. Factor 11 — a channel the human already lives in, otherwise the request waits in a dashboard nobody opens.

Miss any one and this degrades into a blocking prompt in a terminal.

The safety trade this buys

The usual framing is that human-in-the-loop limits what an agent can do. Horthy’s is the opposite: being able to loop in a human quickly is what lets you widen the agent’s permissions. If a high-stakes action reliably routes to an approver in Slack within seconds, you can give the agent external email, production data writes, and deployments — things you would never grant an agent that can only ask by stopping and waiting for someone to notice.

That’s the same trade as the tiering in Agentic Code Review (blast radius decides the gate) and the delegated-approval pattern in Five Patterns for Long-Running Agents in Production, but pushed down into the agent’s own tool schema rather than sitting in the surrounding process.

What the vault already had, and where it fell short

The gap was consistent: the vault treated human involvement as a process wrapped around the agent. Factor 7 makes it a capability inside the agent.

Multi-agent extension

The same abstraction covers Agent → Agent. A subagent that needs a decision from an orchestrator emits the same event type and pauses; the orchestrator answers on the same channel. Nothing about the mechanism assumes the responder is human — which is why Multi-Agent Systems and this page share a shape.