Managed Agents is Bailian's managed agent runtime for session state, sandbox environments, and tool execution.
Use Cases
Agents autonomously execute commands, read and write files, install dependencies, and process data within isolated sandboxes. Event history is persisted on the server.Sandboxes are reclaimed after the session becomes idle by default. To retain working files and environment changes across runs, enable sandbox persistence when creating a session.Long-running tasks and stateful sessions
Tasks involving multi-step tool calls can last minutes to hours, with context and filesystem state maintained across multiple interaction rounds.
Code execution and file processing
Run scripts, install dependencies, and debug programs inside the sandbox. Read, write, search, and edit files within the sandbox.
Rapid development and low operational overhead
Focus on agent logic instead of building and maintaining infrastructure like agent loops, sandbox orchestration, or tool execution systems from scratch.
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. |
| Memory Store | A persistent mounted resource that the agent reads and writes with file tools; its content persists across sessions. |
| Scheduled task | A resource that binds an agent to a trigger configuration — scheduled or manual — with each trigger producing a run record. |
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
- Memory: Mount memory stores and read/write working notes across sessions
- 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.
Next Steps
Configuration and API reference
- Configure agents: Configure models, prompts, and tools
- API overview and authentication: API overview, authentication, and available endpoints
- Manage memory stores: Keep an agent's working notes across sessions
- Configure scheduled tasks: Trigger agent runs on a schedule or manually
- Manage agents and sessions with the CLI: Manage agents and sessions from the terminal as infrastructure-as-code