framework: autogen runs via a single YAML flag β off by default so LLM-generated code never runs on your host without consent.
Quick Start
1
Simple opt-in (Docker on)
Set
code_execution: true β the wrapper defaults work_dir to coding and use_docker to True.2
Custom work_dir
Pass a dict to override the sandbox directory β
use_docker still defaults to True.3
Local execution (unsafe, dev only)
Setting
use_docker: false runs generated code directly on the host and logs a warning.How It Works
The wrapper resolvescode_execution into AutoGenβs code_execution_config before it builds the UserProxyAgent.
The user_proxy is constructed with the resolved code_execution_config and the resolved human_input_mode. When the LLM emits a code block, the user_proxy runs it in the sandbox path; when nothing is opted in, code_execution_config is False and no code runs.
Configuration Options
Every option lives underconfig.autogen.* in your team YAML.
Precedence Ladder
code_execution accepts a bool for the common case and a dict for overrides.
Failure Scenario
Whenuse_docker: false the wrapper emits this warning before running code on the host:
Best Practices
Opt in explicitly after upgrading
Opt in explicitly after upgrading
Runs that previously relied on the old implicit host execution now do nothing until you add
config.autogen.code_execution: true. Add it deliberately so the security posture is visible in the YAML.Use a dedicated work_dir
Use a dedicated work_dir
Point
work_dir at a disposable folder (e.g. sandbox) so generated files stay isolated and easy to clean up between runs.Choose human_input_mode for your loop
Choose human_input_mode for your loop
TERMINATE (the new default) lets an operator step in at the end of a turn. Use NEVER for fully automated runs or ALWAYS for interactive review.Related
AutoGen with PraisonAI
Run AutoGen v0.2 via the family router
Tool Timeouts
Give every tool call a hard deadline

