{"meta":{"title":"关于第三方编码代理","intro":"你可以结合 Copilot cloud agent 使用第三方编码代理，在 GitHub 上异步处理你的开发任务。","product":"GitHub Copilot","breadcrumbs":[{"href":"/zh/enterprise-cloud@latest/copilot","title":"GitHub Copilot"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts","title":"概念"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts/agents","title":"智能体"},{"href":"/zh/enterprise-cloud@latest/copilot/concepts/agents/about-third-party-coding-agents","title":"第三方编码代理"}],"documentType":"article"},"body":"# 关于第三方编码代理\n\n你可以结合 Copilot cloud agent 使用第三方编码代理，在 GitHub 上异步处理你的开发任务。\n\n> \\[!NOTE] 第三方编码代理目前处于公开预览状态。\n\n## Introduction\n\n可以同时使用 Copilot cloud agent 第三方编码代理来异步处理开发任务。 可以分配现有问题或向代理提供提示，该代理将处理所需的更改并创建拉取请求。 代理完成后，会请求你进行审核，你可以留下拉取请求评论，要求代理迭代优化。\n\n编码代理受到与Copilot cloud agent相同的安全保护、缓解措施和限制。 若要详细了解如何使用编码代理，请参阅 [关于 GitHub Copilot 云代理](/zh/enterprise-cloud@latest/copilot/concepts/agents/cloud-agent/about-cloud-agent)。\n\n### 可以在哪里使用编码代理\n\n可以在以下位置使用编码代理启动任务：\n\n* **“代理”选项卡**：在“ [代理”选项卡中](https://github.com/copilot/agents?ref_product=copilot\\&ref_type=engagement\\&ref_style=text\\&utm_source=docs-3p-agents-tab-cta\\&utm_medium=docs\\&utm_campaign=agent-3p-platform-feb-2026)的提示框下选择一个代理，然后启动一个新任务，并监视代理处理拉取请求。\n* **问题**：将代理分配到存储库中的现有问题。\n* **拉取请求**：在对现有拉取请求的注释中提及 `@AGENT_NAME` ，要求其进行更改。\n* 在 [**GitHub Mobile**](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/chat-with-copilot/chat-in-mobile) 上：从“主页”\\*\\*\\*\\* 视图单击 <svg version=\"1.1\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" class=\"octicon octicon-plus\" aria-label=\"plus\" role=\"img\"><path d=\"M7.75 2a.75.75 0 0 1 .75.75V7h4.25a.75.75 0 0 1 0 1.5H8.5v4.25a.75.75 0 0 1-1.5 0V8.5H2.75a.75.75 0 0 1 0-1.5H7V2.75A.75.75 0 0 1 7.75 2Z\"></path></svg> 启动新的智能体会话。\n* In [**Visual Studio Code**](https://code.visualstudio.com/docs/copilot/agents/overview#_create-an-agent-session)：在聊天视图中启动新会话，或将现有会话委托给其他代理。\n\n### 使编码代理可用\n\n在将任务分配给GitHub上的编码代理之前，必须先在您的帐户策略中启用这些代理。\n\n* 有关 **GitHub Copilot Pro、GitHub Copilot Pro+ 和 GitHub Copilot Max 订阅者**，请参阅 [以个人订阅者身份管理 GitHub Copilot 策略](/zh/enterprise-cloud@latest/copilot/how-tos/manage-your-account/manage-policies#enabling-or-disabling-third-party-coding-agents-in-your-repositories)。\n* 对于 **GitHub Copilot Business 和 GitHub Copilot Enterprise 订阅者**，请参阅 [管理组织中GitHub Copilot的策略和功能](/zh/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-for-organization/manage-policies) 或 [管理企业中 GitHub Copilot 的策略和功能](/zh/enterprise-cloud@latest/copilot/how-tos/administer-copilot/manage-for-enterprise/manage-enterprise-policies)。\n\n这些策略不适用于**本地**代理。Visual Studio Code 若要在其中Visual Studio Code配置代理设置，请参阅文档中[的代理](https://code.visualstudio.com/docs/copilot/agents/overview#_types-of-agents)Visual Studio Code类型。 若要调整Visual Studio Code企业代理设置，请参阅文档中的[启用或禁用代理](https://code.visualstudio.com/docs/enterprise/ai-settings#_enable-or-disable-the-use-of-agents)Visual Studio Code的使用。\n\n## 支持的编码代理\n\nGitHub 支持以下第三方代理：\n\n* [Anthropic Claude](/zh/enterprise-cloud@latest/copilot/concepts/agents/anthropic-claude)\n* [OpenAI Codex](/zh/enterprise-cloud@latest/copilot/concepts/agents/openai-codex)\n\n## 第三方代理的 AI 模型\n\n使用第三方代理启动任务时，可以选择代理使用的 AI 模型。 你可能会发现不同的模型性能更好，或者根据任务类型提供更有用的响应。 有关确定可使用的模型的帮助，请参阅“[AI 模型比较](/zh/enterprise-cloud@latest/copilot/reference/ai-models/model-comparison)”。\n\n还可以选择“ **自动**”，以便 Copilot auto model selection 代表你选择最佳可用模型。 请参阅“[关于 Copilotauto model selection](/zh/enterprise-cloud@latest/copilot/concepts/models/auto-model-selection)”。\n\n以下模型可用于每个代理：\n\n### OpenAI Codex\n\n* 自动 \\* GPT-5.3-Codex\n* GPT-5.4\n* GPT-5.4 nano\n\n### Anthropic Claude\n\n* 自动 \\* Claude Opus 4.5\n* Claude Opus 4.6\n* Claude Opus 4.7\n* Claude Sonnet 4.5\n* Claude Sonnet 4.6\n\n## 安全性验证\n\n当第三方编码代理创建或修改代码时， GitHub 会自动扫描生成的代码以查找安全问题，并尝试在拉取请求完成之前解决这些问题。 这降低了代理引入硬编码机密、不安全依赖项和其他漏洞等问题的可能性。\n\n以下工具和进程扫描安全问题：\n\n* **CodeQLcode scanning** 标识代码安全问题。\n* **Secret scanning** 检测敏感信息，例如 API 密钥、令牌和其他机密。\n* 新引入的依赖项会被检查，对照 **GitHub Advisory Database** 恶意软件公告，以及 CVSS 评级为高或严重的漏洞。\n\n安全验证不需要 GitHub Advanced Security 许可证。\n\n## 使用成本\n\n编码代理消耗**GitHub Actions分钟数**和**AI credits**。 每个代理会话消耗的 AI credits 取决于所使用的模型和处理的令牌数量。\n\n在你包含的 GitHub Actions 分钟和 AI credits 内，你可以随意使用智能体，不会产生额外费用。 请参阅“[Usage-based billing for organizations and enterprises](/zh/enterprise-cloud@latest/copilot/concepts/billing/usage-based-billing-for-organizations-and-enterprises)”。\n\n## 合作伙伴代理\n\n在用户或组织 Copilot cloud agent 设置中启用合作伙伴代理时，将为相应的代理安装一个 GitHub App 。\n\n* **允许 Claude 编码代理** 安装 `anthropic code agent`\n* ```\n            “允许 Codex 编码智能体”选项**** 将安装 `openai code agent`\n  ```\n\n这些 GitHub Apps 的操作将在审核日志中可见，但 GitHub Apps 本身不会在您帐户的 GitHub App 安装列表中显示。\n\n## 后续步骤\n\n* 若要开始管理代理，请参阅 [管理智能体会话](/zh/enterprise-cloud@latest/copilot/how-tos/copilot-on-github/use-copilot-agents/manage-and-track-agents)。\n* 若要了解如何托管和提供 AI 模型，请参阅 [GitHub Copilot 的模型托管](/zh/enterprise-cloud@latest/copilot/reference/ai-models/model-hosting)。"}