Zenaique

How does AutoGen UserProxyAgent `human_input_mode` change the loop?

MCQ·Medium·4.0 · 0·~1 min·Asked atKpmgRedisSourcegraph
Attempt it
TL;DR

NEVER runs fully autonomous, ALWAYS asks the human before every proxy reply, TERMINATE asks only when the loop is about to end so a human can extend it.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Picture a self-driving car with a driver in the seat. NEVER mode keeps the human asleep the whole trip, the car drives itself end to end. ALWAYS mode is a nervous driving instructor who grabs the wheel before every single turn. TERMINATE is the sensible middle ground: the car drives itself, but if it is about to stop at what looks like a dead end, it taps the human on the shoulder and asks whether to try a different route. The default is TERMINATE because most teams want autonomy with a safety net, not zero oversight and not a babysitter at every step.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

AutoGen's UserProxyAgent is the agent that represents the operator inside a multi-agent conversation. Whether that operator is a real human typing into a terminal, a Slack channel waiting for a callback, or a fully automated subprocess depends on one setting: human_input_mode.

The setting has only three legal values, but the operational implications of each ripple through autonomy, oversight, and unattended-deployment robustness. The interview question is rarely "name the values". It is "why does the default exist, what does it have nothing to do with, and how do you adapt it for a production deployment that has no stdin?"

The three values and their cadences

human_input_mode="NEVER" means the proxy never blocks to ask the human. Every reply the proxy produces comes from its autonomous machinery, executing code via code_execution_config, calling a registered function, or echoing back a templated response. This is the right mode for evaluation harnesses, batch jobs, and any scenario where human input would contaminate the run or stall it indefinitely.

human_input_mode="ALWAYS" means the proxy prompts the human before every single reply it would send. The autonomous machinery still runs, but the human gets to review, edit, or replace the proposed reply each turn. This makes the proxy a literal typing surface for the operator. It is the mode AutoGen Studio uses for its interactive playground, and it is the right mode whenever the proxy IS the human's chat UI.

human_input_mode="TERMINATE" is the middle ground and the default for most setups. The proxy runs autonomously until the conversation would otherwise end, either because max_consecutive_auto_reply was hit or because the is_termination_msg predicate fired, at which point the human is prompted once with a chance to keep the conversation going. One prompt, at the right moment, instead of zero or every-turn.

Why TERMINATE is the production default
What `human_input_mode` does NOT control
Operational gotchas in unattended deployment
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • AutoGen documentation ships a code-executor example that pairs `human_input_mode=NEVER` with a Docker `code_execution_config` for fully autonomous Python execution.
  • Microsoft's AutoGen Studio demos use `human_input_mode=ALWAYS` so the playground UI captures every operator turn through a web prompt.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you keep TERMINATE-mode semantics but route the human prompt to Slack instead of stdin?
A

Subclass UserProxyAgent and override get_human_input(self, prompt). Inside, post the prompt to Slack via the Bolt SDK, await a reply (with a timeout that auto-defaults to "continue" or "stop"), and return the reply string. The rest of the AutoGen loop stays unchanged.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Confusing `human_input_mode` with tool routing or termination conditions. It is purely about when the human is prompted, not about which tools run or what ends the chat.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The three valid values of the human input mode and the cadence each implies.

  • Why TERMINATE is the typical production default.

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Design a sensible migration…
Short answer·Hard