DEDUPED Hot AI repos, turned into use cases Get 5 a day

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.

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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page