Codex Collector
Detects OpenAI Codex CLI invocations in CI pipelines. Records command strings, versions, and flags for policy-level analysis. Writes to ai.native.codex under the unified ai.* namespace.
codex to your lunar-config.yml:uses: github://earthly/lunar-lib/collectors/codex@v1.0.5
What This Integration Collects
This integration includes 2 collectors that gather metadata from your systems.
instruction-file
Discovers CODEX.md instruction files across the repository. Records file path, line count, byte size, and whether it is a symlink to AGENTS.md. Writes to ai.native.codex.instruction_file and appends to ai.instructions.all[] for normalized cross-tool access.
cicd
Detects OpenAI Codex CLI invocations in CI pipelines. Records the command string and version for policy-level flag analysis (dangerous flags, sandbox mode, approval mode).
How Collectors Fit into Lunar
Lunar watches your code and CI/CD systems to collect SDLC data from config files, test results, IaC, deployment configurations, security scans, and more.
Collectors are the automatic data-gathering layer. They extract structured metadata from your repositories and pipelines, feeding it into Lunar's centralized database where guardrails evaluate it to enforce your engineering standards.
Learn How Lunar Works →Example Collected Data
This collector writes structured metadata to the Component JSON. Here's an example of the data it produces:
{
"ai": {
"instructions": {
"all": [
{
"path": "CODEX.md",
"dir": ".",
"filename": "CODEX.md",
"lines": 60,
"bytes": 2400,
"is_symlink": false,
"symlink_target": null
}
]
},
"native": {
"codex": {
"instruction_file": {
"exists": true,
"path": "CODEX.md",
"lines": 60,
"bytes": 2400,
"is_symlink": false,
"symlink_target": null
},
"cicd": {
"cmds": [
{
"cmd": "codex exec --json 'review this PR'",
"tool": "codex",
"version": "0.1.0"
}
]
}
}
}
}
}
Documentation
View on GitHubCodex Collector
Detect OpenAI Codex CLI usage, instruction files, and CI invocations.
Overview
This collector detects OpenAI Codex usage: discovers CODEX.md instruction files and captures CLI invocations in CI pipelines. Writes to ai.native.codex under the unified ai.* namespace.
Collected Data
This collector writes to the following Component JSON paths:
| Path | Type | Description |
|---|---|---|
.ai.instructions.all[] |
array append | CODEX.md entry appended to the normalized instruction files array |
.ai.native.codex.instruction_file |
object | CODEX.md file: existence, path, line count, byte size, symlink status |
.ai.native.codex.cicd.cmds[] |
array | Codex CLI invocations in CI: command string, version, and flags |
Collectors
This integration provides the following collectors:
| Collector | Hook | Description |
|---|---|---|
instruction-file |
code |
Discovers CODEX.md instruction files with metadata and symlink status |
cicd |
ci-after-command (binary: codex) |
Captures Codex CLI invocations in CI with flag extraction |
Installation
Add to your lunar-config.yml:
collectors:
- uses: github://earthly/lunar-lib/collectors/codex@main
on: ["domain:your-domain"]
Open Source
This collector is open source and available on GitHub. Contribute improvements, report issues, or fork it for your own use.
Common Use Cases
Explore guardrails that use data from Codex Collector.
Ready to Automate Your Standards?
See how Lunar can turn your AGENTS.md, engineering wiki, compliance docs, or postmortem action items into automated guardrails with our 100+ built-in guardrails.