app/automations.md +98 −30
1# Automations1# Automations
2 2
33Schedule recurring Codex tasks<div class="feature-grid">
4
5<div>
4 6
5Automate 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.7Automate 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.
6 8
79Automations 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
810selected project needs to be available on disk.project needs to be available on disk.
9 11
1012In Git repositories, each automation run starts in a newIn Git repositories, you can choose whether an automation runs in your local
1113[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
1214checkout. In non-version-controlled projects, automations run directly in thebackground. Worktrees keep automation changes separate from unfinished local
15work, while running in your local project can modify files you are still
16working on. In non-version-controlled projects, automations run directly in the
13project directory.17project directory.
14 18
1519 You can also leave the model and reasoning effort on their default settings, or
20choose them explicitly if you want more control over how the automation runs.
21
22</div>
23
24<CodexScreenshot
25 alt="Automation creation form with schedule and prompt fields"
26 lightSrc="/images/codex/app/codex-automations-light.webp"
27 darkSrc="/images/codex/app/codex-automations-dark.webp"
28 maxHeight="400px"
29/>
16 30
1731 </div>
18 32
19## Managing tasks33## Managing tasks
20 34
2135All 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.
22 36
23The "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.37The "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.
24 38
2539When 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
40Triage. Use them when each run should be independent or when one automation
41should run across one or more projects. If you need a custom cadence, choose a
42custom schedule and enter cron syntax.
43
44For Git repositories, each automation can run either in your local project or
45on a dedicated background [worktree](https://developers.openai.com/codex/app/features#worktree-support). Use
46worktrees when you want to isolate automation changes from unfinished local
47work. Use local mode when you want the automation to work directly in your main
48checkout, keeping in mind that it can change files you are actively editing.
49In non-version-controlled projects, automations run directly in the project
50directory. You can have the same automation run on more than one project.
26 51
27Automations 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).52Automations 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).
28 53
2954To 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
55automations maintainable and shareable across teams, use [skills](https://developers.openai.com/codex/skills)
56to define the action and provide tools and context. You can explicitly trigger a
57skill as part of an automation by using `$skill-name` inside your automation.
58
59## Ask Codex to create or update automations
60
61You can create and update automations from a regular Codex thread. Describe the
62task, the schedule, and whether the automation should stay attached to the
63current thread or start fresh runs. Codex can draft the automation prompt, choose
64the right automation type, and update it when the scope or cadence changes.
65
66For example, ask Codex to remind you in this thread while a deployment finishes,
67or ask it to create a standalone automation that checks a project on a recurring
68schedule.
69
70Skills can also create or update automations. For example, a skill for
71babysitting a pull request could set up a recurring automation that checks the
72PR status with the GitHub plugin and fixes new review feedback.
73
74## Thread automations
75
76Thread automations are heartbeat-style recurring wake-up calls attached to the
77current thread. Use them when you want Codex to keep returning to the same
78conversation on a schedule.
30 79
3180## Testing automations safelyUse a thread automation when the scheduled work should preserve the thread's
81context instead of starting from a new prompt each time.
82
83Thread automations can use minute-based intervals for active follow-up loops,
84or daily and weekly schedules when you need a check-in at a specific time.
85
86Thread automations are useful for:
87
88- checking a long-running command until it finishes
89- polling Slack, GitHub, or another connected source when the results should
90 stay in the same thread
91- reminding Codex to continue a review loop at a fixed cadence
92- running a skill-driven workflow that uses plugins, such as checking PR status
93 and addressing new feedback
94- keeping a chat focused on an ongoing research or triage task
95
96Use a standalone or project automation when each run should be independent,
97when it should run across more than one project, or when findings should appear
98as separate automation runs in Triage.
99
100When you create a thread automation, make the prompt durable. It should
101describe what Codex should do each time the thread wakes up, how to decide
102whether there is anything important to report, and when to stop or ask you for
103input.
104
105## Test automations
32 106
33Before you schedule an automation, test the prompt manually in a regular thread107Before you schedule an automation, test the prompt manually in a regular thread
34first. This helps you confirm:108first. This helps you confirm:
35 109
36- The prompt is clear and scoped correctly.110- The prompt is clear and scoped correctly.
37111- The selected model and tools behave as expected.- The selected or default model, reasoning effort, and tools behave as expected.
38- The resulting diff is reviewable.112- The resulting diff is reviewable.
39 113
40114When you start scheduling runs, review the first few outputs closely and adjustWhen you start scheduling runs, review the first few outputs and adjust the
41115the prompt or cadence as needed.prompt or cadence as needed.
42 116
43## Worktree cleanup for automations117## Worktree cleanup for automations
44 118
45119For Git repositories, automations run in worktrees. Frequent schedules canIf you choose worktrees for Git repositories, frequent schedules can create
46120create many worktrees over time. Archive automation runs you no longer need,many worktrees over time. Archive automation runs you no longer need, and avoid
47121and avoid pinning runs unless you intend to keep their worktrees.pinning runs unless you intend to keep their worktrees.
48 122
49## Permissions and security model123## Permissions and security model
50 124
51125Automations are designed to run unattended and use your default sandboxAutomations run unattended and use your default sandbox settings.
52settings.
53 126
54- If your sandbox mode is **read-only**, tool calls fail if they require127- If your sandbox mode is **read-only**, tool calls fail if they require
55 modifying files, accessing network, or working with apps on your computer.128 modifying files, accessing network, or working with apps on your computer.
59 on your computer. You can selectively allowlist commands to run outside the132 on your computer. You can selectively allowlist commands to run outside the
60 sandbox using [rules](https://developers.openai.com/codex/rules).133 sandbox using [rules](https://developers.openai.com/codex/rules).
61- If your sandbox mode is **full access**, background automations carry134- If your sandbox mode is **full access**, background automations carry
62135 elevated risk, as Codex may modify files, run commands, and access network elevated risk, as Codex may change files, run commands, and access network
63 without asking. Consider updating sandbox settings to workspace write, and136 without asking. Consider updating sandbox settings to workspace write, and
64 using [rules](https://developers.openai.com/codex/rules) to selectively define which commands the agent137 using [rules](https://developers.openai.com/codex/rules) to selectively define which commands the agent
65 can run with full access.138 can run with full access.
66 139
67If you are in a managed environment, admins can restrict these behaviors using140If you are in a managed environment, admins can restrict these behaviors using
68141admin-enforced requirements. For example, they can disallow `approval_policy = "never"` or constrain allowed sandbox modes. Seeadmin-enforced requirements. For example, they can disallow `approval_policy =
69142[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml)."never"` or constrain allowed sandbox modes. See
143[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).
70 144
71Automations use `approval_policy = "never"` when your organization policy145Automations use `approval_policy = "never"` when your organization policy
72146allows it. If `approval_policy = "never"` is disallowed by admin requirements,allows it. If admin requirements disallow `approval_policy = "never"`,
73automations fall back to the approval behavior of your selected mode.147automations fall back to the approval behavior of your selected mode.
74 148
75## Examples149## Examples
174```markdown248```markdown
175Check my commits from the last 24h and submit a $recent-code-bugfix.249Check my commits from the last 24h and submit a $recent-code-bugfix.
176```250```
177
178[Previous
179
180Review](https://developers.openai.com/codex/app/review)[Next
181
182Worktrees](https://developers.openai.com/codex/app/worktrees)