Appearance
Agent 审批与安全
Codex 使用分层审批策略来控制 Agent 在何时可以执行敏感操作。
审批模式
Codex 提供三种审批模式:
- Chat(对话模式):Codex 在每次操作前都向你请求批准
- Agent(Agent 模式):Codex 可以在工作区中读写文件,但敏感操作需要批准
- Agent (Full Access)(完全访问模式):Codex 拥有完全的文件系统访问权限
安全模型
Codex 使用沙箱来隔离 Agent 操作,限制文件系统访问范围。沙箱有三种模式:
- read-only(只读):只能读取文件,不能写入或执行
- workspace-write(工作区可写):可以修改当前工作区中的文件
- danger-full-access(完全访问):不受限制的读写执行
审批策略配置
审批策略可以在 config.toml 中配置。
toml
[agent]
approval_policy = "default" # 或 "permissive" 或 "strict"