Repository navigation
feat(install): pre-approve airc command prefix in Codex via [rules] block — final piece for friction-free Codex - #375
Merged
Conversation
…lock (closes the per-command-approval gate finding)
Codex's per-command approval gate doesn't just control prompts — it
ALSO restricts network access for un-approved commands. A command not
in the user's "always run commands starting with X" allowlist runs in
a stricter sandbox where its gh API calls are blocked silently.
Joel's Codex first-encounter QA caught this live: `airc join` had
been pre-approved earlier so its gh calls reached the network, but
`airc msg` hadn't, so its gh calls hit the network sandbox and
failed. Codex prompted the user to "always run commands that start
with airc msg" and once approved, it worked instantly. Same for
every other airc verb (status, peers, etc) until each was
approved.
That's friction. Codex docs (config-reference) document a [rules]
block with prefix_rules for declaring approved command prefixes
statically. install.sh now writes a marker-bracketed block to
~/.codex/config.toml that pre-approves ALL `airc *` verbs at once:
[rules]
prefix_rules = [
{ pattern = [{ token = "airc" }], decision = "allow" }
]
Net: user installs Codex + runs install.sh + restarts Codex → every
airc verb works without per-command approval prompts, even on first
encounter.
Idempotent: grep guard on AIRC-COMMAND-RULES-START marker, no
duplicate writes.
uninstall.sh: matching cleanup strips the marker-bracketed block
when airc is removed (paired with the GH_TOKEN block strip already
in place).
Honors AIRC_SKIP_CODEX_RULES=1 if user wants to manage approvals
interactively (matches AIRC_SKIP_CODEX_TOKEN / _CONFIG patterns).
README: full section explaining what the gate is, why it bites,
how the [rules] block solves it, and how the three Codex-side
auto-config layers (network permission profile + GH_TOKEN
injection + command-rule pre-approval) compose into a friction-free
Codex airc surface.
Tested on this Mac:
- install.sh wrote the block once + Codex starts clean
- re-run no-op (idempotent)
- bash -n syntax check passes for both install.sh + uninstall.sh
Joel's framing: "if we get this, we can now have codex and decent
claude code airc, fairly reliable into main." This PR is that "this."
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the per-command-approval-gate finding that Codex's deep diagnostic surfaced in tonight's QA. With this merged, every Codex Carl gets a friction-free airc surface from first install — no per-command approval prompts, no manual flag-passing.
What Codex's diagnostic uncovered
Codex's per-command approval gate also restricts network access, not just prompts. A command not in the user's "always run commands starting with X" allowlist runs in a stricter sandbox where its gh API calls are blocked silently. The pattern:
The fix
Codex's `[rules]` block (per config-reference docs) lets us declare approved command prefixes statically:
```toml
AIRC-COMMAND-RULES-START — managed by install.sh; pre-approves all
airc *commands so they aren't blocked by Codex's per-command approvalgate (which also restricts network access for un-approved commands).
[rules]
prefix_rules = [
{ pattern = [{ token = "airc" }], decision = "allow" }
]
AIRC-COMMAND-RULES-END
```
install.sh writes this idempotently to `~/.codex/config.toml` whenever Codex is detected. uninstall.sh strips it. `AIRC_SKIP_CODEX_RULES=1` opts out.
Three Codex-side auto-config layers now compose
User installs Codex + runs install.sh + restarts Codex → friction-free airc on first try.
Tested on this Mac
Joel's framing
This PR is that "this." After merge, the Codex story is shippable end-to-end without the per-command friction we hit tonight.
Followup
🤖 Generated with Claude Code