Skip to Content
harness-kit

Overview

Every built-in Policy by area, what it guards against, and whether it is on without an entry.

Find the built-in Policy that stops what you do not want the agent to do, then follow its area's guide to a working configuration. An entry's use names a Policy and its options configure it; presets fill the options in for common tools.

Two Policies are always on

self-protection and hook-bypass run without an entry. Every other Policy runs once your configuration names it.

Find the Policy for your problem

I want to stop the agent from …AreaPolicies
switching its own guardrails offProtectionself-protection, hook-bypass (both on by default)
running dangerous command lines: production kubectl, the wrong package manager, a write-capable subagentCommandscommand-policy
committing or pushing to shared branches, losing a stash, merging or approving a pull requestGit and forgebranch-name, push-target, stash-safety, commit-subject, merge-method, readonly-agents, branch-switch, forge-guard
writing files that must not be edited, or writing outside where files belongPaths and new filesprotected-paths, generated-paths, allowed-paths, new-file
leaving edited files unformattedFormattingformat-on-edit
ending a turn with failing lint, unsaved work or an incomplete hand-offStop checks and hand-offstop-command, work-saved, pull-request, references, status-sync, tracker-fields
running a check twice at once, or waiting on one foreverGatesnone: the gates key and harness-kit gate
starting in a checkout that loads another checkout's packages, a stale worktree or a full diskSession startcodegraph, workspace-links, worktree-health
letting the machine sleep while it worksKeep awakekeep-awake
working on the wrong tool versions, or without your team's rulesToolchain and rulestoolchain, rules

Outside these areas, external runs an external Policy over the protocol.

API reference

The guides teach; the API reference lists every default and option, generated from the code.

How each guide reads

Each Policy on a guide has the same parts, in the same order:

  1. what it guards against, with its main options;
  2. what the agent reads when it fires, quoted from a real run;
  3. how to turn it off.

A guide opens with a working configuration for the whole area.

What a Policy answers

AnswerWhat happens
denythe call is blocked; the agent reads the reason and a Fix: line
askClaude Code's permission prompt: the person decides
allowthe call runs
contexttext is added to what the agent reads

How a hook call is decided shows how the answers of several Policies merge.

Defaults that hold in every area

  • Policies that refuse fail closed, helpers fail open. A Policy whose job is to refuse refuses when it cannot decide; one that checks, formats or reminds lets the call through and logs why. An entry's failMode changes it.
  • Every refusal names its fix. Many options include a hint or message that replaces the fix with your team's own words.
  • To turn a Policy off, remove its entry, or, for one option, set it as the guide says. A central configuration can keep a repository from doing either, and an override lets a person loosen one Policy for a session.

On this page