AI 程式設計教程中文版
官方教程中文版安全與企業

安全與企業

Gemini CLI 安全與企業入口:sandbox、policy engine、企業配置、企業控制、telemetry、terms/privacy 和 Google Cloud 安全合規。

Gemini CLI 能讀專案、改檔案、跑命令、聯網、接 MCP、進入 GitHub 自動化。進入真實專案和團隊環境前,必須先看安全與企業邊界。

越像 agent,越要有邊界:許可權、sandbox、policy、telemetry、憑據和 Cloud 專案不是附錄,是能否進真實專案的前提。

本章的主線是三層控制:trusted folder 決定是否載入專案能力,sandbox 控制執行環境,policy 和 enterprise controls 控制工具和組織策略。三層缺一層,真實專案都會留下明顯空洞。

學習路徑

flowchart LR
    Sandbox["Sandbox"] --> Policy["Policy engine"]
    Policy --> Config["Enterprise config"]
    Config --> Controls["Admin controls"]
    Controls --> Telemetry["Telemetry"]
    Telemetry --> Privacy["Terms / Privacy"]
    Privacy --> Cloud["Cloud security"]
    Cloud --> Automation["整合與自動化"]

    style Sandbox fill:#dbeafe,stroke:#3b82f6
    style Policy fill:#fee2e2,stroke:#ef4444
    style Cloud fill:#dcfce7,stroke:#22c55e

頁面清單

頁面解決的問題
Sandbox隔離工具執行和未知程式碼風險
Policy engine細粒度控制工具、命令和引數
Enterprise config系統級 settings、組織預設和 CI 隔離
Enterprise controlsAdmin Controls、MCP allowlist、required servers
Telemetrylogs、metrics、traces 和 prompt 記錄邊界
Terms and privacy不同認證路徑對應的資料和條款
Cloud security/privacy/complianceGoogle Cloud、IAM、審計和合規核對

下一步

先讀:Sandbox

章節驗收

讀完本章後,應該能完成兩個負例測試:不可信目錄不載入專案 MCP,高風險 shell 命令被 policy 攔截。再完成一個正例測試:受控 MCP 或 telemetry 能按企業配置出現。只有正負例都透過,安全配置才算可上線。

如果只能做一件事,先做負例。安全配置最怕“看起來已經開啟”,但真正危險動作仍能執行。負例透過後,再擴充套件正例和團隊 rollout。

官方來源

本頁目錄