AiAnyTool - Best AI Tools Directory and Artificial Intelligence Software Hub LogoAIAnyTool
Back to Agent Skills

AutoGen Local Code Execution

AutoGen Framework

Skill Description

Configures an AutoGen UserProxyAgent to execute Python code locally inside a Docker container or directly on the host machine. Essential for code generation and verification tasks.

Code / Definition File

skill_manifest.yaml / config.json
import autogen

# Config for code execution
code_executor_config = {
    "work_dir": "coding",
    "use_docker": True,  # Recommended for safety
}

user_proxy = autogen.UserProxyAgent(
    name="UserProxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
    code_execution_config=code_executor_config,
)

Tags

code-execution sandbox docker
Author: Microsoft AutoGen
Added on: 6/7/2026