"Automations" don't seem to properly respect the Rules

Open 💬 6 comments Opened Feb 4, 2026 by benglewis
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 260203.1501 (523)

What subscription do you have?

Business

What issue are you seeing?

Commands run via Automation locally are not properly evaluated against Rules, but instead are run in the sandbox and, as such, fail.

What steps can reproduce the bug?

When creating an Automation in the "Automations", and asking the Automation to run a command which is explicitly allowed in a Rule in the repository, it does not actually succeed in running the command (which requires network access), instead the command is run inside the sandbox (with no network access) and fails. The command I used was UV_CACHE_DIR=/tmp/uv-cache uv run pip-audit, but I believe that any command will reproduce the issue.

What is the expected behavior?

Just like in the Codex CLI, which works, the commands run should be checked against the Rules and if they are allowed under the rules, they should be allowed to run outside the sandbox.

Additional information

_No response_

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 5 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #10616
  • #10612
  • #10610

Powered by Codex Action

etraut-openai contributor · 5 months ago

Thanks for the bug report. Are you able to run the same command successfully in a normal thread in the app, a thread that's not started via an automation?

benglewis · 5 months ago

So interestingly, when I try to run it in a normal thread, I get prompted whether or not to approve network access (this despite the rule explicitly allowing running this command outside the sandbox). So I guess this is two bugs:

  1. The Codex application doesn't seem to respect Rules created in .codex/rules/my-thing.rules.
  2. The Codex application's "Automations" don't prompt for network access when a regular thread would.

Does that make sense?

Since there isn't anything particularly special / secret / interesting about my code here, I can share a snippet:

My .codex/rules/pip-audit.rules file:

prefix_rule(
    pattern = ["UV_CACHE_DIR=/tmp/uv-cache", "uv", "run", "pip-audit"],
    decision = "allow",
    justification = "pip-audit is allowed to run",
    match = [
        "'UV_CACHE_DIR=/tmp/uv-cache' uv run pip-audit",
    ],
    not_match = [
        "uv run abc",
        "uv run pip-audit",
        "uvx pip-audit",
    ],
)

My prompt:

Run `UV_CACHE_DIR=/tmp/uv-cache uv run pip-audit`
If there are vulnerabilities, please fix them.
If there aren't, exit and note that

Other than having a venv created with uv and having pip-audit installed in that venv, I don't think that there is anything specific to our codebase, but since that codebase is open source anyway, here is the branch I was testing this from: https://github.com/Hirundo-io/hirundo-python-sdk/tree/sdk-87-allow-codex-to-run-pip-audit-and-fix-vulnerabilities

Weirdly, I just upgraded to Codex CLI version 0.96.0 and it also doesn't seem to run the command automatically, but prompts for whether to allow network access... so maybe something changed that affects both Codex app and Codex CLI recently?

radvansky-tomas · 4 months ago

same issue here...automation dont have network/fetch access...but moment you continue conversation it works

stephengilroy-grx · 4 months ago

Also seeing this issue. @etraut-openai do you need more info on this to debug this?

benglewis · 4 months ago

@etraut-openai Is it worth trying to ask Codex to debug this issue in the Codex App and fix it? :P
If so, I'd happy to give it a try