让 Codex 操作电脑
在 Codex App 中,Computer Use 目前可用于 macOS。launch 时不面向 European Economic Area、United
在 Codex App 中,Computer Use 目前可用于 macOS。launch 时不面向 European Economic Area、United Kingdom 和 Switzerland 提供。
使用前需要安装 Computer Use plugin,并在 macOS 提示时授予:
- Screen Recording
- Accessibility
有了 computer use,Codex 可以在 macOS 上看见并操作 graphical user interfaces。它适合 command-line tools 或 structured integrations 不够用的任务,例如检查 desktop app、使用 browser、修改 app settings、处理没有 plugin 的 data source,或复现只发生在 GUI 中的 bug。
由于 computer use 可能影响 project workspace 外的 app 和 system state,任务要保持清晰边界,并在继续前 review permission prompts。
Set up computer use
设置步骤:
- 在 Codex settings 中打开 Computer Use。
- 点击 Install 安装 Computer Use plugin。
- 当 macOS 请求 access 时,如果你希望 Codex 看见并操作目标 app,授予 Screen Recording 和 Accessibility permissions。
权限含义:
| Permission | 用途 |
|---|---|
| Screen Recording | 让 Codex 看见 target app。 |
| Accessibility | 让 Codex click、type 和 navigate。 |
When to use computer use
当任务依赖 graphical user interface,并且仅靠 files 或 command output 很难验证时,选择 computer use。
适合场景:
- 测试 macOS app、iOS simulator flow,或 Codex 正在构建的其他 desktop app。
- 执行需要 web browser 的任务。
- 复现只出现在 graphical interface 中的 bug。
- 修改必须点击 UI 才能完成的 app settings。
- 检查 app 或 data source 中的信息,而这些信息没有 plugin 可用。
- 让一个 scoped task 在后台运行,你继续处理其他工作。
- 执行跨多个 apps 的 workflow。
如果你构建的是本地 web app,优先使用 in-app browser。
Start a computer use task
在 prompt 中提到 @Computer Use 或 @AppName,也可以直接要求 Codex 使用 computer use。你需要描述 Codex 应该操作的具体 app、window 或 flow。
Open the app with computer use, reproduce the onboarding bug, and fix the
smallest code path that causes it. After each change, run the same UI flow
again.Open @Chrome and verify the checkout page still works after the latest changes.如果 target app 已经有 dedicated plugin 或 MCP server,优先使用这种 structured integration 来访问数据和执行可重复操作。只有当 Codex 需要视觉检查或直接操作 app 时,再选择 computer use。
Permissions and approvals
macOS system permissions 和 Codex app approvals 是两套机制。
| 机制 | 控制内容 |
|---|---|
| macOS system permissions | 允许 Codex 看见并操作 apps。 |
| Codex app approvals | 决定你允许 Codex 使用哪些 apps。 |
| Thread sandbox / approvals | file reads、file edits 和 shell commands 仍然遵循 thread 的 sandbox 与 approval settings。 |
使用 computer use 时,Codex 只能看见并操作你允许的 apps。任务期间,Codex 在使用某个 app 前会向你请求 permission。你可以选择 Always allow,让 Codex 后续无需再次询问即可使用这个 app。
要移除已允许的 apps,进入 Codex settings 的 Computer Use section,从 Always allow list 中删除。
官方截图:
- light:https://developers.openai.com/images/codex/app/computer-use-approval-light.webp
- dark:https://developers.openai.com/images/codex/app/computer-use-approval-dark.webp
Codex 在执行 sensitive 或 disruptive actions 前,也可能再次请求 permission。
如果 Codex 看不见或无法控制某个 app,打开 macOS:
System Settings > Privacy & Security检查 Codex App 的 Screen Recording 和 Accessibility permissions。
Safety guidance
使用 computer use 时,Codex 可以查看 screen content、截图,并和 target app 中的 windows、menus、keyboard input、clipboard state 交互。
把这些内容都当作 Codex 任务期间可能处理的 context:
- visible app content
- browser pages
- screenshots
- target app 中打开的 files
安全使用建议:
- 每次只给 Codex 一个明确 target app 或 flow。
- 你可以随时停止任务,或接管电脑。
- 不需要的 sensitive apps 保持关闭。
- 避免让任务依赖 secrets;如果确实需要,你要在场并逐步 approve。
- allow Codex 使用 app 前,先 review app permission prompts。
- Always allow 只用于你信任 Codex 未来自动使用的 apps。
- account、security、privacy、network、payment 或 credential-related settings 相关操作,你要保持在场。
- 如果 Codex 开始操作错误 window,取消任务。
如果 Codex 使用你的 browser,它可以操作你已经登录的 pages。review website actions 时,把它当作你本人正在操作:web pages 可能包含恶意或误导内容,网站也可能把你 approve 的 clicks、form submissions 和 signed-in actions 当成来自你的账号。你希望自己继续使用 browser 时,让 Codex 使用另一个 browser。
该功能不能 automate terminal apps 或 Codex itself,因为这可能绕过 Codex security policies。它也不能以 administrator 身份认证,不能替你批准电脑上的 security 和 privacy permission prompts。
File edits 和 shell commands 在适用时仍然遵循 Codex approval 与 sandbox settings。通过 desktop apps 做出的 changes,只有在保存到磁盘并被 project 跟踪后,才可能出现在 review pane 中。
你的 ChatGPT data controls 适用于通过 Codex 处理的内容,包括 computer use 截取的 screenshots。