Managed Agents is a managed agent runtime provided by Bailian, suitable for long-running tasks such as multi-step tool calls, code execution, and file processing. The platform manages session state, sandbox environments, and tool execution. Agents autonomously execute commands, read/write files, install dependencies, and process data within isolated sandboxes; event history is persisted on the server.
Difference from Agent Applications
| Dimension | Agent Applications | Managed Agents |
|---|---|---|
| Execution Mode | Stateless invocation; context maintained on the application side | Session state maintained on the server side; supports interruption and resumption |
| Execution Environment | Shared runtime | Isolated sandbox — cloud-based container |
| Event Model | Response-level streaming output | Session-level SSE event stream; event history persisted |
| Typical Use Cases | Q&A, chat, lightweight tasks | Long-running tasks such as multi-step tool calls, code execution, and file processing |
Core Concepts
| Concept | Description |
|---|---|
| Agent | A configuration combining model, system prompt, tools, MCP services, and Skills. Once created, it is referenced by ID and can be reused across multiple sessions. |
| Environment | Sandbox configuration for session execution — a cloud-based container hosted by Bailian. |
| Session | A single execution instance of an agent within a specified environment, performing tasks and generating outputs. |
| Event | Messages exchanged between the application and the agent, including user messages, tool call results, and state changes. |
Supported Tools
Agents interact with the execution environment via the following tools:
- Command Execution: Run shell commands inside the sandbox
- File Operations: Upload files to mount into the sandbox or download from URLs; supports reading, writing, editing, finding, and searching
- MCP Services: Integrate external tooling services
- Skills: Mount preconfigured tool combinations that encapsulate end-to-end task workflows
Workflow
- Create an Agent: Configure model, system prompt, tools, and MCP services. After creation, reference it by ID.
- Configure the Execution Environment: Create a cloud-based container sandbox and optionally configure pre-installed packages.
- Initiate a Session: Create a session instance referencing both the agent and environment configuration.
- Send Events and Receive Responses: Send user messages; the agent autonomously executes tool calls and pushes results via an SSE event stream. Event history is persisted on the server.
- Intervene or Interrupt: Send new events during execution to guide direction, or interrupt the current task.
Use Cases
- Long-Running Tasks: Tasks involving multi-step tool calls lasting minutes to hours.
- Code Execution: Run scripts, install dependencies, and debug programs inside the sandbox.
- File Processing: Read, write, search, and edit files within the sandbox.
- Stateful Sessions: Maintain context and filesystem state across multiple interaction rounds.
- Rapid Development / Low Operational Overhead: Focus on agent logic instead of building and maintaining infrastructure like agent loops, sandbox orchestration, or tool execution systems from scratch.