# Secure code from an agent's first commit to production

AI agents ship code faster than security teams can review it by hand. GitHub closes that gap with security built into every stage of the software development lifecycle, from local review to organization-wide detection and automated remediation, all without leaving GitHub.

## Links

### Review an agent's changes before you push

* [使用 GitHub MCP 服务器扫描机密](/zh/enterprise-cloud@latest/code-security/how-tos/use-ghas-with-ai-coding-agents/scan-for-secrets-with-github-mcp-server)

  在它们到达存储库之前，实时从您的 AI 编码代理中检测暴露的机密。

* [在 GitHub Copilot 应用中查看和修复安全警报](/zh/enterprise-cloud@latest/copilot/how-tos/github-copilot-app/view-and-fix-security-alerts)

  使用适用于code scanning的GitHub Copilot app安全扩展与代码一起处理GitHub警报。

### Stop leaked credentials before they reach your repository

* [推送保护](/zh/enterprise-cloud@latest/code-security/concepts/secret-security/push-protection)

  通过推送保护阻止机密到达存储库，从而保护机密。

* [为 AI 检测到的机密启用推送保护](/zh/enterprise-cloud@latest/code-security/how-tos/secure-your-secrets/prevent-future-leaks/enable-ai-push-protection)

  阻止包含使用 AI 找到的密码和其他非结构化机密的推送。

### Detect vulnerabilities at scale with hybrid detection

* [代码扫描](/zh/enterprise-cloud@latest/code-security/concepts/code-scanning/code-scanning)

  您可以使用 code scanning 在项目 GitHub 的代码中查找安全漏洞和错误。

* [存储库积压工作的 AI 扫描](/zh/enterprise-cloud@latest/code-security/concepts/code-scanning/ai-scan-for-repositories)

  查找跨语言的其他安全漏洞，并在现有 code scanning 待办事项中管理结果。

* [用于拉取请求的 AI 扫描](/zh/enterprise-cloud@latest/code-security/concepts/code-scanning/ai-powered-security-detections)

  AI 扫描使用基于 AI 的扫描引擎来查找拉取请求中未涵盖 CodeQL的语言和框架的安全漏洞。

* [为您的组织执行代码安全风险评估](/zh/enterprise-cloud@latest/code-security/how-tos/secure-at-scale/configure-organization-security/configure-specific-tools/assess-your-vulnerability-risk)

  通过生成 code security risk assessment 报告来确定组织对漏洞的暴露。

### Define and enforce the rules for merging code

* [为企业建立治理框架](/zh/enterprise-cloud@latest/admin/overview/establishing-a-governance-framework-for-your-enterprise)

  可以使用可用的 GitHub Enterprise功能和工具管理企业的治理和合规性。

* [管理组织中存储库的自定义属性](/zh/enterprise-cloud@latest/organizations/managing-organization-settings/managing-custom-properties-for-repositories-in-your-organization)

  借助自定义属性，可将元数据添加到组织中的存储库。 可以使用这些属性将包含规则集的存储库作为目标。

* [设置代码扫描合并保护](/zh/enterprise-cloud@latest/code-security/how-tos/find-and-fix-code-vulnerabilities/manage-your-configuration/set-merge-protection)

  通过阻止未通过code scanning检查的拉取请求来保护代码库。

### Resolve alerts with draft pull requests

* [关于代码扫描的自动修复](/zh/enterprise-cloud@latest/code-security/concepts/code-scanning/autofix-for-code-scanning)

  Autofix 会生成针对 code scanning 告警的潜在修复建议，帮助你修正现有漏洞。

* [解决代码扫描警报](/zh/enterprise-cloud@latest/code-security/how-tos/manage-security-alerts/manage-code-scanning-alerts/resolve-alerts)

  从安全视图中，你可以查看、修复或忽略项目代码中潜在漏洞或错误的警报。

* [关于安全性活动](/zh/enterprise-cloud@latest/code-security/concepts/security-at-scale/about-security-campaigns)

  可通过创建安全性活动并与开发人员协作来大规模修复安全性警报，以减少安全性积压工作。

### Go beyond security to code quality

* [关于 GitHub 代码质量](/zh/enterprise-cloud@latest/get-started/learning-about-github/about-github-code-quality)

  确定GitHub Code Quality是否满足团队的需求、GitHub Code Quality 如何补充其他 GitHub 产品，以及购买前要考虑什么。

* [启用 GitHub Code Quality](/zh/enterprise-cloud@latest/code-security/how-tos/maintain-quality-code/enable-code-quality)

  启用Code Quality，为您的团队建立一致的质量基线：在拉取请求中以及默认分支上自动发现、修复并报告代码质量问题。