# Author a policy

Describe a safeguard in plain words. The page fills a chock policy template and writes a setup script you read and run yourself. The browser compiles nothing and runs nothing.

The author needs JavaScript: it builds your policy in the browser and writes a setup script you read and run yourself. The page compiles nothing.

## The interview

- Refuse a line of text: Chock refuses a commit or file write that adds a line matching your text.
  Q: What text must never be written or committed? Q: What does the agent see when it is refused? Q: File content that must be refused Q: File content that must pass
- Refuse a shell command: Chock refuses a command matching yours before the agent runs it. Best effort: a renamed binary gets past it.
  Q: What command must the agent never run? Q: What does the agent see when it is refused? Q: A command that must be refused Q: A command that may run
- Refuse a file name: Chock refuses a commit or write that adds a file with a name you list.
  Q: Which file names must never be written or committed? Q: What does the agent see when it is refused? Q: A path that must be refused Q: A path that may change
- A rule the agent reads: Advisory: the rule text enters the agent's context, and nothing enforces it.
  Q: What must the agent never do? Q: What should it do instead? Q: An action that breaks the rule Q: An action the rule allows
- Teach the agent a skill: Advisory: a short procedure the agent reads when the task calls for it.
  Q: When should the agent use this skill? Q: The steps the agent follows Q: A task that should use this skill Q: A task that should not


The name becomes a `my-` id (`my-block-secrets`): lowercase letters, digits and hyphens. The answers fill the chock policy templates copied from engine commit `5a4b6287a46e`. A "Review the files" view shows every generated file and takes direct edits that win over the answers.

## Catalog policies

Picked catalog policies install beside the authored one. They are the same policies as the builder's, and a share link carries the agent and catalog policy ids only, and never the draft. Drafts live in the browser's localStorage and never leave it.

## The setup script

Download the script, read it, then run it. It writes the files, checks them with chock and builds the plugin. In install mode it also installs the plugin, but only on agents where a person has seen chock work live. It never pipes anything from the network into a shell. The script:

1. Asks for the agent (one of the five client ids), the folder, and build-only or install, with the interview's answers as defaults.
2. Writes `chock.selection.yaml` (schema 2) and the policy folder into `.agents/policies/<id>/` as quoted heredocs.
3. Runs `chock check --repo <folder> --only validate,evals` and stops on any failure.
4. Runs `chock install --selection <folder>/chock.selection.yaml --client <agent> --trust-local <id>=<sha256>`, the step the CLI asks you to review. The sha256 pins exactly the policy code printed in the script, so reading the script is that review. Answering `install` also passes `--apply`, the agent's own install step, but only where a person has seen that step work live.

The page never compiles a policy or runs generated code. The script never pipes anything from the network into a shell. Its only network call is chock's own pinned catalog fetch when catalog policies are picked.
