martin1847/evolab / skills/agent-backend-standard
agent-backend-standard
Verified后端架构与工程规范。适用于构建或评审 agent/LLM 后端、任何涉及数据库(DB)的后端,以及建立或评审后端仓库工程门禁。
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.5 KB |
| references/agent-foundations.md | markdown | 2.3 KB |
| references/caching-discipline.md | markdown | 3.9 KB |
| references/code-dependency-lifecycle.md | markdown | 9.5 KB |
| references/data-write-discipline.md | markdown | 9.9 KB |
| references/engineering-interface.md | markdown | 10.9 KB |
| references/evals.md | markdown | 2.6 KB |
| references/governance.md | markdown | 2.7 KB |
| references/hitl-resume-safety.md | markdown | 2.7 KB |
| references/observability-cost.md | markdown | 1.2 KB |
| references/prompt-context.md | markdown | 1.6 KB |
| references/resilience.md | markdown | 3.9 KB |
| references/safety-bounded-execution.md | markdown | 4.5 KB |
| references/secrets-discipline.md | markdown | 2.5 KB |
| references/selfcheck-gates.md | markdown | 4.4 KB |
| references/state-durability.md | markdown | 2.6 KB |
| references/tool-design.md | markdown | 2.8 KB |
references/secrets-discipline.md
View on GitHub# 附录 E — 秘密接触面纪律(分离 · 注入)<!-- trunk:secrets-discipline.md -->
> hub `agent-backend-standard` 的一章。来源:某 IaC 伞仓实证蒸馏(2026-07,同 session 三次同构
> 失手换来)。2026-09 减法:原 permissions deny 通配与假数据验证矩阵两件撤出——deny 通配实测
> 误拦远大于召回(含该文件名的普通命令与子 agent 一并被拒,任务停摆),值的防线改为
> gitignore + `chmod 600` + 进程注入。**范围**:agent 会接触本地凭证/秘密值的任何仓——目标是把
> "agent 失手把密文送进 transcript/stdout/git"从纪律问题降为结构上没有理由发生(尽力而为层,不是沙箱)。
## 0. 本质
**秘密的元数据与值物理分离后,agent 就永远没有"读值文件"的正当理由**——说明文档可整读,
值只经注入进子进程。不用 permissions deny 拦值文件:拦不住 `open()` 类绕过面,却把含该文件名的
一切命令连坐,收益是零召回、代价是整条任务停摆。
## 1. 两件(顺序即依赖:先分离,注入才唯一)
1. **值/元数据物理分离**:说明文档(如 `ACCESS.local.md`)只留元数据 + 秘密**名字** + gotcha
——agent 可整读、零遮蔽工序;值进纯 `KEY=VALUE` 的 env 文件(如 `ACCESS.local.env`,
gitignored + `chmod 600`)。混排文档做遮蔽是失手温床(regex 遮蔽会漏盖普通
key:value 行,凭证直进 transcript)。**命名刻意不入 `.env` 家族**:dotenv 生态会
自动加载 `.env*` 进每个 dev 进程(与"值只在显式 source 时进子进程"相悖),且
`ACCESS.local.md↔.env` 同词干让分离结构写在文件名上;gitignore 仍同时盖 `.env*` 作生态兜底。
2. **注入形态唯一**:`set -a; source <env>; set +a; <cmd>`——值只进子进程 env,不落
stdout/argv/transcript;脚本一律 `os.environ` 取值。禁止任何"打印出来再粘贴"形态。
## 2. 失效模式(同构识别)
任何遮蔽 / 扫描面(pre-commit check-secrets、redaction hook)只用假数据验证,真值永不作测试载荷
——"用真密文验证防护面"本身就是事故:失效即全泄、被迫全库轮换。
## 3. 与既有纪律的关系
- 全局层(不打印 stdout/不进 transcript/git、只验派生值)是行为纪律;本附录把它
**结构化**——分离让说明文档零遮蔽工序,注入让值不经 stdout/argv。
- CI/服务端 secret 扫描(push 保护、pre-commit check-secrets)是收口层,与本附录的
write-time 防失手层互补,不互替。
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |