0–5 分钟:choose scope
选择一个 tool、一个 repository tier、一个 allowed task class 和一个 owner。
成功标准Pilot 有明确 written boundary。
治理 checklist · 更新 2026-06-27
当 bakeoff 证明 Claude Code、OpenAI Codex CLI 等 coding agents 有用之后,团队采用前需要的一份实用 rollout policy。
成功的 agentic coding bakeoff 回答的是工具能否产出有用的 reviewed diffs。治理要回答更难的问题:它被允许在哪些 repo 使用、能做什么、谁 review、必须记录什么,以及什么时候必须停止。
这份 checklist 把 agentic coding 从个人效率习惯转成团队 policy,覆盖 repository access、command authority、hooks、MCP servers、plugins、secrets、prompt injection、branch protection、PR review、audit logs 和 incident response。
RepoDaily 判断
在没有 written policy 之前,不要大规模 rollout coding agents。Policy 至少要覆盖 allowed repositories、denied paths、command approvals、hooks/MCP servers、secret handling、PR review、logging 和 rollback。Coding agent 应该产出 reviewed engineering artifacts,而不是不可见的 local automation。
| 治理区域 | 默认规则 | 何时升级审批 | 保留证据 |
|---|---|---|---|
| Repository access | 从低风险 repo 和显式 opt-in 开始 | 涉及 production、regulated data、infra、auth、billing 或 secrets | Allowed repo list、owner approval、risk tier |
| Command policy | 允许 read/build/test;mutation 或 network operations 需审批 | 命令可能 delete、deploy、migrate、exfiltrate、install 或改 credentials | Command log、approval trace、denied-command list |
| Sensitive paths | 默认阻止 secrets、deploy scripts、migrations、IaC、lockfiles 和 data dumps | 任务确实需要这些路径 | Path exception、reviewer、final diff |
| Hooks and plugins | 启用前 review 并 pin source/version | Hook 会运行 commands、call services 或自动改文件 | Hook source、config、owner、review notes |
| MCP servers and tools | 按 server 最小权限审批 | Server 可访问 browser、files、databases、tickets、email 或 cloud APIs | Server inventory、scopes、tokens、owner |
| PR review | 每个 generated patch 都要 human owner 和 CI | Patch 改 security、dependencies、schema、infra 或 user data | PR link、CI result、reviewer comments |
| Secrets and data | Agent workspace 不放 unmanaged secrets | Agent 需要 customer data、prod logs、API keys 或 private datasets | Data approval、redaction notes、retention decision |
| Audit logs | 记录 task、prompt、tool、commands、diffs、tests、approvals、reviewer decision | 发生 incident、rollback 或 policy exception | Immutable run report 或 PR checklist |
从 pilot 扩展为团队标准前,先用这张表评分。
| 控制项 | 0 分 | 1 分 | 2 分 | Owner 问题 |
|---|---|---|---|---|
| Repo tiering | 没有分级 | 非正式分级 | 明确 low/medium/high-risk repo policy | 今天哪些 repo 允许 agent 写入? |
| Command approvals | Ad hoc prompts | 有部分 denied commands | 有文档化 allow/deny/approval list | 哪个 command 会终止运行? |
| Tool inventory | hooks/plugins/MCP 未知 | 部分记录 | Owner、scope、token、version 均跟踪 | 每个 external tool 谁负责? |
| Secret hygiene | workspace 可能有 secrets | 部分 cleanup | 无 unmanaged secrets,redaction rules 明确 | Agent 本地能看到什么? |
| Review workflow | Generated patches self-merged | 偶尔 human review | CI + human owner 必需 | 谁对 merge 负责? |
| Incident response | 无 rollback plan | 手动 rollback | 已有 stop/revoke/revert/report playbook | Agent 做坏事后怎么办? |
在 coding agent 超出个人 pilot 前使用。
选择一个 tool、一个 repository tier、一个 allowed task class 和一个 owner。
成功标准Pilot 有明确 written boundary。
列出 allowed commands、denied paths、approval triggers 和 required PR checks。
成功标准Reviewer 能根据书面规则停止运行。
记录 hooks、plugins、MCP servers、package versions、tokens 和 external services。
成功标准每个 external capability 都有 owner 和理由。
执行一个低风险任务,同时收集 commands、diff、tests、approvals 和 reviewer comments。
成功标准Run 产出可 review artifact 和 policy evidence。
决定 expand、repeat、restrict 或 stop,并记录 policy gaps 和下次 review date。
成功标准下一步基于 evidence 和 owner sign-off。
| Use case | 允许策略 | Required review |
|---|---|---|
| Read-only explanation | 多数 repo 允许,regulated/customer-data areas 除外 | Reviewer 检查 explanations 不泄露 secrets、不编造 behavior |
| Docs update | 低风险 repo 允许,tests 可选 | Human review factual accuracy 和 unsupported claims |
| Test addition | Low/medium-risk repos 允许,CI 必需 | Reviewer 检查 tests 断言真实 behavior,不只是 snapshots |
| Small bug fix | Bakeoff 成功后允许,需 focused tests | Human owner、CI、changed-file review、rollback path |
| Dependency update | 需要 approval | Security/license review、lockfile review、changelog check |
| Database migration | 默认 restricted | Senior reviewer、migration rollback、data safety review |
| Infrastructure/IaC change | Policy 成熟前 restricted 或 read-only | Infra owner approval、plan output、secret scan、rollback owner |
| Website cloning benchmark | 仅允许 approved reference pages | Copyright/asset scope review,未获 owner approval 不部署生产 |
如果 commands 和 diffs 不记录,组织就无法学习或调查 agent behavior。
README、issues、comments、docs 和 fixtures 都可能包含与团队 policy 冲突的指令。
Hooks、plugins、MCP servers 可能悄悄把 coding assistant 变成广泛自动化平台。
除非准备 workspace 和 shell,否则 agents 可能读取 local files、env vars、logs 或 configs。
人类点 merge 不够;reviewer 必须理解 diff 并承担 outcome。
Agent versions、settings、hooks 和 repository risk 都会变化,治理需要周期性 review。
把 repo 标为 read-only、low-risk write、medium-risk approval、high-risk restricted 或 prohibited。
先允许 read、format、lint、unit-test、typecheck;install、network、delete、deploy、migrate 或 credential operations 需审批。
阻止或审批 `.env`、secrets、infra、migrations、auth、billing、production configs 和 large data dumps。
跟踪 hooks、plugins、MCP servers、browser tools、file tools、package managers 和 external APIs 的 owner 与 scope。
要求 generated-code label、tests、changed-file review、data/secrets check、dependency check 和 reviewer ownership。
定义 stop、revoke token、revert commit、rotate secret、notify owner 和 update policy steps。
给把 agentic coding pilots 转成 policy 的团队提供简短答案。
通过真实 bakeoff,并且团队有 repository access、command approvals、secrets、tool integrations、PR review、logging 和 rollback 的书面规则之后。
不应该。按一个一个启用,并记录 owner、scope、token、version 和 review notes。
先 read-only。写入 infra 需要 senior owner approval、plan output、CI、rollback path 和明确 command policy。
Task prompt、tool/version、repository、commands、changed files、tests、approvals、reviewer、merge decision,以及任何 policy exception。
Feedback
匿名反馈只用于判断内容是否真正有用。