工作站安全基线 · 更新 2026-06-27

Local AI Workstation Security Baseline:Secrets、Caches、Browser Profiles、Package Managers、Agent Logs 与 Clean-room Repos

面向运行 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 workspaceAgent tasks 使用 clean branch 或 clean clone存在 uncommitted secrets、local patches、data dumps 或 ignored filesClean git status、branch name、denied paths
SecretsRepo、shell history、env dumps、logs、prompts 中都不放 real tokensAgent 能读取 `.env`、cloud configs、npm/pip tokens、SSH keys 或 prod logsRedacted secret inventory 和 rotation owner
Browser profileBrowser/MCP work 使用专用 automation profileAgent 共用 personal browser sessions、cookies、password manager 或 inboxProfile path、allowed domains、data owner
Package managers用 mise 或 project contract pin uv、Python、Node、pnpm/npm、release toolsAgent 全局安装未 review tools 或意外改 lockfilesTool versions、lockfile diff、install log
Caches and artifactsCaches、build outputs、downloads、screenshots、traces 在 review 前视为敏感Agent 把 private outputs 存进 persistent cache 或 shared tempCache path、retention rule、cleanup proof
Agent logsTranscripts 和 command logs 带 redaction / retention policyLogs 包含 prompts、file contents、secrets 或 customer dataRun ID、redacted transcript、owner、retention date
MCP and hooks一次只启用一个 tool/server,并记录 owner 和 scopeHooks/MCP servers 可广泛读取 files、browsers、tickets、databases 或 cloud APIsServer inventory、scopes、tokens、approval
Reset path有 branch、caches、credentials、browser profile、generated files 的 cleanup recipe没人知道 agent 留下了什么Cleanup checklist 和 post-run git status

Workstation 准备度评分卡

给 coding agent 写权限前,先给本地环境打分。

控制项0 分1 分2 分Owner 问题
Clean-room repoAgent 跑在日常 workspaceRun 前做部分 cleanupDedicated clean clone/branch + denied paths除了任务,agent 还能看到什么?
Secret boundarySecrets 分散在本地有部分 examples/ignores无 unmanaged secrets,rotation path 已知哪些 tokens 对本次 run 可见?
Browser isolation共用个人 profile偶尔用单独 profileDedicated automation profile + domain allowlist哪些 cookies 或 accounts 暴露?
Tool pinningGlobal tools 未知部分版本 pinnedmise/project contract pin critical tools另一台机器能复现 run 吗?
Log hygieneTranscripts 未管理有手动 redactionRun logs 已 redacted、owned、retained intentionallyPrompts 和 commands 存哪里?
Reset and rollback无 cleanup path知道手动 cleanup存在 post-run cleanup 和 rollback checklist如何回到安全状态?

30 分钟 Local AI Workstation Security Check

在新机器或新 repository class 上启用 local coding agent 前使用。

0–5 分钟:task and repo scope

写明 task class、repository、allowed paths、denied paths 和 owner。

成功标准Agent 有窄 workspace boundary。

5–10 分钟:secret and data preflight

检查 `.env`、tokens、local configs、private logs、data dumps 和无关 uncommitted changes。

成功标准无 unmanaged secret 或 private data 暴露给 run。

10–16 分钟:tool and browser isolation

列出 active hooks、MCP servers、browser profiles、package managers 和 external tokens。

成功标准只启用任务必需工具。

16–23 分钟:reproducibility check

验证 mise/uv/project setup pins、test command、cache paths 和 transcript storage。

成功标准另一台 clean machine 可复现 run evidence。

23–30 分钟:reset plan

写下 branch、generated files、caches、logs、browser profile 和 credentials 的 cleanup steps。

成功标准团队知道如何回到安全状态。

Workstation Baseline 流程

  1. 先分类任务:read-only explanation、docs/test change、bug fix、browser automation、private data task、release task 或 infrastructure task。
  2. 准备 clean-room workspace:clean branch/clone、无 unmanaged secrets、无 private data dumps、无无关 uncommitted changes,并明确 denied paths。
  3. 选择 tool surface:terminal agent、browser tool、MCP server、hook、package manager 或 release tool。只启用任务需要的东西。
  4. 用 mise/project setup contracts pin runtimes 和 package managers;Python tasks 尽量用 uv 或项目专用工具,避免 global installs。
  5. 记录 prompts、transcripts、screenshots、traces、build outputs 和 caches 存在哪里,何时删除或保留。
  6. Run 之后检查 git status、generated artifacts、caches、logs、browser profile 和 credentials,再标记任务完成。

场景表

场景Baseline setup额外护栏
Read-only code explanationClean branch、无 write commands、transcript retainedDeny secrets 和 private data paths
Small code change with testsClean clone、pinned tools、focused test command、normal PR review不允许 deploy/migration/release tasks
Browser-assisted debuggingDedicated browser profile 和 allowed local/dev domains不使用 personal accounts、inbox、password manager 或 production admin panel
MCP-enabled repository task一个 approved MCP server,带 scoped token 和 ownerRun 后 disable server 并 review external calls
Package-manager updatePinned package manager 和 lockfile review ownerBlock 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

Workstation 风险清单

Personal-state leakage

Agent 可能看到 repository 之外的东西:browser sessions、shell history、config files、caches 和 ignored files 都可能相关。

Global install drift

未 review 的 global package installs 会让 run 难以复现,并可能静默改变未来任务。

Persistent trace risk

Screenshots、traces、build outputs、logs 和 caches 会在任务结束后继续保留 private code 或 data。

Overpowered browser profile

Browser tool 如果使用个人 profile,可能访问 email、admin panels、password managers 和 private SaaS sessions。

MCP token sprawl

MCP servers 经常把 file access 与 external APIs 组合在一起。像生产集成一样 scope 和 disable 它们。

No reset path

没有 cleanup 时,每次 agent run 都会留下影响下一次的未知状态。

Baseline 实施模式

Clean-room repo

为 risky agent tasks 创建 fresh clone 或 worktree,并从 clean git status 开始。

Secrets preflight

启动 agent 前扫描 `.env`、credential files、cloud configs、logs 和 private data。

Dedicated browser profile

Automation 使用独立 browser profile,不带 personal cookies、password manager 或无关 sessions。

mise pins the workstation

用 mise pin runtimes 和 developer tools,让 agent 与 human commands 使用同一版本。

uv avoids global Python drift

Python tasks 使用 uv/project environments,不依赖刚好存在的 global Python。

Post-run cleanup

每次 risky run 后 review git status、generated files、logs、cache paths、browser state、tool tokens 和 transcript retention。

常见问题

给保护 local AI coding workstations 的团队提供简短答案。

Local coding agent 一定比 cloud agent 安全吗?

不一定。Local agents 可能看到 workstation files、shell state、browser sessions、caches 和 unmanaged secrets,除非环境先被准备好。

Agents 可以用我的正常 browser profile 吗?

不建议。应使用专用 automation profile,限制 sessions 和 approved domains。

为什么 security baseline 要包括 package managers?

Package managers 可以 install tools、改 lockfiles、运行 scripts,并影响可复现性。它们也是 agent surface 的一部分。

最低安全起点是什么?

Clean clone、无 unmanaged secrets、dedicated browser profile、pinned tools、recorded logs、denied paths 和 cleanup plan。

相关雷达

Infrastructure & Runtime 雷达

相关 RepoDaily 解读

来源

  1. gstack
  2. Claude Code official docs
  3. Claude Code settings docs
  4. Claude Code MCP docs
  5. OpenAI Codex CLI docs
  6. OpenAI Codex security docs
  7. mise documentation
  8. uv documentation

Feedback

这页是否帮助你做出决定?

匿名反馈只用于判断内容是否真正有用。

报告过期或缺失的证据