Chock.sh Build your plugin
Asksv0.2.8 preset: CI pipeline

Protect CI Workflows

Refuses a matched shell command before it runs. Asks on an agent's file writes and at turn end.

Acts on

Shell command · File write · Turn end

When

Before the command runs · before the file write · at turn end

Tested

71 of 71 pass

In a git repo

In agent

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.

Chock adds friction. It is not a security boundary.

Its label on each agent

The catalog grades each policy on each agent. Pick an agent to build with this policy:

  • Claude Code TestedAsks Refuses a matched shell command before it runs. Asks on an agent's file writes and at turn endBuild →
  • Cursor TestedBlocks 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 pointBuild →
  • Codex TestedBlocks 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)Build →
  • GitHub Copilot TestedBlocks 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)Build →
  • Devin TestedBlocks 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)Build →
  • Grok Tested Not graded yet for GrokBuild →
  • goose Tested Not graded yet for gooseBuild →
  • Antigravity Tested Not graded yet for AntigravityBuild →
  • OpenHands Untested Not graded yet for OpenHandsBuild →
  • Kimi Code Untested Not graded yet for Kimi CodeBuild →
  • Factory Droid Untested Not graded yet for Factory DroidBuild →

See it in action

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

Both examples are this policy's own test cases.

What it misses

This policy does not state what it misses.

Latest change

0.2.8 · · 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.