by Akimiya-z
Quality gate for AI/Codex-generated pull requests: blocks TODO leftovers, leaked secrets, sloppy commits and red CI before they reach main.
# Add to your Claude Code skills
git clone https://github.com/Akimiya-z/codex-guardcodex-guard is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Akimiya-z. Quality gate for AI/Codex-generated pull requests: blocks TODO leftovers, leaked secrets, sloppy commits and red CI before they reach main. It has 50 GitHub stars.
codex-guard's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Akimiya-z/codex-guard" and add it to your Claude Code skills directory (see the Installation section above).
codex-guard is primarily written in JavaScript. It is open-source under Akimiya-z on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh codex-guard against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
โ ๏ธ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Docs site: https://akimiya-z.github.io/codex-guard
An automatic quality gate for AI-generated pull requests. Stop TODO leftovers,
leaked secrets, sloppy commits and red CI from reaching main โ with zero review
bandwidth spent on the obvious stuff.
Works with OpenAI Codex (cloud & CLI), Claude Code, Copilot, and any other agent that opens PRs against your repo.
๐ Dogfooding: this repo gates its own AI-generated PRs. See a real failing example on PR #6 and the workflow behind it in
.github/workflows/codex-guard.yml.
AI coding agents are great at writing code and terrible at cleaning up after themselves. In practice, agent-written PRs tend to arrive with the same handful of problems:
// TODO: handle this comments that were never meant to stayWIP, fix stuff, more changes โ squashed versions of
a messy sessionYou shouldn't need a human reviewer to catch those every single time. Codex Guard checks the boring, deterministic things automatically, and only on PRs that look AI-generated โ so human attention goes where it matters.
Codex Guard runs on pull_request, figures out whether the PR looks
agent-generated (via label, branch prefix, or title), and then:
| Check | What it flags |
|---|---|
| ๐งน TODO scan | TODO / FIXME / XXX / HACK / WIP markers on added lines only |
| ๐ Secret scan | AWS (access + secret keys), GitHub, Google, OpenAI, Anthropic, Slack, Stripe, npm, SendGrid, Telegram, Azure connection strings, JWTs, hardcoded credentials, connection strings (values are redacted in reports) |
| ๐ฌ Commit hygiene | Subjects that don't match conventional commits, empty subjects |
| ๐งช CI status | Failing status checks or check runs on the PR head commit |
Each finding is posted as a GitHub check-run annotation at the exact file and line, plus a human-readable summary comment on the PR.
GitHub sometimes omits the textual patch for binary or very large files. Codex Guard now distinguishes no findings from not scanned: every report shows the number of eligible changed files whose patches were actually inspected. A missing patch produces a neutral, non-blocking coverage warning with the affected paths; the JSON and Action outputs carry the same information. The warning also appears when GitHub's pull-request files API reaches its documented 3,000-file limit.
The output below comes from a real run on this repo
(PR #6) โ a deliberate test
PR from a codex/ branch that left a TODO, credential-shaped fixtures and two
sloppy commits. Secret-shaped values are redacted here just as they are in
current reports:
## ๐ค Codex Guard
โ **Checks failed โ review the findings before merging.**
| Check | Result |
| --- | --- |
| TODO / FIXME scan | โ ๏ธ 2 |
| Secret scan | โ ๏ธ 3 |
| Commit hygiene | โ ๏ธ 2 |
| CI status | โ
|
**Unfinished work**
- `scripts/sync.js:4` โ `FIXME`: const aws = 'AKIA...MPLE'; // FIXME: move this to a secret store
- `scripts/sync.js:2` โ `TODO`: // TODO: wire up real retry with exponential backoff.
**Potential leaked secrets**
- `scripts/sync.js:4` โ AWS Access Key ID `AKIA...MPLE`
- `scripts/sync.js:5` โ Connection string `post...prod`
- `scripts/sync.js:7` โ OpenAI API Key `sk-p...6789`
**Commit hygiene**
- `7c84ae1` โ _WIP stuff_ (by Akimiya-z)
- `1affcf8` โ _tmp_ (by Akimiya-z)
> Detected as an AI-generated PR (branch prefix "codex/").
From the root of your Git repository:
npx --yes codex-guard init
git add .github/workflows/codex-guard.yml
git commit -m "ci: add Codex Guard"
The installer starts in observe mode: findings are annotated, but they do not fail the workflow while you tune the policy. Three setup presets keep the rollout explicit:
| Preset | Command | Behavior |
|---|---|---|
| Observe | npx --yes codex-guard init |
Report everything without blocking. |
| Balanced | npx --yes codex-guard init --preset balanced |
Block secrets, commit hygiene, and red CI; warn on unfinished markers. |
| Strict | npx --yes codex-guard init --preset strict |
Block every default finding. --strict remains an alias. |
Prefer to add it by hand? The generated workflow is:
# Generated by codex-guard init
name: Codex Guard
on:
pull_request:
permissions:
contents: read
statuses: read
pull-requests: write
checks: write
jobs:
codex-guard:
runs-on: ubuntu-latest
steps:
- uses: Akimiya-z/codex-guard@v1
with:
preset: 'observe'
That's it. Codex Guard now reports on matching PRs without blocking them.
Upgrading an existing workflow? Add
statuses: readto itspermissionsblock.checks: writealready includes read access for check runs. Without status access, Codex Guard reports incomplete CI visibility and returns a neutral result instead of claiming every check is green.
One-click from the GitHub Actions Marketplace.
After a few representative PRs, choose how strongly to enforce:
- uses: Akimiya-z/codex-guard@v1
with:
preset: 'balanced' # or 'strict'
balanced warns on unfinished markers while blocking secrets, commit hygiene,
and red CI. strict blocks every default finding. For a custom mix, use
fail-on and the individual inputs. Then require the status check under
Settings โ Branches โ Require status checks โ Codex Guard. A blocking
finding will prevent the PR from merging until it is resolved (or the PR is
marked with an ignore label โ see "Opting out").
By default Codex Guard only gates PRs it believes were written by an agent, so human-authored PRs are never slowed down:
codex-generated, agentic, ai-generatedcodex/, copilot/, claude-auto, gh-codex/Generated by Codex, Generated by Claude, Generated by CopilotAll of these are configurable โ or set gate-agents-only: false to gate every PR.
Add a label named codex-guard-ignore (configurable) to a PR and Codex Guard
will pass it without running checks. Useful when a human has already reviewed
and accepted the changes.
| Input | Default | Description |
|---|---|---|
preset |
(empty) | Policy baseline: observe, balanced, or strict. Empty preserves the pre-preset behavior. Repository policy can override it. |
github-token |
${{ github.token }} |
Token with write access to checks and PRs. |
gate-agents-only |
true |
Only gate PRs detected as agent-generated. |
agent-labels |
codex-generated,agentic,ai-generated |
Labels marking an agent PR. |
agent-branch-prefixes |
codex/,copilot/,claude-auto,gh-codex/ |
Branch prefixes marking an agent PR. |
agent-keywords |
Generated by Codex,Generated by Claude,Generated by Copilot |
Title keywords marking an agent PR. |
ignore-label |
codex-guard-ignore |
PR label that skips all checks. |
check-todos |
true |
Scan added lines for unfinished-work markers. |
todo-patterns |
TODO,FIXME,XXX,HACK,WIP |
Markers to flag. |
todo-blocking |
true |
Fail on TODO findings (false = warn only). |
check-secrets |
true |
Scan added lines for hardcoded secrets. |
secret-exclude-paths |
(empty) | File path substrings to skip (e.g. README,test/fixtures). |
check-commits |
true |
Validate commit subjects. |
commit-pattern |
conventional commit regex | Regex subjects must match. |
check-ci |
true |
Fail on failing CI for the head commit. |
ignore-check-run-names |
(empty) | Check/context names to ignore when assessing CI. |
post-comment |
true |
Post a report comment on failures. |
comment-mode |
replace |
replace updates the previous report in place (one comment per PR), append posts a new one each run, none never posts. |
request-changes |
false |
Also submit a formal REQUEST_CHANGES review on blocking findings (opt-in; needs pull-requests: write). |
notify-users |
(empty) | Comma-separated usernames to @-mention in the report comment on blocking findings. |
soft-fail |
false |
Report findings with a neutral check-run but never fail the workflow. |
config-path |
.github/codex-guard.yml |
Optional per-repo policy file (on the default branch) overriding workflow inputs. |
fail-on |
(empty) | Comma-separated blocking checks: todos,secrets,commits,ci. Empty = legacy behavior; a subset makes excluded checks non-blocking. |
sweep |
false |
Scan every open agent PR instead of a single one (use with workflow_dispatch). |
sweep-label |
(empty) | Only sweep PRs carrying this label. |
sweep-base |
main |
Only sweep PRs targeting this base branch. |
Codex Guard reads both commit statuses and check runs, follows every results page up to GitHub's 3,000-re