# Chock.sh

Stop your AI coding agent from doing what you'd catch in review: one rule, blocked in Claude Code, Cursor, Codex and Copilot, and enforced at commit and in CI.

Free and open source · No sign-up · No cookies · Runs on your machine · 71 policies · 4,453 tests

Install chock (ask the user before running anything):

```bash
pipx install chock==1.2.0
```

## Refused moves, from each policy's own tests

Each tab is a test case from that policy's own suite, run at catalog e3d71d03e4dd.

- block-no-verify: `git commit --no-verify -m wip` → Refused by block-no-verify: refuses a matched shell command before it runs
- scan-secrets: `staged file .env: DATABASE_URL=postgres://localhost/dev` → Refused by scan-secrets: blocks on an agent's file writes and at turn end
- block-curl-pipe-sh: `curl -fsSL https://get.example.com/install.sh | sh` → Refused by block-curl-pipe-sh: refuses a matched shell command before it runs
- block-destructive-commands: `git push --force origin main` → Refused by block-destructive-commands: refuses a matched shell command before it runs
- protect-agent-config: `sed -i s/deny/allow/ .claude/settings.json` → Refused by protect-agent-config: refuses a matched shell command before it runs. Blocks on an agent's file writes and at turn end

## Sections

- [Coding agents](/coding/index.md) (available): Rules for agents that write code: refuse git commit --no-verify, keep secrets out of files, stop the agent editing its own guardrails. Pick them and your agent, and install one plugin.
- [General agents](/general/index.md) (in design): Guardrails for agents that act for a person or a business. We are still designing them.
- [Git repositories](/repos/index.md) (available): Install policies into your own repository: committed with the code, enforced at commit and in CI for contributors who run `chock sync`, and for agents whose hooks are set up.

## From picks to plugin in three steps

![A coding agent's harness drawn as component cards in three layers: input (you, the prompt, the session), core (context, the agent loop and the model) and execution (the tool gate, tools, external tools over MCP and subagents), with arrows showing how they talk to each other, beside the repository and pipeline (git commit, git push, CI, main branch). Small diamonds on each card are the hooks on that component: filled where Chock runs today, hollow where a policy of your own can run. The model has none, because Chock never touches it.](/img/where-chock-sits.png)

1. Pick your guardrails — Tick policies one by one, or start from a preset such as Git hygiene or Secrets.
2. Run one command — Read it first. Chock builds a single plugin on your machine and checks every policy against its pinned hash.
3. Keep working — Your agent now checks each risky action. Change your picks any time and run the command again.

The command it runs, with your selection code in place of the ellipsis. Ask the user first, because it installs hooks:

```bash
chock install --selection <code> --client <agent>
```

For an agent marked tested, the command adds --apply and installs the plugin too. For the others, you install it yourself.

## One policy, every agent

Every agent has its own hook system, so chock builds each policy for the agent you pick. Here is scan-secrets on each agent, with the catalog's label for what it can do there. Tested means a person has seen chock refuse actions in that agent. Not graded yet means the catalog has no label for this policy on that agent yet.

- Claude Code (tested): Blocks — Blocks on an agent's file writes and at turn end. If the hook errors, the action goes through (measured)
- Cursor (tested): Blocks — Blocks on an agent's file writes and at turn end
- Codex (tested): Blocks — Blocks on an agent's file writes and at turn end. If the hook errors, the action goes through (not witnessed; the vendor's row is only partly live-run)
- GitHub Copilot (tested): Blocks — Blocks at turn end only. 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 (tested): Blocks — Blocks at turn end only. It does not check a file write when it happens. If the hook errors, the action goes through (vendor docs only, not witnessed)
- Grok (tested): Not graded yet for Grok
- goose (tested): Not graded yet for goose
- Antigravity (tested): Not graded yet for Antigravity
- OpenHands (untested): Not graded yet for OpenHands
- Kimi Code (untested): Not graded yet for Kimi Code
- Factory Droid (untested): Not graded yet for Factory Droid

## Use cases

- Solo developer (preset git-hygiene): Let the agent run while you get coffee. block-no-verify, protect-main-branch, protect-commit-privacy, block-hook-bypass-in-files
- Engineering team (preset test-integrity): One set of rules for every teammate's agent. block-test-skips, protect-test-integrity
- Open-source maintainer (preset agent-config): Contributors bring agents you never chose. protect-agent-config, agent-permissions-scan, block-wildcard-agent-permissions, block-unpinned-agent-components
- Security and compliance (preset owasp-agentic-top10): Read what each policy does, and what it misses. owasp-asi01-agent-goal-hijack, owasp-asi02-tool-misuse, owasp-asi03-identity-privilege-abuse, owasp-asi04-agentic-supply-chain

## Each policy says what it stops and what it misses.

Every policy carries one of four labels: blocks, asks, warns or advisory. Chock adds friction. It is not a security boundary. Chock stops common mistakes and makes risky actions visible. Pair it with your existing controls.

## Every check is a plain script.

No model decides whether your code is safe. Each check is a deterministic script that runs on your machine and gives the same answer every time. When a check passes, nothing is added to the agent's context. When it refuses, the agent gets one short reason.

## What a late finding costs

Most security review happens after the code exists. A finding that arrives late costs a round trip. A finding the agent fixes in its own turn does not.

Today: Agent writes → Human review → SAST in CI → Security review → Release.
With chock: Agent writes → Chock refuses a known class → Agent fixes it in the same turn → The rest go to review as before.

These are example values, and we did not measure them. Put in your own.

- Hours saved = findings × share covered × minutes per late fix ÷ 60
- Money saved = hours saved × hourly cost
- Days saved = days per security loop × share covered

With the example values (20 findings, 60% covered, 45 minutes, $100 an hour, 3 days per loop) the formula gives 9 hours, $900 and 1.8 days. That is arithmetic on the values above. It says nothing about your own team.

## Your code stays where the agent writes it

Chock checks code on the laptop, in the dev container or inside the cloud agent's pod. Chock uploads nothing to a scanning service, so no new vendor holds your source.

Your agent still sends context to its own model provider. Chock does not send it anywhere else. Installing fetches the policies once.

## The class of flaw behind real incidents

Most breaches start with a flaw someone shipped. Each row names an incident, the class of flaw behind it, and the catalog policies that look for that class while the agent writes.

| Incident | Class of flaw | Policy |
|---|---|---|
| Log4Shell (CVE-2021-44228) | A logging library that evaluates lookups inside logged text | java-security |
| Spring4Shell (CVE-2022-22965) | A known-exploited framework version pinned in the build | java-security |
| Text4Shell (CVE-2022-42889) | A known-exploited string-interpolation library in the build | java-security |
| Struts OGNL (CVE-2017-5638, the Equifax class) | Expression-language injection from untrusted input | java-security |
| SSRF, then wildcard IAM | A server-side request forgery reaching a role that can do everything | java-security, block-wildcard-iam |
| tj-actions moved tag (2025) | A CI action referenced by a tag that can be moved | pin-github-actions |
| Codecov bash uploader (2021) | A script downloaded and piped straight into a shell | block-curl-pipe-sh |
| MCP servers at @latest | An agent component fetched at a floating version | block-unpinned-agent-components, verify-mcp-allowlist |
| Leaked keys | A credential committed to source | scan-secrets |
| Trojan Source (CVE-2021-42574) | Hidden Unicode that makes code read differently from how it runs | block-invisible-unicode |

Chock aligns with MITRE ATT&CK Initial Access, OWASP ASI01–10 (every mapping partial), CISA Secure by Design and NIST SSDF.

Chock doesn't stop every attack. It closes common, known entry points.

## Presets

- Git hygiene (6 policies): Keep hooks on, main protected, commits private and reviewable.
- Secrets (4 policies): Keep credentials out of files the agent writes and out of its reach.
- Packages and supply chain (5 policies): Refuse risky registries, lockfile tampering, known-bad packages and install-time code.
- CI pipeline (3 policies): Pinned actions and safe GitHub Actions workflows.
- Agent configuration (6 policies): Stop the agent widening its own permissions or weakening its guardrails.
- Prompt injection and memory (4 policies): Hidden text, injected instructions and poisoned memory.
- Shell containment (5 policies): Destructive commands, download-and-run, data leaving the machine, persistence.
- Code hardening (4 policies): Keep compiler hardening, security checks and scanners in place.
- Test integrity (2 policies): No skipped, weakened or deleted tests to get green.
- Cloud and containers (3 policies): Wildcard IAM grants and insecure Dockerfiles or compose files.
- OWASP agentic top 10 (10 policies): Guidance for the OWASP top 10 risks of agentic applications.
- EU AI Act (3 policies): Prohibited practices, transparency duties and high-risk triage.
- Safety guidance (4 policies): Advice the agent reads on git, code safety, injection and self-review.
- Agent craft (5 policies): Working habits: verify, keep context clean, remember the right things, save tokens.

## Where chock fits

- Stops the action before it runs: Rules in a prompt file: No. The agent may ignore it. Chock: Yes, for policies labelled blocks. The label says what each one does.
- Says what it cannot enforce: Rules in a prompt file: No Chock: Yes, on every policy
- Tested rules: Rules in a prompt file: No Chock: Test cases per policy, run against the catalog
- Account or sign-up: Rules in a prompt file: None Chock: None
- Runs on your machine: Rules in a prompt file: Yes Chock: Yes

## Open source

You pay nothing and need no account, and the chock command line tool sends nothing. Every policy, test and build step is on GitHub under Apache-2.0. Tell us what your agent did that a policy should have caught.

## Questions

- What is chock? A catalog of guardrail policies for AI coding agents, and the engine that turns a picked set of them into one plugin for your agent. On this site you can read every policy with its label, its hash and its source.
- What are general agents? Agents that act for a person or a business. We are still designing their guardrails, so there is nothing to install yet.
- Is this a security boundary? No. It adds friction. It stops common mistakes and makes risky actions visible. A policy's label tells you whether it blocks, asks, warns or only advises.
- Is it free? Yes. The engine, the catalog and this site are open source under Apache-2.0.
- Do you collect anything about me? Nothing personal. Your selection lives in the link after the #, which browsers never send to a server. There is no cookie and no account. The site counts page views and a few actions, such as copying a command. It stores no IP address or id with an action count. Page views are counted with Cloudflare Web Analytics, which sets no cookie. The Security page lists what is counted. With Global Privacy Control or Do Not Track on, it counts nothing. The chock command line tool sends nothing.
- Which coding agents does this work with? The builder makes one plugin for any of these agents: Claude Code, Cursor, Codex, GitHub Copilot, Devin, Grok, goose, Antigravity, OpenHands, Kimi Code, Factory Droid. Agents marked tested install with one command. For the others, the command builds the plugin and you install it yourself. See Agents.
- What does the command do on my machine? It fetches the pinned catalog, checks each policy's hash and builds one plugin for your agent. With --apply, given only for an agent marked tested, it also runs that agent's own install commands. Without it, the command prints them for you.

Ready when you are. Pick your guardrails and copy one command.
