Agent 设置

本页目录

Configure how the Antigravity agent executes terminal commands, modifies files, and uses the terminal sandbox across the desktop application and CLI.

Antigravity App

更新后的权限设置

权限设置

此设置控制如何使用 权限预设 批准 Agent 操作(终端命令、文件访问、MCP 工具和网页读取):

  • Request Review (“Every command requires approval.”): The sandbox is off and every terminal command requires approval. The agent can read and write the workspace, and needs approval for anything else.
  • Default(“在执行敏感操作前询问。”;默认):命令在终端沙箱内运行时不会弹出提示;在沙箱外运行则需要获得批准。Agent 可以读写工作区和临时目录,执行其他任何操作都需要获得批准。
  • Auto(“自动决定是否运行命令。”):命令在终端沙箱内运行时无需提示,且 Agent 可以直接读写工作区和临时目录而无需询问。当命令需要在沙箱外运行时,Antigravity 会自动评估该命令,使安全、可逆的命令无需提示即可继续执行,而存在风险或不可逆的操作仍会暂停并等待您的批准。
  • Turbo (“Run all commands without restrictions.”): All commands run without prompting with no isolation or restrictions, and the agent has full read and write access to your filesystem.

您配置的允许、拒绝和询问权限规则位于预设之上,并且始终优先。要了解更多信息,请参阅 Agent 权限。

更改权限预设

You can change the preset in three places:

  • 所有项目:打开 Settings > General > Global Permissions > Permission Preset(如果您可以使用远程 Agent,则为 Permissions > This Computer)。
  • For a single project: Override the global preset under Settings > Projects. Projects default to Inherit Global, which follows your global preset.
  • From the message box (v2.23.0+): Choose a preset from the permissions picker. The picker changes your global preset, or the project’s preset if the project overrides it. To remove a project override, choose Use Global Settings.

For screenshots of the Settings selector and the message box picker, refer to Change your permission preset.

旧版权限设置

终端命令自动执行

此设置控制 Agent 如何执行生成的 shell 命令:

  • Require Review: The agent never executes terminal commands without prompting (except those explicitly added to your configurable Allow list).
  • 在沙箱中继续:终端沙箱内部无提示运行命令;需要在其外部运行的命令仍然需要审查。
  • 始终继续:Agent 执行命令而不提示(明确添加到可配置拒绝列表中的命令除外)。

Agent 非工作区文件访问

此设置允许 Agent 查看和编辑活动项目文件夹之外的文件:

  • 默认情况下,Agent 只能访问项目内的文件夹和应用程序的本地应用程序数据目录 ~/.gemini/antigravity/(其中包含产物、知识项等)。
  • 强制执行此边界可以保护您的本地敏感数据。谨慎启用非工作空间访问。

终端沙箱模式

此设置将 Agent 终端命令限制在隔离的沙箱中:

  • 启用后,shell 命令在沙箱内执行,而无需访问敏感系统路径或未经授权的网络。
  • 您可以在应用程序首选项中全局配置此设置或按项目覆盖它。
  • 要了解更多信息,请参阅 终端沙箱 指南。