{
  "schema_version": 1,
  "id": "block-destructive-commands",
  "track": "coding",
  "name": "Block Destructive Commands",
  "version": "0.3.1",
  "sha256": "cec4264eaaf8862aa26873c4127dae8aff5ea716e81086b3b3e57edcd3a18085",
  "sha256_v1": "72ea908779626852753b0ddf64b55335131f1e4e81c489e63bf674d684a4ec45",
  "keyword": "block",
  "word": "blocks",
  "says": "refuses a matched shell command before it runs",
  "description": "Best-effort, on parsed commands (echo ignored); one verdict table shared with rtk-dangerous-actions-blocker. Blocks recursive deletes of root, home, abs paths or .git; mv/chmod/chown -R of system dirs; dd to devices, mkfs; lockouts; force, delete, mirror pushes; history rewrites; switch --discard; IaC destroy; cloud deletes; DB drops. Asks: rm -rf off a safe list, one named kubectl delete, bare lease, stash drop, -auto-approve, drain, prunes, API deletes. Dry runs pass. Pre-push: no non-ff.",
  "misses": null,
  "where": [
    "command"
  ],
  "groups": [
    "shell-containment"
  ],
  "eval_cases": 191,
  "eval_executed": 191,
  "latest": {
    "version": "0.3.1",
    "date": "2026-10-24",
    "change": "Shared shell reader updated (SR-2d1; the copy in implementations/chock_shellparse is regenerated, this policy's own script is unchanged). Added coverage: an arithmetic shift in `$(( ))`, `(( ))` or `$[ ]` is no longer read as the start of a here-document, so the lines after it are judged as before; the string given to `env -S` or `--split-string` is read as the command env runs; `env -i` is recorded on the command it runs. Tests: test_shellparse_sr2d1.py and eval cases tc-190 and tc-191."
  },
  "agent_labels": {
    "claude-code": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs"
    },
    "cursor": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Where its description says it asks, it asks"
    },
    "codex": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Where its description says it asks, it refuses, because this client cannot prompt before a shell command. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)"
    },
    "copilot": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Where its description says it asks, it asks in VS Code and refuses in Copilot CLI, because it cannot prompt there. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)"
    },
    "devin": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Where its description says it asks, it refuses, because this client cannot prompt before a shell command. If the hook errors, the action goes through (vendor docs only, not witnessed)"
    },
    "grok": {
      "keyword": "ungraded",
      "says": "Not graded yet for Grok"
    },
    "goose": {
      "keyword": "ungraded",
      "says": "Not graded yet for goose"
    },
    "antigravity": {
      "keyword": "ungraded",
      "says": "Not graded yet for Antigravity"
    },
    "openhands": {
      "keyword": "ungraded",
      "says": "Not graded yet for OpenHands"
    },
    "kimi-code": {
      "keyword": "ungraded",
      "says": "Not graded yet for Kimi Code"
    },
    "factory-droid": {
      "keyword": "ungraded",
      "says": "Not graded yet for Factory Droid"
    }
  },
  "source_url": "https://github.com/open-coder-ai/chock-catalog/tree/1e60d211c1bb767152c6ab0167932da06ab3a10f/base/block-destructive-commands",
  "enforces": "enforced-at-commit",
  "examples": [
    {
      "word": "Refused",
      "prompt": "A request asks the agent to run git push --force to main.",
      "command": "git push --force origin main"
    },
    {
      "word": "Allowed",
      "prompt": "A request asks the agent to run git status.",
      "command": "git status"
    }
  ]
}
