技能 编程开发 代理安全部署与启动流程

代理安全部署与启动流程

v20260826
stage-launch
本技能用于自动化代理系统的最终部署阶段。它将验证后的构建表(build sheet)转化为四个有序的JSON载荷,并生成一个可恢复的`launch.sh`启动脚本。本流程最大的特点是密钥安全:API密钥必须通过用户Shell的环境变量传入,确保密钥永远不会记录在聊天记录或文件中。该脚本提供了一个结构化的、多步骤的代理启动序列。
获取技能
178 次下载
概览

Phase 2 — Stage → Launch

Turn the build sheet into runnable artifacts, then let the founder launch with
their own key. No script here touches the network or the key — the user runs
launch.sh.

Workflow

  1. Generate payloads.

```bash
python3 scripts/payload_generator.py \
--sheet ./my-agent/build-sheet.json --out-dir ./my-agent

-> ./my-agent/payloads/{01-environment,02-agent,03-session,04-kickoff}.json

```
Agent toolset → always_allow; every MCP toolset → always_ask (baked into
the agent payload's permission_policies).

  1. Write the launch script.

```bash
python3 scripts/launchscriptwriter.py --out-dir ./my-agent
```
launch.sh creates environment → agent → session → kickoff in order,
chaining IDs, and resumes on re-run (each step skips if its *.id file
exists). It reads $ANTHROPIC_API_KEY at runtime.

  1. Validate before launch.

```bash
python3 scripts/payload_validator.py --dir ./my-agent
```
FAIL blocks — especially a key_leak finding. Fix and re-run.

  1. Minimal key step (never in chat). Check the shell first:

```bash
[ -n "$ANTHROPICAPIKEY" ] && echo "key present" || echo "export ANTHROPICAPIKEY=... first"
```
Point the founder to platform.claude.com → API keys. **Never print the key to
chat, never write it to a file.**

  1. Launch + watch the first poll.

```bash
export ANTHROPICAPIKEY=... # in their shell, not in chat
./my-agent/launch.sh
```
Mark checkpoints with Console deep links. Then `goal_state.py set --phase
grade-iterate` and advance.

Hard rules (API-key safety)

  • The key never enters chat, a file, a payload, or a log. launch.sh reads it

from the environment; payload_validator.py scans for sk-ant-… leaks and FAILs.

  • Sequential launch. environment → agent → session → kickoff. Watch the first

poll foreground before declaring success.

  • Resumable. Re-running launch.sh continues from the last created ID.

Forcing-question library (recommend + cite)

  1. "Is the key in your shell env already?" Recommend: check $ANTHROPIC_API_KEY

before anything. Cite: this SKILL, key-safety rules.

  1. "Cloud or self-hosted environment?" Recommend: cloud for v0. Cite:

cma-primitives.md (environment).

  1. "Any MCP server in the payload?" Recommend: keep it always_ask. Cite:

cma-primitives.md (permissions).

  1. "Did the first poll return idle/running cleanly?" Recommend: watch it

foreground before moving on. Cite: cma-primitives.md (session lifecycle).

Tools

  • scripts/payload_generator.py — build sheet → 4 ordered API payloads.
  • scripts/launch_script_writer.py — resumable BYOK curl launcher (no key handling).
  • scripts/payload_validator.py — pre-launch check + API-key-leak scan.
信息
分类 编程开发
名称 stage-launch
版本 v20260826
大小 8.73KB
更新时间 2026-09-06
语言