DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to block a risky Codex action with a custom deny rule with Numbat

Copy a shipped rule, mark it enforce: true, and install it on a Codex pre-action hook.

Short answer: Copy the complete shipped YAML for the target rule from the rules directory into a new operator folder, such as ./numbat-policy; then keep the same rule id, add enforce: true, and bump the rule version; run numbat rules check --rules-dir ./numbat-policy and fix any validation errors. All steps.

Who it is forA security lead who has tested a detection in monitor mode and now wants a Codex pre-action block for one behavior.

The problemShipped rules only monitor, so a confirmed high-risk action such as writing SSH authorized keys still runs unless an operator adds a blocking policy.

The outcomeA controlled operator rule directory where the chosen detection denies matching Codex actions, with enforcement decisions written to the record stream.

What you need first

  • A macOS, Linux, or Windows machine with a terminal
  • The numbat binary, from a release download or Go 1.26.9 or newer
  • At least one supported agent installed, such as Codex or Claude Code
  • Permission to read the agent's local session files and, for live capture, to change its hook configuration

Steps

  1. Copy the complete shipped YAML for the target rule from the rules directory into a new operator folder, such as ./numbat-policy.
  2. Keep the same rule id, add enforce: true, and bump the rule version.
  3. Run numbat rules check --rules-dir ./numbat-policy and fix any validation errors.
  4. Run numbat hook install --agent codex --emit all --rules-dir ./numbat-policy --enforce. (inferred, check the README)
  5. Review and trust the updated Codex hook in /hooks or Settings > Hooks, then test with a harmless match and confirm an enforcement record appears.

Prompt for your agent

Use the repo perplexityai/numbat. Copy the shipped YAML for <rule-id> from rules/ into ./numbat-policy, set enforce: true and a new version, then run `numbat rules check --rules-dir ./numbat-policy`. Report whether validation passes and which rule ids are active. Verify that the enforcement record uses mode "enforce" only for the rule you marked, and that all other shipped rules remain monitor-only.

Caveat. Enforcement applies only to supported synchronous pre-action hooks and only to rules marked enforce: true, so check the coverage matrix before relying on a block.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for perplexityai/numbat and "Block a risky Codex action with a custom deny rule"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer