Skip to main content
Overview

Overview

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

DimensionAgent ApplicationsManaged Agents
Execution ModeStateless invocation; context maintained on the application sideSession state maintained on the server side; supports interruption and resumption
Execution EnvironmentShared runtimeIsolated sandbox — cloud-based container
Event ModelResponse-level streaming outputSession-level SSE event stream; event history persisted
Typical Use CasesQ&A, chat, lightweight tasksLong-running tasks such as multi-step tool calls, code execution, and file processing

Core Concepts

ConceptDescription
AgentA configuration combining model, system prompt, tools, MCP services, and Skills. Once created, it is referenced by ID and can be reused across multiple sessions.
EnvironmentSandbox configuration for session execution — a cloud-based container hosted by Bailian.
SessionA single execution instance of an agent within a specified environment, performing tasks and generating outputs.
EventMessages 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

  1. Create an Agent: Configure model, system prompt, tools, and MCP services. After creation, reference it by ID.
  2. Configure the Execution Environment: Create a cloud-based container sandbox and optionally configure pre-installed packages.
  3. Initiate a Session: Create a session instance referencing both the agent and environment configuration.
  4. 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.
  5. 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.

Next Steps