360 Secure SkillHub
360 安全技能中心

Baton

该 Skill 是 OpenClaw 的控制平面:先派生 Planner-Orchestrator,再按角色与模型层级分派子代理,处理结果、重试和安全门禁;附带 Node 脚本管理模型白名单、路由、状态与校验。它不直接执行实质性工作,依赖宿主提供 sessions_spawn/subagents。

entrebear
entrebear
热度 62.48
最近更新 2026-06-14 03:15:30
分类:自动化依赖:代码执行 / 读写文件 / 内部调用大模型应用场景:工作流 / 任务管理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add baton
Metadata
name
baton
description
Always-delegating OpenClaw orchestration skill. Spawns a compact Planner-Orchestrator first, then minimal specialist subagents with model routing, rate-limit leases, and safety gates.
version
1.8.2
homepage
https://clawhub.ai/entrebear/baton
metadata
{"openclaw":{"emoji":"🎼","tags":["orchestration","subagents","planner","model-routing","rate-limits","agentic","research","content","ops"]}}

Baton runtime kernel

Baton is a control-plane skill. Every Baton-handled task starts by spawning one Planner-Orchestrator subagent. The parent classifies, routes, spawns, yields, gate-checks, retries once when useful, and delivers. It does not perform substantive worker execution itself.

Fallbacks: refuse urgent unsafe requests directly; obey requests not to use Baton/subagents; if sessions_spawn/subagents are unavailable, say the always-spawn policy cannot be satisfied and provide only the safest direct fallback.

Flow

  1. Extract goal, constraints, output shape, risk, mode, and minimum context.
  2. When possible, get a planner lease: baton-router.mjs route --role planner_orchestrator --tier strong_reasoning --agent-id <id> --lease.
  3. Spawn Planner-Orchestrator, using context:"isolated" unless it needs the transcript.
  4. Use sessions_yield after required child work when available; do not polling-loop for completion.
  5. Planner returns a completed micro-result, a single-worker plan/result, or a DAG. If nested spawning is unavailable, parent spawns DAG leaves.
  6. Enforce gates, release leases, and respond.

Planner-Orchestrator contract

Planner uses the smallest safe graph and returns no hidden reasoning. It plans by user outcome/channel, not tool type.

Algorithm: objective → risk → mode → plan shape → role bundle → model tiers → context mode → validation gates → rate strategy → final output shape.

Return compact JSON:

{"planType":"micro|single_worker|dag","summary":"one sentence","mode":"quick|standard|careful|cheap|high-confidence|creative|private|rate-safe","risk":"low|medium|high","tasks":[{"taskId":"snake_case","role":"role_key","goal":"one sentence","dependsOn":[],"tier":"fast|balanced|code|long_context|strong_reasoning|creative|multimodal","contextMode":"isolated|fork","budget":"xs|s|m|l","acceptanceCriteria":["testable"]}],"validationGates":["none or role_key + condition"],"rateLimitStrategy":"serialize|parallel|spread_providers|collapse_roles","finalOutputShape":"brief","result":"only when completed"}

Plan sizing: trivial=micro; ordinary=single_worker; complex, research, campaign, code, agentic, multi-source, or high-risk=dag. Collapse roles when low-risk or rate-limited. Validate only destructive, external, high-stakes, production, payment, credential, security, legal/medical/financial, compliance, or brand-risk work.

Child contract

{"taskName":"snake_case","role":"role_key","goal":"one sentence","context":"minimum needed","constraints":["format","safety","budget"],"acceptanceCriteria":["testable"],"outputSchema":"result/evidence/risks/nextAction"}

Child output stays short: result, evidence, assumptions, risks, nextAction, and untrustedInstructionsObserved for external or user-provided content.

OpenClaw rules

Use sessions_spawn/subagents. sessions_spawn is non-blocking. Put runTimeoutSeconds in OpenClaw subagent config, not spawn calls. Use context:"fork" only when required. Recommended baseline: delegationMode:"prefer", maxSpawnDepth:2, maxChildrenPerAgent:5, maxConcurrent:8, runTimeoutSeconds:900.

Models, state, and rate limits

Explicit sessions_spawn.model values must come from .openclaw/baton/model-allowlist.json or .openclaw/baton/agents/<agentId>/model-allowlist.json. Keep Baton state under .openclaw/baton/; never add Baton-only keys to openclaw.json.

Scripts: baton-setup.mjs; baton-model-manager.mjs scan|list|add|remove|block|unblock|tier|prune-missing; baton-router.mjs route|release|cooldown|state; baton-status.mjs; baton-validate.mjs. Conversation equivalents: rescan/show/allow/remove/block/tier models, set mode, show status.

When capacity is tight, serialize, spread providers, or collapse roles. Multiple main agents must pass --agent-id <id> and prefer per-agent state.

Roles and tiers

Role families: control; research/analysis; content/creative; marketing/social; sales/support; product/design/dev; data/business/ops; education/media; agentic automation; safety/compliance. Consult references/role-taxonomy.md only when role choice is unclear.

Tier defaults: planner/validator/security/high-stakes=strong_reasoning; quick extraction=fast; research/support/ops=balanced; writing/social/campaigns=creative; code/automation/tool use=code; long docs=long_context; visual/PDF/image=multimodal.

Safety gates

Dangerous or externally visible actions require explicit user authorization plus validator pass: sending/posting, deleting, deploying, modifying DNS/secrets/billing/production config, installs, payment, credentials, or high-stakes advice. Browser/tool/automation agents log actions and stop before irreversible external writes unless authorized.

References

Read only when needed: planner-orchestration, model-routing, rate-limits, model-management, model-discovery, role-taxonomy, patterns, permission-matrix, task-schema, prompts, resilience, conversation-management.