app/automations.md +86 −22
2 2
3Automate recurring tasks in the background. Codex adds findings to the inbox, or automatically archives the task if there's nothing to report. You can combine automations with [skills](https://developers.openai.com/codex/skills) for more complex tasks.3Automate recurring tasks in the background. Codex adds findings to the inbox, or automatically archives the task if there's nothing to report. You can combine automations with [skills](https://developers.openai.com/codex/skills) for more complex tasks.
4 4
55Automations run locally in the Codex app. The app needs to be running, and theFor project-scoped automations, the app needs to be running, and the selected
66selected project needs to be available on disk.project needs to be available on disk.
77
88In Git repositories, each automation run starts in a newIn Git repositories, you can choose whether an automation runs in your local
99[worktree](https://developers.openai.com/codex/app/worktrees) so it doesn’t interfere with your mainproject or on a new [worktree](https://developers.openai.com/codex/app/worktrees). Both options run in the
1010checkout. In non-version-controlled projects, automations run directly in thebackground. Worktrees keep automation changes separate from unfinished local
11work, while running in your local project can modify files you are still
12working on. In non-version-controlled projects, automations run directly in the
11project directory.13project directory.
12 14
1315You can also leave the model and reasoning effort on their default settings, or
16choose them explicitly if you want more control over how the automation runs.
17
18
14 19
15## Managing tasks20## Managing tasks
16 21
1722All automations and their runs can be found in the automations pane inside your Codex app sidebar.Find all automations and their runs in the automations pane inside your Codex app sidebar.
18 23
19The "Triage" section acts as your inbox. Automation runs with findings show up there, and you can filter your inbox to show all automation runs or only unread ones.24The "Triage" section acts as your inbox. Automation runs with findings show up there, and you can filter your inbox to show all automation runs or only unread ones.
20 25
2126When an automation runs in a Git repository, Codex uses a dedicated background [worktree](https://developers.openai.com/codex/app/features#worktree-support). In non-version-controlled projects, automations run directly in the project directory. Consider using Git to enable running on background worktrees. You can have the same automation run on multiple projects.Standalone automations start fresh runs on a schedule and report results in
27Triage. Use them when each run should be independent or when one automation
28should run across one or more projects. If you need a custom cadence, choose a
29custom schedule and enter cron syntax.
30
31For Git repositories, each automation can run either in your local project or
32on a dedicated background [worktree](https://developers.openai.com/codex/app/features#worktree-support). Use
33worktrees when you want to isolate automation changes from unfinished local
34work. Use local mode when you want the automation to work directly in your main
35checkout, keeping in mind that it can change files you are actively editing.
36In non-version-controlled projects, automations run directly in the project
37directory. You can have the same automation run on more than one project.
22 38
23Automations use your default sandbox settings. In read-only mode, tool calls fail if they require modifying files, network access, or working with apps on your computer. With full access enabled, background automations carry elevated risk. You can adjust sandbox settings in [Settings](https://developers.openai.com/codex/app/settings) and selectively allowlist commands with [rules](https://developers.openai.com/codex/rules).39Automations use your default sandbox settings. In read-only mode, tool calls fail if they require modifying files, network access, or working with apps on your computer. With full access enabled, background automations carry elevated risk. You can adjust sandbox settings in [Settings](https://developers.openai.com/codex/app/settings) and selectively allowlist commands with [rules](https://developers.openai.com/codex/rules).
24 40
2541To keep automations maintainable and shareable across teams, you can use [skills](https://developers.openai.com/codex/skills) to define the action and provide tools and context to Codex. You can explicitly trigger a skill as part of an automation by using `$skill-name` inside your automation.Automations can use the same plugins and skills available to Codex. To keep
42automations maintainable and shareable across teams, use [skills](https://developers.openai.com/codex/skills)
43to define the action and provide tools and context. You can explicitly trigger a
44skill as part of an automation by using `$skill-name` inside your automation.
45
46## Ask Codex to create or update automations
47
48You can create and update automations from a regular Codex thread. Describe the
49task, the schedule, and whether the automation should stay attached to the
50current thread or start fresh runs. Codex can draft the automation prompt, choose
51the right automation type, and update it when the scope or cadence changes.
52
53For example, ask Codex to remind you in this thread while a deployment finishes,
54or ask it to create a standalone automation that checks a project on a recurring
55schedule.
56
57Skills can also create or update automations. For example, a skill for
58babysitting a pull request could set up a recurring automation that checks the
59PR status with the GitHub plugin and fixes new review feedback.
60
61## Thread automations
62
63Thread automations are heartbeat-style recurring wake-up calls attached to the
64current thread. Use them when you want Codex to keep returning to the same
65conversation on a schedule.
66
67Use a thread automation when the scheduled work should preserve the thread's
68context instead of starting from a new prompt each time.
69
70Thread automations can use minute-based intervals for active follow-up loops,
71or daily and weekly schedules when you need a check-in at a specific time.
72
73Thread automations are useful for:
74
75- checking a long-running command until it finishes
76- polling Slack, GitHub, or another connected source when the results should
77 stay in the same thread
78- reminding Codex to continue a review loop at a fixed cadence
79- running a skill-driven workflow that uses plugins, such as checking PR status
80 and addressing new feedback
81- keeping a chat focused on an ongoing research or triage task
82
83Use a standalone or project automation when each run should be independent,
84when it should run across more than one project, or when findings should appear
85as separate automation runs in Triage.
86
87When you create a thread automation, make the prompt durable. It should
88describe what Codex should do each time the thread wakes up, how to decide
89whether there is anything important to report, and when to stop or ask you for
90input.
26 91
2792## Testing automations safely## Test automations
28 93
29Before you schedule an automation, test the prompt manually in a regular thread94Before you schedule an automation, test the prompt manually in a regular thread
30first. This helps you confirm:95first. This helps you confirm:
31 96
32- The prompt is clear and scoped correctly.97- The prompt is clear and scoped correctly.
3398- The selected model and tools behave as expected.- The selected or default model, reasoning effort, and tools behave as expected.
34- The resulting diff is reviewable.99- The resulting diff is reviewable.
35 100
36101When you start scheduling runs, review the first few outputs closely and adjustWhen you start scheduling runs, review the first few outputs and adjust the
37102the prompt or cadence as needed.prompt or cadence as needed.
38 103
39## Worktree cleanup for automations104## Worktree cleanup for automations
40 105
41106For Git repositories, automations run in worktrees. Frequent schedules canIf you choose worktrees for Git repositories, frequent schedules can create
42107create many worktrees over time. Archive automation runs you no longer need,many worktrees over time. Archive automation runs you no longer need, and avoid
43108and avoid pinning runs unless you intend to keep their worktrees.pinning runs unless you intend to keep their worktrees.
44 109
45## Permissions and security model110## Permissions and security model
46 111
47112Automations are designed to run unattended and use your default sandboxAutomations run unattended and use your default sandbox settings.
48settings.
49 113
50- If your sandbox mode is **read-only**, tool calls fail if they require114- If your sandbox mode is **read-only**, tool calls fail if they require
51 modifying files, accessing network, or working with apps on your computer.115 modifying files, accessing network, or working with apps on your computer.
55 on your computer. You can selectively allowlist commands to run outside the119 on your computer. You can selectively allowlist commands to run outside the
56 sandbox using [rules](https://developers.openai.com/codex/rules).120 sandbox using [rules](https://developers.openai.com/codex/rules).
57- If your sandbox mode is **full access**, background automations carry121- If your sandbox mode is **full access**, background automations carry
58122 elevated risk, as Codex may modify files, run commands, and access network elevated risk, as Codex may change files, run commands, and access network
59 without asking. Consider updating sandbox settings to workspace write, and123 without asking. Consider updating sandbox settings to workspace write, and
60 using [rules](https://developers.openai.com/codex/rules) to selectively define which commands the agent124 using [rules](https://developers.openai.com/codex/rules) to selectively define which commands the agent
61 can run with full access.125 can run with full access.
62 126
63If you are in a managed environment, admins can restrict these behaviors using127If you are in a managed environment, admins can restrict these behaviors using
64admin-enforced requirements. For example, they can disallow `approval_policy = "never"` or constrain allowed sandbox modes. See128admin-enforced requirements. For example, they can disallow `approval_policy = "never"` or constrain allowed sandbox modes. See
65129[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml).[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).
66 130
67Automations use `approval_policy = "never"` when your organization policy131Automations use `approval_policy = "never"` when your organization policy
68132allows it. If `approval_policy = "never"` is disallowed by admin requirements,allows it. If admin requirements disallow `approval_policy = "never"`,
69automations fall back to the approval behavior of your selected mode.133automations fall back to the approval behavior of your selected mode.
70 134
71## Examples135## Examples