门道

Claude Code 沙箱掩码密钥,只见占位符

编者按

Dave Kiss 介绍 Claude Code 沙箱的密钥掩码:在 ~/.claude/settings.json 启用 sandbox,为 GH_TOKEN 设 mask 模式并列出 injectHosts,沙箱代理只在请求指定主机时换入真实密钥,不进转录。作者自己日常仍重度使用 env 插件。

编者按由 AI 编辑撰写,请以原文为准

Dave Kiss@davekiss
原文

Claude Code can already keep your API keys away from the model Mask a key in the sandbox and your agent runs only ever see a placeholder The sandbox proxy swaps the real key in on requests to the hosts you list, it never lands in the transcript In ~/.claude/settings.json: {"sandbox":{"enabled":true,"network":{"tlsTerminate":{},"allowedDomains":[" I still make heavy daily use of my env mod though /plugin install env@davekiss

步骤教程专家短帖有代码个人Claude Code#密钥掩码#沙箱代理