---
id: protect-ci-workflows
track: coding
version: 0.2.8
label: asks
keyword: ask
where: command write turn-end
sha256: ff28435c96d6f5f97a7fc3e7aab69882acfbdb32b6be60a524615ea9377c025a
source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/protect-ci-workflows
catalog_ref: e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
---

# Protect CI Workflows

protect-ci-workflows · version 0.2.8

Asks — Refuses a matched shell command before it runs. Asks on an agent's file writes and at turn end. Chock adds friction. It is not a security boundary. 

In a git repo: in agent (The agent's hooks check this once chock sync sets them up. If the hook crashes, the action goes through.)



## What it does

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.

## Its label on each agent

- Claude Code (tested): Asks — Refuses a matched shell command before it runs. Asks on an agent's file writes and at turn end. Builder: /coding/builder/#client=claude-code&p=protect-ci-workflows
- Cursor (tested): Blocks — 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. Builder: /coding/builder/#client=cursor&p=protect-ci-workflows
- Codex (tested): Blocks — 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). Builder: /coding/builder/#client=codex&p=protect-ci-workflows
- GitHub Copilot (tested): Blocks — 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). Builder: /coding/builder/#client=copilot&p=protect-ci-workflows
- Devin (tested): Blocks — 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). Builder: /coding/builder/#client=devin&p=protect-ci-workflows
- Grok (tested): Not graded yet for Grok. Builder: /coding/builder/#client=grok&p=protect-ci-workflows
- goose (tested): Not graded yet for goose. Builder: /coding/builder/#client=goose&p=protect-ci-workflows
- Antigravity (tested): Not graded yet for Antigravity. Builder: /coding/builder/#client=antigravity&p=protect-ci-workflows
- OpenHands (untested): Not graded yet for OpenHands. Builder: /coding/builder/#client=openhands&p=protect-ci-workflows
- Kimi Code (untested): Not graded yet for Kimi Code. Builder: /coding/builder/#client=kimi-code&p=protect-ci-workflows
- Factory Droid (untested): Not graded yet for Factory Droid. Builder: /coding/builder/#client=factory-droid&p=protect-ci-workflows

## What it misses

This policy does not state what it misses.

## Examples

- Refused: A request redirects new content over a workflow file. — `echo "on: push" > .github/workflows/ci.yml`
- Allowed: A request reads a workflow file to inspect it. — `cat .github/workflows/ci.yml`

## Latest change

0.2.8 · 2026-11-15 — 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.

## Provenance

- Tested by 71 of 71 cases run automatically
- SHA-256: `ff28435c96d6f5f97a7fc3e7aab69882acfbdb32b6be60a524615ea9377c025a`
- Catalog commit: https://github.com/open-coder-ai/chock-catalog/commit/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4
- Source: https://github.com/open-coder-ai/chock-catalog/tree/e3d71d03e4dd32377ad5bc19fb6bacdfe6607ea4/base/protect-ci-workflows (catalog path `base/protect-ci-workflows`)
- Presets: CI pipeline
- JSON: `/api/coding/policies/protect-ci-workflows.json`
- Report a problem: https://chock.sh/report/?policy=protect-ci-workflows&version=0.2.8&page=%2Fcoding%2Fpolicies%2Fprotect-ci-workflows%2F
