Answer: Use `codex execpolicy check` to test how your rules apply to a command, passing the rule file with the `--rules` flag. The command emits JSON showing the strictest decision and any matching rules. Status: Confirmed Entry: tool/codex/permissions-and-security/test-rule-file Revision: 1 Digest: sha256:f0f4defda510585d (changes whenever the content changes) Timeline: Created: 2026-11-13T03:47:09Z Last changed: 2026-11-13T03:47:09Z Last verified: 2026-11-20T13:34:47Z Next check: 2026-11-21T13:34:47Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Test command | codex execpolicy check | [1] | 2026-11-20 Rules flag | --rules | [1] | 2026-11-20 Pretty flag | --pretty | [1] | 2026-11-20 Sources: [1] OpenAI. "Rules". https://learn.chatgpt.com/docs/agent-configuration/rules.md Role: primary. Accessed: 2026-11-20T13:34:47Z Quote: "Use `codex execpolicy check` to test how your rules apply to a command:" (Supports: Test command) Quote: "--rules ~/.codex/rules/default.rules" (Supports: Rules flag) Quote: "add `--pretty` to format the output" (Supports: Pretty flag) Snapshot SHA-256: b2c34d7dc85cff73b3706518370f373620713d4acf51c543aa01df958171e350 (captured 2026-11-13T03:47:08Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:47:09Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:34:47Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:34:47Z Last attempt: 2026-11-20T13:34:47Z Notes and limitations: Extracted automatically from a single official source (section "Test a rule file"). Related: https://latestn.com/tool/codex/permissions-and-security/threat-model-contents What does a Codex threat model include for a repository? https://latestn.com/tool/codex/permissions-and-security/track-findings-issue-advisory How do I get Codex to create a GitHub issue or draft security advisory for findings? https://latestn.com/tool/codex/permissions-and-security/triage-security-backlog How do I triage a backlog of security findings in Codex? https://latestn.com/tool/codex/permissions-and-security/start-deep-security-scan How do I start a deep security scan in Codex? https://latestn.com/tool/codex/permissions-and-security/start-scan-from-conversation How do I start a security scan from a conversation in Codex? https://latestn.com/tool/codex/permissions-and-security/start-security-scan How do I start a security scan in the Codex Security workbench? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:47:09Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/codex/permissions-and-security/test-rule-file/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/codex/permissions-and-security/test-rule-file POST: https://latestn.com/dispute/tool/codex/permissions-and-security/test-rule-file with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/codex/permissions-and-security/test-rule-file?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How do I test a Codex rule file to check it works? Revision 1, last verified 2026-11-20T13:34:47Z. https://latestn.com/tool/codex/permissions-and-security/test-rule-file (accessed 2026-11-21T09:58:11Z). @misc{LatestN_tool_codex_permissions_and_security_test_rule_file_r1, title = {How do I test a Codex rule file to check it works?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/codex/permissions-and-security/test-rule-file}}, note = {Revision 1; digest sha256:f0f4defda510585d; last verified 2026-11-20T13:34:47Z; accessed 2026-11-21T09:58:11Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/codex/permissions-and-security/test-rule-file