AgentBox ClawHub
Provide reliable AgentBox guidance based on the bundled summary of the official documentation.
Response workflow
- 1. Identify whether the user is asking about:
- quickstart
- sandbox lifecycle or timeout
- commands execution
- filesystem read/write
- environment variables or secrets
- cli installation or authentication
- python sdk usage
- custom sandbox templates
- 2. Answer from
references/agentbox-official.md. - Keep CLI and Python SDK paths separate. Do not mix them unless the user asks for both.
- Prefer short, runnable examples.
- If the user asks for something not covered by the bundled reference, say it is not documented in this skill and recommend checking the latest official docs.
Core rules
- - Do not invent undocumented methods, flags, or endpoints.
- Treat
agentbox.cloud/docs as the source of truth for this skill. - State units explicitly when talking about timeout values: seconds.
- Mention the default sandbox lifetime when relevant: 5 minutes unless the timeout is customized.
- For secrets, prefer per-command or per-run scoped environment variables over global variables when the task is a one-off.
- When the user asks how to create a custom sandbox, explain the Dockerfile-based template flow first.
- When the user asks how to run code or shell inside AgentBox, show
Sandbox(...).commands.run(...) unless they specifically want another interface.
Common answer patterns
Quickstart
Use this structure:
- - what to install
- how to authenticate or set API key
- minimal example
- one common next step
Timeout or lifecycle
Use this structure:
- - default behavior
- how to set timeout at creation
- how to extend or reset timeout later with INLINECODE3
- how to inspect start and end time with INLINECODE4
Filesystem
Use this structure:
- - read single file with INLINECODE5
- write single file with INLINECODE6
- warn that write overwrites existing content
Environment variables
Use this structure:
- - global envs at sandbox creation
- scoped envs for INLINECODE7
- scoped envs for INLINECODE8
- recommend scoped envs for secrets
Template creation
Use this structure:
- - install CLI
- authenticate
- INLINECODE9
- edit INLINECODE10
- INLINECODE11
- start sandbox with the resulting template id
Ready-to-adapt snippets
Python SDK quickstart
CODEBLOCK0
Global environment variables
CODEBLOCK1
Scoped command environment variables
CODEBLOCK2
Resources
- - Official reference summary: INLINECODE12
- ClawHub publish notes: INLINECODE13
AgentBox ClawHub
基于官方文档的汇总摘要,提供可靠的AgentBox指导。
响应工作流程
- 1. 识别用户询问的内容是否涉及:
- 快速入门
- 沙箱生命周期或超时
- 命令执行
- 文件系统读写
- 环境变量或密钥
- CLI安装或认证
- Python SDK使用
- 自定义沙箱模板
- 2. 从references/agentbox-official.md中回答。
- 保持CLI和Python SDK路径分离。除非用户同时询问两者,否则不要混用。
- 优先提供简短、可运行的示例。
- 如果用户询问的内容不在附带的参考资料范围内,说明该技能未记录此内容,并建议查阅最新的官方文档。
核心规则
- - 不要编造未记录的方法、标志或端点。
- 将agentbox.cloud/docs视为本技能的权威来源。
- 在讨论超时值时明确说明单位:秒。
- 在相关情况下提及默认沙箱生命周期:5分钟(除非自定义超时)。
- 对于密钥,当任务是单次执行时,优先使用按命令或按运行作用域的环境变量,而非全局变量。
- 当用户询问如何创建自定义沙箱时,首先解释基于Dockerfile的模板流程。
- 当用户询问如何在AgentBox内运行代码或shell时,展示Sandbox(...).commands.run(...),除非他们明确要求其他接口。
常见回答模式
快速入门
使用以下结构:
- - 需要安装什么
- 如何认证或设置API密钥
- 最小示例
- 一个常见的下一步操作
超时或生命周期
使用以下结构:
- - 默认行为
- 如何在创建时设置超时
- 如何使用settimeout延长或重置超时
- 如何使用getinfo检查开始和结束时间
文件系统
使用以下结构:
- - 使用files.read读取单个文件
- 使用files.write写入单个文件
- 警告写入操作会覆盖现有内容
环境变量
使用以下结构:
- - 在沙箱创建时设置全局环境变量
- 为run_code设置作用域环境变量
- 为commands.run设置作用域环境变量
- 推荐对密钥使用作用域环境变量
模板创建
使用以下结构:
- - 安装CLI
- 认证
- agentbox template init
- 编辑agentbox.Dockerfile
- agentbox template build --platform linuxx86 -p YOURWORKPATH
- 使用生成的模板ID启动沙箱
可直接适配的代码片段
Python SDK快速入门
python
from agentbox import Sandbox
sandbox = Sandbox(
apikey=abxxxxxxxxxxxxxxxxxxxxxxxxx,
template=TEMPLATEID>,
timeout=120,
)
result = sandbox.commands.run(ls -l)
print(result.stdout)
全局环境变量
python
from agentbox import Sandbox
sandbox = Sandbox(
apikey=abxxxxxxxxxxxxxxxxxxxxxxxxx,
template=TEMPLATEID>,
timeout=60,
envs={MYVAR: myvalue},
)
result = sandbox.commands.run(echo $MY_VAR)
print(result.stdout)
作用域命令环境变量
python
result = sandbox.commands.run(
echo $MY_VAR,
envs={MY_VAR: 123},
)
资源
- - 官方参考摘要:references/agentbox-official.md
- ClawHub发布说明:README.md