Skip to content
$ shellfirm

Deny lists

Block checks outright for everyone in a repository — no challenge, no personal override.

A check id in a policy's deny list is blocked in the project. There is no challenge to solve, and personal settings cannot undo it.

.shellfirm.yaml
version: 1
deny:
  - git:force_push
  - kubernetes:delete_namespace
  - database:drop_database

What happens

Who runs itResult
You, in a shell with the hookCOMMAND DENIED banner, the line is not run (kept for editing)
An AI agent (hooks, MCP)deny, with the policy file in the reason
shellfirm check --exit-codeexit 11 (always, whatever --fail-on says)
shellfirm pre-commandexit 77

Shell banner:

Output
================ COMMAND DENIED ================
Command: git push -f origin feature/login
Check: git:force_push
Severity: HIGH
Blast radius: [PROJECT] — Force-pushes to origin/feature/login
Context: branch=main, target=feature/login
Description: This force-pushes and can overwrite remote history.
Alternative: git push --force-with-lease
(Checks that your local ref is up-to-date before force pushing, preventing accidental overwrites of others' work.)
Denied: `git:force_push` is denied by the project policy (/home/dev/projects/webapp/.shellfirm.yaml)
Only a change to that policy can allow it.

shellfirm: command denied, not run.
shellfirm: the line is kept for editing (Ctrl-U clears it).

shellfirm check output:

Output
  [git:force_push] [HIGH] This force-pushes and can overwrite remote history.
    > Safe alternative: git push --force-with-lease (Checks that your local ref is up-to-date before force pushing, preventing accidental overwrites of others' work.)

  Context: Normal (branch=main, target=feature/login)

  Shell (you, in a terminal): blocked (deny list or project policy; no challenge)
  AI agent (hooks, MCP): deny (blocked)
    why: Command matches a deny-listed pattern: `git:force_push` is denied by the project policy (/home/dev/projects/webapp/.shellfirm.yaml)

Personal settings cannot undo it

A developer who disables the git group and sets min_severity: Critical is still blocked. policy show tells them why:

Output
Your personal settings that the policy overrides (the policy wins):
  - group `git` is disabled in your settings, but the project policy enforces `git:force_push`
  - group `git` is disabled in your settings, but the project policy enforces `git:reset`

The audit log names the file

Every policy deny is recorded with deny_reason: policy_deny and policy_sources:

Output
2026-10-27T22:39:34Z  DENIED     HIGH      git:force_push                git push -f origin feature/login  [reason=policy_deny branch=main]
shellfirm audit show --outcome denied --format jsonl \
  | jq -c 'select(.deny_reason == "policy_deny") | {timestamp, user, agent_name, matched_ids, policy_sources}'

Rules for ids

  • Use exact check ids (git:force_push). Wildcards and group names are errors.
  • An unknown id is an error with a suggestion, reported by policy validate (the rest of the file still applies).
  • Ids are checked against the built-in checks and the policy's own checks, never against anyone's personal custom checks, so the verdict is the same on every machine.

Personal deny lists also exist (shellfirm config deny <id>, see Settings reference); they apply only to you.