0–5 分钟:task and repo scope
写明 task class、repository、allowed paths、denied paths 和 owner。
成功标准Agent 有窄 workspace boundary。
工作站安全基线 · 更新 2026-06-27
面向运行 Claude Code、Codex CLI、本地 agent tools、mise、uv、browser automation 和 repository workspaces 的开发者:避免 secrets 泄漏和不安全本地状态进入 agent run。
Agentic coding governance 往往从 repository 开始,但真实 blast radius 是开发者工作站。Local files、shell history、package caches、browser profiles、MCP tokens、uncommitted changes、private datasets 和 agent logs 都可能在未准备时进入 agent run。
这份 baseline 把 gstack 式 workstation setup、Claude Code、OpenAI Codex CLI、mise、uv 以及 SkillSpector 这类安全工具连成一个运营模型:为 agent work 创建 clean-room repos,secrets 不进 workspace,隔离 browser profiles,pin tools,安全记录 evidence,并在 risky tasks 后 reset state。
RepoDaily 判断
不要把个人 laptop 当成天然安全的 agent sandbox。运行 local coding agents 前,准备 clean repository copy,移除 unmanaged secrets,隔离 browser/tool credentials,pin package-manager 和 runtime tools,定义 log retention/redaction,并让每个 risky agent task 都可丢弃或可回滚。
| 表面 | 基线规则 | 风险信号 | 保留证据 |
|---|---|---|---|
| Repository workspace | Agent tasks 使用 clean branch 或 clean clone | 存在 uncommitted secrets、local patches、data dumps 或 ignored files | Clean git status、branch name、denied paths |
| Secrets | Repo、shell history、env dumps、logs、prompts 中都不放 real tokens | Agent 能读取 `.env`、cloud configs、npm/pip tokens、SSH keys 或 prod logs | Redacted secret inventory 和 rotation owner |
| Browser profile | Browser/MCP work 使用专用 automation profile | Agent 共用 personal browser sessions、cookies、password manager 或 inbox | Profile path、allowed domains、data owner |
| Package managers | 用 mise 或 project contract pin uv、Python、Node、pnpm/npm、release tools | Agent 全局安装未 review tools 或意外改 lockfiles | Tool versions、lockfile diff、install log |
| Caches and artifacts | Caches、build outputs、downloads、screenshots、traces 在 review 前视为敏感 | Agent 把 private outputs 存进 persistent cache 或 shared temp | Cache path、retention rule、cleanup proof |
| Agent logs | Transcripts 和 command logs 带 redaction / retention policy | Logs 包含 prompts、file contents、secrets 或 customer data | Run ID、redacted transcript、owner、retention date |
| MCP and hooks | 一次只启用一个 tool/server,并记录 owner 和 scope | Hooks/MCP servers 可广泛读取 files、browsers、tickets、databases 或 cloud APIs | Server inventory、scopes、tokens、approval |
| Reset path | 有 branch、caches、credentials、browser profile、generated files 的 cleanup recipe | 没人知道 agent 留下了什么 | Cleanup checklist 和 post-run git status |
给 coding agent 写权限前,先给本地环境打分。
| 控制项 | 0 分 | 1 分 | 2 分 | Owner 问题 |
|---|---|---|---|---|
| Clean-room repo | Agent 跑在日常 workspace | Run 前做部分 cleanup | Dedicated clean clone/branch + denied paths | 除了任务,agent 还能看到什么? |
| Secret boundary | Secrets 分散在本地 | 有部分 examples/ignores | 无 unmanaged secrets,rotation path 已知 | 哪些 tokens 对本次 run 可见? |
| Browser isolation | 共用个人 profile | 偶尔用单独 profile | Dedicated automation profile + domain allowlist | 哪些 cookies 或 accounts 暴露? |
| Tool pinning | Global tools 未知 | 部分版本 pinned | mise/project contract pin critical tools | 另一台机器能复现 run 吗? |
| Log hygiene | Transcripts 未管理 | 有手动 redaction | Run logs 已 redacted、owned、retained intentionally | Prompts 和 commands 存哪里? |
| Reset and rollback | 无 cleanup path | 知道手动 cleanup | 存在 post-run cleanup 和 rollback checklist | 如何回到安全状态? |
在新机器或新 repository class 上启用 local coding agent 前使用。
写明 task class、repository、allowed paths、denied paths 和 owner。
成功标准Agent 有窄 workspace boundary。
检查 `.env`、tokens、local configs、private logs、data dumps 和无关 uncommitted changes。
成功标准无 unmanaged secret 或 private data 暴露给 run。
列出 active hooks、MCP servers、browser profiles、package managers 和 external tokens。
成功标准只启用任务必需工具。
验证 mise/uv/project setup pins、test command、cache paths 和 transcript storage。
成功标准另一台 clean machine 可复现 run evidence。
写下 branch、generated files、caches、logs、browser profile 和 credentials 的 cleanup steps。
成功标准团队知道如何回到安全状态。
| 场景 | Baseline setup | 额外护栏 |
|---|---|---|
| Read-only code explanation | Clean branch、无 write commands、transcript retained | Deny secrets 和 private data paths |
| Small code change with tests | Clean clone、pinned tools、focused test command、normal PR review | 不允许 deploy/migration/release tasks |
| Browser-assisted debugging | Dedicated browser profile 和 allowed local/dev domains | 不使用 personal accounts、inbox、password manager 或 production admin panel |
| MCP-enabled repository task | 一个 approved MCP server,带 scoped token 和 owner | Run 后 disable server 并 review external calls |
| Package-manager update | Pinned package manager 和 lockfile review owner | Block global installs 和 unexpected lockfile churn |
| Private-data investigation | 优先 read-only sanitized copy 或 synthetic data | 要求 data owner 和 retention decision |
| High-risk infrastructure repo | 先 read-only 或 disposable clone | 写入需 senior owner approval 和 rollback path |
Agent 可能看到 repository 之外的东西:browser sessions、shell history、config files、caches 和 ignored files 都可能相关。
未 review 的 global package installs 会让 run 难以复现,并可能静默改变未来任务。
Screenshots、traces、build outputs、logs 和 caches 会在任务结束后继续保留 private code 或 data。
Browser tool 如果使用个人 profile,可能访问 email、admin panels、password managers 和 private SaaS sessions。
MCP servers 经常把 file access 与 external APIs 组合在一起。像生产集成一样 scope 和 disable 它们。
没有 cleanup 时,每次 agent run 都会留下影响下一次的未知状态。
为 risky agent tasks 创建 fresh clone 或 worktree,并从 clean git status 开始。
启动 agent 前扫描 `.env`、credential files、cloud configs、logs 和 private data。
Automation 使用独立 browser profile,不带 personal cookies、password manager 或无关 sessions。
用 mise pin runtimes 和 developer tools,让 agent 与 human commands 使用同一版本。
Python tasks 使用 uv/project environments,不依赖刚好存在的 global Python。
每次 risky run 后 review git status、generated files、logs、cache paths、browser state、tool tokens 和 transcript retention。
给保护 local AI coding workstations 的团队提供简短答案。
不一定。Local agents 可能看到 workstation files、shell state、browser sessions、caches 和 unmanaged secrets,除非环境先被准备好。
不建议。应使用专用 automation profile,限制 sessions 和 approved domains。
Package managers 可以 install tools、改 lockfiles、运行 scripts,并影响可复现性。它们也是 agent surface 的一部分。
Clean clone、无 unmanaged secrets、dedicated browser profile、pinned tools、recorded logs、denied paths 和 cleanup plan。
Feedback
匿名反馈只用于判断内容是否真正有用。