{
  "schema_version": 1,
  "id": "protect-ci-workflows",
  "track": "coding",
  "name": "Protect CI Workflows",
  "version": "0.2.8",
  "sha256": "ff28435c96d6f5f97a7fc3e7aab69882acfbdb32b6be60a524615ea9377c025a",
  "sha256_v1": "5da5aea87f8b16cd08376347002b2c06085adbdee91d61a1947a1d56673819a0",
  "keyword": "ask",
  "word": "asks",
  "says": "refuses a matched shell command before it runs. Asks on an agent's file writes and at turn end",
  "description": "Asks a person before an agent weakens the checks that review its work. Shell guard refuses writes to .github/workflows/, .github/actions/, .github/dependabot.y*ml (redirect, rm/mv/tee/sed -i/yq -i/sponge/ curl -o, git checkout/apply, patch, cmdlets); reads and `chock sync` pass. Edit/Write and an agent's commit ask before a change to CI, hook or bot config (GitLab, Jenkins, CircleCI, CODEOWNERS, husky, more). Not judged: deletions, empty writes, non-GitHub CI paths in the shell, a patch not readable by path, a path set outside the command; plugin installs ship no gate.",
  "misses": null,
  "where": [
    "command",
    "write",
    "turn-end"
  ],
  "groups": [
    "ci-pipeline"
  ],
  "eval_cases": 71,
  "eval_executed": 71,
  "latest": {
    "version": "0.2.8",
    "date": "2026-11-15",
    "change": "Behaviour change, from the policy hardening review (REVIEW-infra.md, 2026-11-15-policy-hardening, section 2.6 and section 3, catalog 1.1.0 at 38fb487; tests in test_protect_ci_workflows_review.py). (1) The gate is a script gate (implementations/protect-ci-workflows-gate.py, the same path regex as before) so it can tell an agent's commit from a person's: a protected path in an agent's commit now asks (E01 at agent-commit was allowed on all 21 edits, so `yq -i ... && git commit -am ...` weakened CI with no ask); a person's commit is still not judged. (2) The shell guard now refuses `yq -i`, `sponge`, `curl -o` and `wget -O` onto a workflow, `git apply` and `patch` whose patch file names one in its headers (or whose operands name one), and a path held in a variable set earlier on the same line (`f=.github/workflows/ci.yml; rm \"$f\"`). A patch it cannot read by path (a pipe, a file that does not exist yet, one over 1 MB) is not judged. (3) Reads and unrelated commands pass: a new branch name after `git checkout -b`, an interpreter given code that shows no way to write (`python3 -c` parsing the YAML), and removing a dependency's own `.github` under node_modules. (4) The refusal names the path that matched. Not changed: files that drive CI indirectly (Makefile, package.json scripts, coverage config, .github/zizmor.yml), `gh` routes, a script that rewrites a workflow."
  },
  "agent_labels": {
    "claude-code": {
      "keyword": "ask",
      "says": "refuses a matched shell command before it runs. Asks on an agent's file writes and at turn end"
    },
    "cursor": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Refuses an agent's file writes and refuses at turn end, because this client cannot prompt at either point"
    },
    "codex": {
      "keyword": "block",
      "says": "refuses a matched shell command before it runs. Refuses an agent's file writes and refuses at turn end, because this client cannot prompt at either point. 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. Refuses at turn end only, because this client cannot prompt there. It does not check a file write when it happens. 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. Refuses at turn end only, because this client cannot prompt there. It does not check a file write when it happens. 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/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/protect-ci-workflows",
  "enforces": "best-effort (pre-tool-use, once hooks are installed; fails open if the hook crashes)",
  "examples": [
    {
      "word": "Refused",
      "prompt": "A request redirects new content over a workflow file.",
      "command": "echo \"on: push\" > .github/workflows/ci.yml"
    },
    {
      "word": "Allowed",
      "prompt": "A request reads a workflow file to inspect it.",
      "command": "cat .github/workflows/ci.yml"
    }
  ]
}
