frontmatter

Rules

Rules ~/.codex/rules/*.rules Vendor docs

config

name type required meaning concept
decision string The action to take when the rule matches. Codex applies the most restrictive decision when more than one rule matches (`forbidden` > `prompt` > `allow`). docs ↗
justification string A non-empty, human-readable reason for the rule. Codex may surface it in approval prompts or rejection messages. When you use `forbidden`, include a recommended alternative in the justification when appropriate (for example, `"Use \`rg\`... docs ↗
match string Examples that Codex validates when it loads your rules. Use these to catch mistakes before a rule takes effect. docs ↗
not_match string Examples that Codex validates when it loads your rules. Use these to catch mistakes before a rule takes effect. docs ↗
pattern string yes A non-empty list that defines the command prefix to match. Each element is either: docs ↗