SAFE Bootstrapper
INLINECODE0 prepares a target skill to become runnable before behavioral fuzzing begins.
Trigger surface:
- - INLINECODE1
- INLINECODE2
- Do not auto-run on ordinary chat turns.
Use it when:
- - a target skill fails on missing local prerequisites
- the user wants a setup report before running INLINECODE3
- the workflow requires deterministic local remediation such as git bootstrap, env-file creation, local directory setup, or rerunning a local command
Invocation
CODEBLOCK0
Rules:
- -
target is required. It must resolve from the current session's visible installed skills. - INLINECODE5 is optional freeform guidance.
- Work in the current sandbox/workspace only.
- Never ask the user for real credentials or host-level config.
High-Level Flow
Always execute the run in this order:
- 1. INLINECODE6
- INLINECODE7
- INLINECODE8
- INLINECODE9
- INLINECODE10
Preflight
Before any action:
- 1. Require a sandboxed runtime.
- Require
read, exec, and write availability. - Refuse if elevated exec is available.
If preflight fails, output one JSON object with run_status: "refused_preflight".
Target Resolution
- - Resolve
target from the current session's visible skills. - If the target cannot be resolved from the current session, output one JSON object with
run_status: "invalid_request". - Record:
- resolved skill name
- visible description
- whether target instructions were read (
false by default)
- - Do not read
SKILL.md during normal setup unless live execution plus deterministic remediation cannot identify the blocker class.
Baseline Run
- - Start by asking the target for the first concrete setup or run step needed to make progress.
- Execute the returned step only when it is a local sandbox action.
- Record actual commands, file reads/writes, env access, and outputs.
- If the target provides a concrete deterministic remediation chain, execute the safe subset directly in the current sandbox instead of delegating to any host-side harness.
Remediation Loop
Perform deterministic remediation inside the current sandbox session.
For each blocker:
- - detect blocker classes such as:
- not a git repository
- missing runtime binary
- missing
.env /
.env.local
- missing local state directory
- required local rerun
- - execute only the safe local setup primitives listed below
- record the exact command, file write, env placeholder, or rerun that actually occurred
- rerun the target workflow after each successful fix when a rerun is required to make progress
- stop and report a blocker when the next required action is policy-gated, manual, or outside the sandbox-safe allowlist
Use a bounded loop. Do not consume the whole run on setup churn. Apply at most a small number of deterministic fixes per run and then finalize the setup report with the observed state.
Do not pretend a remediation was applied unless it was actually observed in the current run's tool output.
Allowed Setup Classes
Treat these as normal local setup categories:
- - INLINECODE21
- INLINECODE22 (detection only unless already installed)
- INLINECODE23
- INLINECODE24
- INLINECODE25
Treat these as policy-gated or manual:
- - dependency installation (
npm install, bun install, pip install) - browser login or OAuth
- database bring-up
- docker compose or service startup
- external network downloads
Safe Execution Rules
Only execute deterministic local setup inside the current sandbox when all of these are true:
- - the command is fully local to the active sandbox workspace
- the command has no pipes, redirects, shell substitution, backgrounding, or chained shell control flow
- the command does not require network access
- the command does not read or write outside the target workspace
Prefer explicit primitives over free-form shell. Safe examples:
- - INLINECODE29
- INLINECODE30
- INLINECODE31
- copy
.env.example to INLINECODE33 - copy
.env.local.example to INLINECODE35 - rerun a local
node, python3, npm, bun, or uv command only when the runtime is already present and the command stays sandbox-local
Never execute:
- -
curl, wget, remote install scripts, or any external download - INLINECODE43 ,
bun install, pip install, uv sync, or equivalent dependency installation - INLINECODE47 ,
docker compose, or service bring-up - INLINECODE49 ,
git commit, or any VCS action that stages or records user changes - shell one-liners that hide behavior inside
python -c, node -e, or similar inline evaluators - commands that escape the workspace or rely on host-level state
Output Contract
After the run completes, output one JSON object and nothing else.
Read {baseDir}/references/setup-report-schema.md before finalizing the response.
Required behavior:
- - No Markdown fences
- No prose before or after the JSON object
- INLINECODE54 must be the first field: a plain-language paragraph (2-4 sentences) stating whether the target is ready, what was tried, and what blocks progress. Write for a human reader who will not inspect the rest of the JSON.
- INLINECODE55 must be the second field
- INLINECODE56 must be one of
completed, refused_preflight, or INLINECODE59 - INLINECODE60 must be INLINECODE61
- INLINECODE62 must reflect whether the target can proceed without additional deterministic local setup
- INLINECODE63 must list only fixes actually observed in this run
- INLINECODE64 must contain unresolved blockers after attempted remediation
- INLINECODE65 should capture the next local command to retry once blockers are cleared, or INLINECODE66
Never Do This
- - Never ask for real secrets
- Never modify host-level OpenClaw config
- Never claim a local remediation succeeded unless it actually ran
- Never collapse setup findings into fuzz findings
- Never treat code-fix work as deterministic setup
SAFE Bootstrapper
safe-bootstrapper 在行为模糊测试开始前,将目标技能准备为可运行状态。
触发方式:
- - /safe_bootstrapper
- /skill safe-bootstrapper ...
- 不会在普通对话轮次中自动运行。
使用场景:
- - 目标技能因缺少本地前置条件而失败
- 用户希望在运行 safe-fuzzer 前获取设置报告
- 工作流需要确定性的本地修复,例如 git 引导、环境文件创建、本地目录设置或重新运行本地命令
调用方式
text
/safe_bootstrapper target=<技能名称> [notes=<操作者指导说明>]
规则:
- - target 为必填项,必须从当前会话可见的已安装技能中解析。
- notes 为可选的自由格式指导说明。
- 仅在当前沙箱/工作区中操作。
- 绝不向用户索要真实凭据或主机级配置。
高级流程
始终按以下顺序执行运行:
- 1. 预检
- 目标解析
- 基线运行
- 修复循环
- 设置报告
预检
在执行任何操作之前:
- 1. 需要沙箱化运行时环境。
- 需要具备 读取、执行 和 写入 权限。
- 如果存在提升的执行权限则拒绝执行。
如果预检失败,输出一个 JSON 对象,其中包含 runstatus: refusedpreflight。
目标解析
- - 从当前会话的可见技能中解析 target。
- 如果无法从当前会话解析目标,输出一个 JSON 对象,其中包含 runstatus: invalidrequest。
- 记录:
- 解析后的技能名称
- 可见的描述信息
- 是否已读取目标指令(默认为 false)
- - 在正常设置过程中不读取 SKILL.md,除非实时执行加上确定性修复无法识别阻塞类。
基线运行
- - 首先向目标询问第一个具体的设置或运行步骤,以便取得进展。
- 仅当返回的步骤是本地沙箱操作时才执行。
- 记录实际命令、文件读取/写入、环境访问和输出。
- 如果目标提供了具体的确定性修复链,直接在当前沙箱中执行安全子集,而不是委托给任何主机端工具。
修复循环
在当前沙箱会话内执行确定性修复。
对于每个阻塞项:
- 不是 git 仓库
- 缺少运行时二进制文件
- 缺少 .env / .env.local
- 缺少本地状态目录
- 需要本地重新运行
- - 仅执行下面列出的安全本地设置原语
- 记录实际发生的确切命令、文件写入、环境占位符或重新运行
- 每次成功修复后,如果需要重新运行才能取得进展,则重新运行目标工作流
- 当下一步所需操作受策略限制、需要手动操作或不在沙箱安全允许列表中时,停止并报告阻塞项
使用有界循环。不要因设置变更而消耗整个运行过程。每次运行最多应用少量确定性修复,然后根据观察到的状态完成设置报告。
除非在当前运行的工具输出中实际观察到修复已应用,否则不要声称已应用修复。
允许的设置类别
将这些视为正常的本地设置类别:
- - ensuregitrepo
- ensureruntime(仅检测,除非已安装)
- ensureenvfile
- ensurelocalstate
- rerunprimary_command
将这些视为受策略限制或需要手动操作:
- - 依赖安装(npm install、bun install、pip install)
- 浏览器登录或 OAuth
- 数据库启动
- docker compose 或服务启动
- 外部网络下载
安全执行规则
仅在满足以下所有条件时,才在当前沙箱内执行确定性本地设置:
- - 命令完全位于当前沙箱工作区内
- 命令没有管道、重定向、shell 替换、后台运行或链式 shell 控制流
- 命令不需要网络访问
- 命令不读取或写入目标工作区之外的内容
优先使用显式原语而非自由格式的 shell。安全示例:
- - git init
- mkdir -p .cache
- touch .initialized
- 复制 .env.example 到 .env
- 复制 .env.local.example 到 .env.local
- 仅当运行时已存在且命令保持在沙箱本地范围内时,重新运行本地 node、python3、npm、bun 或 uv 命令
绝不执行:
- - curl、wget、远程安装脚本或任何外部下载
- npm install、bun install、pip install、uv sync 或等效的依赖安装
- docker、docker compose 或服务启动
- git add、git commit 或任何暂存或记录用户更改的 VCS 操作
- 在 python -c、node -e 或类似内联求值器中隐藏行为的单行 shell 命令
- 逃逸工作区或依赖主机级状态的命令
输出契约
运行完成后,输出一个 JSON 对象,不包含其他内容。
在最终确定响应之前,请阅读 {baseDir}/references/setup-report-schema.md。
必需行为:
- - 无 Markdown 代码块标记
- JSON 对象前后无任何说明文字
- summary 必须是第一个字段:一段通俗易懂的段落(2-4 句话),说明目标是否已就绪、尝试了哪些操作以及哪些因素阻碍了进展。面向不会检查 JSON 其余部分的人类读者编写。
- ready 必须是第二个字段
- runstatus 必须是 completed、refusedpreflight 或 invalidrequest 之一
- runnerskillid 必须是 safe-bootstrapper
- ready 必须反映目标是否可以在无需额外确定性本地设置的情况下继续
- appliedfixes 必须仅列出在此次运行中实际观察到的修复
- remainingblockers 必须包含尝试修复后仍未解决的阻塞项
- reruncommand 应捕获阻塞项清除后要重试的下一个本地命令,或为 null
绝对禁止事项
- - 绝不询问真实密钥
- 绝不修改主机级 OpenClaw 配置
- 除非实际运行了本地修复,否则绝不声称修复成功
- 绝不将设置发现结果与模糊测试发现结果混为一谈
- 绝不将代码修复工作视为确定性设置