-
Notifications
You must be signed in to change notification settings - Fork 1.5k
en usage sandbox readme
The sandbox gives the built-in Agent an isolated execution environment: run commands, read and write files, and host long-lived processes. Everyday Agent use cases (data processing, file operations, running user code, hosting stdio MCP) all rely on it.
Once the sandbox is enabled, the built-in Agent automatically gains six tools — no need to wire each one into the pipeline.
| Tool | Purpose |
|---|---|
exec |
Run shell commands inside the sandbox |
read |
Read workspace files |
write |
Create or overwrite files |
edit |
Modify files via string replacement |
glob |
Find files by glob pattern |
grep |
Search file contents by regex |
exec runs inside the sandbox container; the other five operate directly on the host directory mapped to /workspace.
Note
These tools target the built-in Agent. When using external runners such as Dify, n8n, Langflow, or Coze, use that platform's own tool mechanism.
The pipeline's AI configuration lets you choose how the sandbox is shared across messages. The default "per chat" works for most cases.
| Scope | Template | Shared across |
|---|---|---|
| Global | {global} |
All users share one sandbox |
| Per chat (default) | {launcher_type}_{launcher_id} |
Same group or DM shares one |
| Per user | {launcher_type}_{launcher_id}_{sender_id} |
Each member in a group is isolated |
| Per conversation | {launcher_type}_{launcher_id}_{conversation_id} |
Isolated by conversation |
| Per message | {query_id} |
Fully stateless |
Warning
Commands within the same scope share filesystem state. Choose "per message" for full isolation.
| Condition | Behavior |
|---|---|
| Idle for more than 5 minutes | Cleaned up automatically |
| Box-managed processes running (e.g. stdio MCP) | Kept alive until those processes exit |
persistent: true configured |
Never cleaned up automatically |
- Prepare the backend: install Docker locally, or pick Nsjail / E2B
-
Edit
config.yaml:box: enabled: true backend: 'local' local: host_root: './data/box'
- Start LangBot: the sandbox is enabled automatically
- In the pipeline, select the built-in Agent plus a model that supports function calling
The Agent will then automatically receive the six tools. See Sandbox Configuration for details.
Set box.enabled: false. Everything that depends on the sandbox (built-in tools, Skill create/edit/activate, stdio MCP) is disabled together; MCP servers in http/sse mode are unaffected.
- Sandbox Configuration — backends, security profiles, mounts, environment variables
- Runtimes & Extensions Compared — how the sandbox, Skills, MCP, and plugins divide responsibilities
Automatically synchronized from langbot-app/langbot-wiki.
简体中文
指南
开发者
- 插件开发
- 插件 SDK API
- 核心开发
API 参考
- Service API
English
Guides
Developers
-
Plugin Development
- Plugin Development Tutorial
- Completing Plugin Configuration Information
- Plugin Directory Structure
- Component Development
- Code Style Guide
- Migration Guide
- Publish Plugin
- Plugin SDK API
- Core Development
API Reference
- Service API