跳到主内容
@wquguru
精选88Claude 博客(sitemap)技巧与观点

Anthropic发布企业级编码Agent安全指南

The enterprise guide to securing coding agents | Claude by Anthropic

原文
发到 X
推荐理由

做工程落地的同学必看,这份指南把编码Agent的安全风险拆解得很细,特别是那六个评估问题和四大风险对照表,直接拿来就能用。

Shipping fast and secure

快速且安全的配送

Coding agents likely write code and open pull requests at your organization already. For many leading enterprises, they are reviewing, testing, and merging it too.

编码代理可能已经在您的组织中编写代码并打开拉取请求。对于许多领先的企业来说,它们也在审查、测试和合并这些代码。

For example, after standardizing on Claude Code across its engineering organization, Salesforce¹ reported:

例如,Salesforce¹在其工程组织全面采用 Claude Code 后报告称:

79%

more pull requests merged per developer at Salesforce

Salesforce 每位开发者合并的拉取请求数量增加

5%

fewer total incidents at Salesforce

Salesforce 发生的总事故数量减少

As agents do more, technical and security leaders must mitigate risks like prompt injection and privilege abuse with layered controls such as checked permissions and bounded environments.

随着代理承担更多工作,技术和安全领导者必须通过分层控制(如经过检查的权限和受限环境)来缓解提示注入和权限滥用等风险。

The first two chapters focus on scoping the risk. We discuss the requirements every AI provider should meet and four agentic risks to mitigate.

前两章侧重于界定风险范围。我们讨论了每个 AI 提供商都应满足的要求以及需要缓解的四种代理风险。

The next three chapters focus on bounding the risk. We highlight the defensive layers you can deploy with Claude Code as well as how to centrally manage and enforce those controls.

接下来的三章侧重于限制风险。我们突出了您可以随 Claude Code 部署的防御层,以及如何集中管理和执行这些控制措施。

This guide aims to provide a helpful agent security framework that can give organizations the confidence and trust to run agents effectively at scale.

本指南旨在提供一个实用的代理安全框架,使组织能够有信心和信任地在大规模范围内有效运行代理。

The components of defending an AI agent: the model, the environment around it, and external checks on what goes in and what comes out.

防御 AI 代理的组成部分:模型、其周围的环境,以及对输入和输出进行的外部检查。

This guide is written for organizations on Claude Team and Enterprise plans. If you reach Claude through a cloud provider such as AWS, Google Cloud, or Microsoft Azure, the same principles and local controls apply.

本指南是为使用 Claude Team 和 Enterprise 计划的组织编写的。如果您通过 AWS、Google Cloud 或 Microsoft Azure 等云提供商访问 Claude,则相同的原理和本地控制措施同样适用。

01 Setting the bar for agent security

01 设定代理安全标准

Six questions for every coding agent · Applying SaaS requirements to your AI provider

针对每个编码代理的六个问题 · 将 SaaS 要求应用于您的 AI 提供商

“A CISO's responsibility in the age of agentic AI is not to achieve zero risk. Instead, our jobs are to make agentic risk legible and bounded. This way, we can deliberately accept what we can manage, so the business moves on our terms instead of around us.”

"在代理式 AI 时代,首席信息安全官(CISO)的责任不是实现零风险。相反,我们的工作是将代理风险变得透明且可控。这样,我们可以有意接受我们能够管理的风险,从而使业务按照我们的节奏推进,而不是围绕着我们打转。"

Jason Clinton, Deputy CISO at Anthropic

Jason Clinton,Anthropic 副首席信息安全官

Six questions for every coding agent

针对每个编码代理的六个问题

Here are six questions leaders can ask when evaluating coding agents to verify they are enterprise ready.

以下是领导者在评估编码代理时可提出的六个问题,以验证其是否具备企业级就绪能力。

Question to askWhy you should careGood answerWeak answer
Does the model refuse when it should?The model is the first check on a harmful request, making a bad action less likely.Refusal trained into weights, with published rates."Our system prompt instructs the model to decline."
Are actions automatically inspected outside the model before they run?External checks can catch when the model is tricked or using bad judgment.Static analysis of commands and a separate evaluator model. Prompt injection probes."The model is very capable."
Is blast radius bounded by the environment?This bounds the severity, and therefore risk, of an incident.Kernel-level sandboxing that admins can require and set to fail closed, or an isolated VM for each session. Egress allowlisting at the network layer."The agent is instructed not to leave the working directory."
Can policy be locked centrally?Sets minimum standards that can’t be undone by individuals.Managed settings with hard-deny rules a local user can't override.“Per-developer config files, and an honor system policy doc.”
Is the code the agent writes secure?Code volume is scaling and vulnerabilities can ship unless checks scale with the volume.Automated security review with a person approving high-risk changes.“The model is trained to write secure code.”
Can you reconstruct an incident?Compliance. Improving security over time.Session telemetry export, audit API (Enterprise), and named known gaps."Logs are available on request."
需要提出的问题为什么你应该关心良好的回答薄弱的回答
模型在应该拒绝时是否会拒绝?模型是应对有害请求的第一道防线,能降低不良行为发生的可能性。拒绝机制已训练入权重中,并公布了拒绝率。“我们的系统提示词指示模型予以拒绝。”
模型执行操作前,外部是否会自动检查这些操作?外部检查可以发现模型被欺骗或判断失误的情况。对命令进行静态分析,并使用独立的评估器模型。提示注入探测。“该模型非常强大。”
环境是否限制了爆炸半径(影响范围)?这限制了事件的严重程度,从而控制了风险。内核级沙箱化,管理员可要求启用并设置为失败关闭模式,或为每个会话提供隔离虚拟机。在网络层实施出口白名单。“代理被指示不得离开工作目录。”
策略能否集中锁定?设定个人无法撤销的最低标准。具有硬性拒绝规则的管理设置,本地用户无法覆盖。“每个开发者的配置文件,以及基于荣誉体系的政策文档。”
代理编写的代码是否安全?代码量正在激增,除非检查措施随代码量同步扩展,否则漏洞可能会随之发布。自动化安全审查,并由人工批准高风险变更。“模型经过训练,能够编写安全的代码。”
你能否重建事件现场?合规性。持续改进安全性。会话遥测数据导出、审计 API(企业版)以及已知的明确缺陷列表。“日志可按需提供。”

Applying SaaS requirements to your AI provider

将 SaaS 要求应用于你的 AI 提供商

You already have a SaaS provider checklist with controls such as single sign-on, role-based access, data handling terms, and audit logs. Hold AI providers to a similar checklist. For example, Claude Code supports these security expectations through:

你通常已有包含单点登录、基于角色的访问控制、数据处理条款和审计日志等控制措施的 SaaS 提供商检查清单。请对 AI 提供商也适用类似的检查清单。例如,Claude Code 通过以下方式满足这些安全期望:

  • Single sign-on and role-based access control (Enterprise), managed the way you manage your other enterprise tools.
  • We don’t train generative models on code or prompts under our commercial terms, unless your organization has chosen to share that data with us.
  • Enterprise Frontier Safeguards (rolling out in phases) combines the privacy of zero data retention with state-of-the-art safeguards for detecting misuse across highly capable models. Data can be encrypted with your own keys and kept in storage you control for a limited time. Learn more.
  • On Enterprise, BAA coverage for the Claude Code CLI and the desktop app’s Code tab in local mode, once the HIPAA configuration is applied.
  • Encryption options on cloud platforms: customer-managed keys in AWS KMS on Amazon Bedrock, CMEK on Google Cloud, or Microsoft Foundry’s Hosted on Azure option.
  • A SOC 2 Type 2 report and ISO 27001 certificate in the Anthropic Trust Center.
  • 单点登录和基于角色的访问控制(企业版),管理方式与你管理其他企业工具的方式相同。
  • 在我们的商业条款下,我们不会针对代码或提示词训练生成式模型,除非你的组织选择与我们共享这些数据。
  • 企业前沿保障措施(分阶段推出)将零数据保留的隐私性与检测高度能力模型滥用行为的最新 safeguards 相结合。数据可以使用你自己的密钥进行加密,并在你控制的存储中保留有限的时间。了解更多。
  • 在企业版中,一旦应用了 HIPAA 配置,Claude Code CLI 和本地模式下桌面应用的“代码”选项卡将覆盖 BAA(商业伙伴协议)范围。
  • 云平台的加密选项:Amazon Bedrock 上的 AWS KMS 客户管理密钥、Google Cloud 上的 CMEK(客户管理加密密钥),或 Microsoft Foundry 的 Azure 托管选项。
  • Anthropic Trust Center 中的 SOC 2 Type 2 报告和 ISO 27001 证书。

02 Identifying AI-specific risks

02 识别 AI 特定风险

Leaked credentials and privilege abuse · Unvetted dependencies and extensions · Data exfiltration · Prompt injection

泄露的凭据和权限滥用 · 未经审查的依赖项和扩展 · 数据外泄 · 提示注入

Security and technical leaders are familiar with risks like leaked credentials, abused privileges, compromised dependencies, and insider threats. However the attack surfaces, velocity, and scale all change when it comes to agents. Let’s look at some of the risks.

安全和技术的领导者们熟悉泄露凭据、权限滥用、受损依赖项以及内部威胁等风险。然而,当涉及智能体(agents)时,攻击面、速度和规模都会发生变化。让我们来看看一些具体的风险。

RiskHow you handle it todayWhat changes with an agent
Leaked credentials and privilege abuseLeast privilege, short-lived tokens, keyless auth through workload identity or OIDC. Regular review of over-privileged accounts.Named accounts for people, per-workload identity for software.Credentials should be short-lived and scoped to the task or job, not the developer’s full access.The agent acts inside a developer’s session and most logs outside Claude Code only show the developer’s name.
Unvetted dependencies and extensionsPinned versions, review gates, two reviewers on manifest changes. Version controlled configuration.Agents add both vetted and unvetted dependencies faster than manual processes. Extensions instruct the agent the moment they connect.
Data exfiltrationEgress allowlisting at the network layer.A compromised agent can send data out through services you already allow. Unlike traditional malware, it can try multiple routes the attacker doesn’t have to proactively define.
Insider riskSocial engineering awareness training, verification, reporting paths.Prompt injection: The check moves to the tool call and the network boundary.
风险你目前如何处理引入智能体后的变化
泄露的凭据和权限滥用最小权限原则、短期令牌、通过工作负载身份或 OIDC 实现无密钥认证。定期审查过度授权的账户。为人员分配命名账户,为软件分配每工作负载的身份。凭据应为短期的,且仅限于任务或作业的范围,而非开发者的完整访问权限。智能体在开发者的会话内运行,而大多数仅显示开发者名称的日志位于 Claude Code 之外。
未经审查的依赖项和扩展固定版本、审查关卡、清单变更需两名审查者。版本控制的配置。智能体比手动流程更快地添加经过审查和未经审查的依赖项。扩展程序在连接的那一刻就会指示智能体。
数据外泄在网络层进行出口白名单限制。受损的智能体可以通过你已经允许的服务发送数据。与传统恶意软件不同,它可以尝试多条路径,攻击者无需主动定义这些路径。
内部风险社会工程学意识培训、验证、报告途径。提示注入:检查点移至工具调用和网络边界。

Risk 1: Leaked credentials and privilege abuse

风险 1:泄露的凭据和权限滥用

Anything an agent can read, it can leak. That includes credentials like a long-lived AWS access key or GitHub token.

任何智能体能够读取的内容,它都可能泄露。这包括长期有效的 AWS 访问密钥或 GitHub 令牌等凭据。

Anything the agent can do, a compromised or overeager agent can misuse. By default, an agent in Claude Code runs under the identity of the developer who oversees it. In the event of an incident, you may need to distinguish between agent and developer actions so you can appropriately respond.

任何智能体能够执行的操作,一个受损或过于积极的智能体都可能被滥用。默认情况下,Claude Code 中的智能体以监督它的开发者的身份运行。如果发生事件,你可能需要区分智能体和开发者的操作,以便做出适当的响应。

Illustrative example of a pull request conversation. In the pipeline, the agent’s work arrives under its own name.

拉取请求(Pull Request)对话的示例。在流水线中,智能体的工作以其自身名称呈现。

Risk 2: Unvetted dependencies and extensions

风险 2:未经审核的依赖项和扩展

Agentic coding accelerates the rate at which code is generated and reviewed, which includes the speed at which dependencies are added and configuration changes are made.

智能体编码加速了代码生成和审查的速度,其中包括添加依赖项和进行配置更改的速度。

When you ask an agent to add JSON schema validation, it will find a package, add the latest version, and have working code in minutes. That speed can be a risk if agents aren’t pointed in the right direction.

当你要求智能体添加 JSON Schema 验证时,它会找到一个包、添加最新版本,并在几分钟内提供可运行的代码。如果未对智能体进行正确引导,这种速度可能带来风险。

MCP servers, plugins, skills, subagent definitions, and a repository’s CLAUDE.md file are dependencies too, and they deserve the review you give a package. Unlike a compromised library, which waits to be called, they reach the agent as soon as they load. Their descriptions and instructions enter the context window before the agent has done any work.

MCP 服务器、插件、技能、子智能体定义以及仓库中的 CLAUDE.md 文件也是依赖项,它们值得你像对待软件包一样进行审核。与在被调用前处于等待状态的受损库不同,它们在加载后便会立即接触智能体。它们的描述和指令会在智能体开始任何工作之前就进入上下文窗口。

On Enterprise plans, skill and plugin scanning checks third-party skills and plugins for malicious content when someone uploads or edits them in your organization.

在企业版计划中,当有人在你的组织中上传或编辑技能和插件时,技能和插件扫描功能会检查第三方技能和插件是否存在恶意内容。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件