Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

AEnvironment

| Documentation | WeChat Group QR CodeWeChat (微信) Group |

Everything as Environment — A Production-Grade Environment Platform for Agentic RL and Agent

AEnvironment Architecture

LicensePyPIPython


📰 News

  • Deploy Skill (Feb 2026) - 🎉 New Claude Code Skill for automated deployment! Deploy instances and services directly from Claude Code with support for three workflows: local build, existing image, and registered environments. Get Started
  • v0.1.4 (Jan 2026) - AEnv CLI now supports instance and service management! Deploy and manage your agents and applications with simple commands. See CLI Guide for details.

About AEnvironment

AEnvironment is a unified environment platform for the Agentic RL era, built on the core philosophy of "Everything as Environment". By extending standardized MCP protocol, AEnvironment provides out-of-the-box infrastructure for environment providers, algorithm developers, and agent developers, allowing them to focus on agent capabilities rather than the tedious details of environment setup.

Within Ant Group, AEnvironment serves as a key environment layer technology, deeply integrated with the AReaL reinforcement learning framework, supporting large-scale Agentic RL training and agent service deployment.

Core Philosophy: Everything as Environment

AEnvironment abstracts everything as an environment—from simple tool functions to complex multi-agent systems, all accessible through a unified Environment interface. This unified abstraction enables capabilities to be registered, combined, and replaced like building blocks, seamlessly converging Benchmark integration, RL training, and agent deployment on the same infrastructure.

Key Features

🔧 Built-in Benchmarks, Zero-Cost Integration - Ready-to-use benchmark environments with no complex configuration. Currently supported: TAU2-Bench, SWE-Bench, and Terminal-Bench.

🚀 Seamless Agentic RL Training Integration - With native MCP support and OpenAI Agent SDK compatibility, you can focus on agent logic and seamlessly integrate into RL training workflows.

🤖 Agent as Environment - Treat agents as environments, enabling multi-agent orchestration. Compatible with mainstream agent frameworks including OpenAI Agents SDK.

⚡ Rapid Development to Production - Define tools, build, and deploy in seconds. AEnvironment provides a unified, low-threshold environment API abstraction, making environments no longer a bottleneck in the training pipeline.

Use Cases

Mini Program IDE

Build AI-powered mini-program generation systems where agents leverage AEnvironment as the standard environment infrastructure. The Mini Program example demonstrates:

  • AEnvironment as Infrastructure: Agents utilize AEnvironment as the standardized environment infrastructure, providing consistent tooling and runtime capabilities
  • AI Agent Integration: Multi-turn conversations powered by OpenAI API
  • MCP Tools: File operations, code execution, and validation tools
  • Live Preview: Real-time preview of generated applications
# The agent uses AEnvironment tools to create web applicationsasyncwithEnvironment("mini-program@1.0.0") asenv:
# Agent can use tools like read_file, write_file, execute_python_coderesult=awaitenv.call_tool("write_file", {
"path": "index.html",
"content": "<html>...</html>"
})
Mini.Program.Demo.mp4

📖 See Mini Program Example for details.

TAU2 RL Training

Train reinforcement learning agents with AReaL framework using TAU2 tasks. The TAU2 RL example shows:

  • RL Integration: Seamless integration with AReaL for agentic RL training
  • Reward Function: Environment exposes reward functions for RL training
  • Episode Runner: Turn-by-turn agent execution with automatic tool invocation
  • Scalable Training: Support for large-scale distributed RL training
# Entrypoint for AReaL trainingfromaenv.examples.tau2_rl.agentimportrun_agent_return_reward# Run a single episode and return rewardreward=awaitrun_agent_return_reward({
"domain": "telecom",
"task_id": "task_123"
})

📖 See TAU2 RL Example for details.

Agent as Environment

AEnvironment uniquely supports treating agents themselves as environments. This feature makes multi-agent orchestration, hierarchical agent systems, and agent adversarial testing possible.

With Agent as Environment, you can:

  • Compose Agents: Treat agents as reusable components that can be called like tools
  • Multi-Agent Orchestration: Build complex workflows where agents interact with each other
  • Hierarchical Systems: Create nested agent structures for complex problem-solving
# Agent A calls Agent B as an environmentasyncwithEnvironment("agent-b@1.0.0") asagent_b:
# List available tools from Agent Btools=awaitagent_b.list_tools()
# Call Agent B's chat toolresponse=awaitagent_b.call_tool("chat", {"message": "Hello!"})
print(response.content)

This design enables agents to be composed and orchestrated like environments, supporting complex multi-agent scenarios where agents can interact with each other through the same unified interface.

🎯 Built-in Environments

AEnvironment comes with several built-in environments ready to use:

EnvironmentDescriptionExample
TAU2This environment supports RL experiments with TAU2 benchmarktau2 / tau2_rl
Mini TerminalLightweight terminal environment with bash command execution supportmini-terminal
TerminalBenchSupports running Terminal Bench evaluationterminalbench

📖 See Built-in Environments for more details.

Quick Start

📖 For detailed setup instructions, see the Quick Start Guide.

Deploy Skill

The easiest way to deploy AEnvironment instances and services is using our Claude Code Skill. This skill provides automated deployment workflows with full support for instance and service management.

Install Deploy Skill

# Install from GitHub releases
curl -L https://github.com/inclusionAI/AEnvironment/releases/latest/download/aenvironment-deploy.skill -o aenvironment-deploy.skill
claude skill install aenvironment-deploy.skill

Use Deploy Skill

Once installed, you can deploy directly from Claude Code:

Deploy an existing environment:

# Simply ask Claude Code:# "Deploy game-2048@1.0.6 as an instance with 1 hour TTL"# "Deploy myapp@2.0.0 as a service with storage enabled"

Supported workflows:

  • Workflow A: Build Docker image locally and deploy
  • Workflow B: Register existing Docker image and deploy
  • Workflow C: Deploy already registered environments (simplest)

Deployment types:

  • Instance: Temporary environment with IP access (for agents, testing)
  • Service: Persistent service with domain access and optional storage (for production apps)

The skill automatically handles:

  • ✅ CLI configuration and validation
  • ✅ Environment registration
  • ✅ Instance/service creation
  • ✅ Environment variable injection
  • ✅ Resource management (list, update, delete)
  • ✅ Error handling and retry

📖 See the Deploy Skill Guide for detailed documentation.

Install SDK and init Environment

# Install SDK
pip install aenvironment
# Initialize a new environment project
aenv init my-env

Define Tools, Functions, and Rewards

fromaenvimportregister_tool, register_function, register_reward# Register a tool@register_tooldefsearch_code(query: str, path: str=".") ->dict:
"""Search for code patterns in files."""# Implementationreturn {"matches": [...]}
# Register a function (for internal use within environment)@register_functiondefcalculate_sum(a: int, b: int) ->int:
"""Calculate the sum of two numbers."""returna+b# Register a reward function (for RL training)@register_rewarddefevaluate_task_completion(status: dict) ->float:
"""Evaluate task completion and return reward."""ifstatus.get("completed"):
return1.0return0.0

Test the Environment

Run your environment locally to test tools:

# Start the MCP server within your project dir
aenv run

This will start an MCP server that exposes your tools for testing and development.

Build and push Environment

# Build and push
aenv build && aenv push

Use Environment

importasynciofromaenvimportEnvironmentasyncdefmain():
asyncwithEnvironment("swe-env") asenv:
# List available toolstools=awaitenv.list_tools()
# Call a toolresult=awaitenv.call_tool("search_code", {"query": "def main"})
print(result.content)
# Call a function (for internal use within environment)func_result=awaitenv.call_function("calculate_sum", {"a": 10, "b": 20})
print(f"Function result: {func_result}")
# Call a reward function (for RL training)reward=awaitenv.call_reward({"status": {"completed": True}})
print(f"Reward: {reward}")
asyncio.run(main())

Performance

We compared performance with other popular sandbox engines for the same simple demo:

image

1 Kubernetes is the currently supported engine in AEnvironment.

2 ASandbox is a high-performance engine planned for open-source release in the future.

📖 Resources

🤝 Contributing

We warmly welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or helping others, your contribution is valued.

# Fork and clone the repository
git clone https://github.com/YOUR-USERNAME/AEnvironment.git
cd AEnvironment
# Install in development modecd aenv
pip install -e ".[dev]"# Set up pre-commit hooks for automatic formatting
pip install pre-commit
pre-commit install
# Make changes
git checkout -b feat/your-feature
git add .# `git commit` will automatically format your file
git commit -m "Add your feature"
git push

Please check our Contributing Guide for detailed information.

💬 Community & Support

  • GitHub Discussions - Ask questions, share ideas, and connect with the community
  • WeChat Group - Join our WeChat community (微信群)

License

Apache License 2.0 - see LICENSE for details.

About

Standardized environment infrastructure for Agentic AI development.

Topics

Resources

Contributing

Stars

314 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages