[API](/docs/api) · preflight

# Policy as code

Keep your agent’s preflight policy in your repository as crawlcheck-policy.json : defaults, rules per action, and tests that say what decision you expect. It gets a content id, preflight uses it by id, and every receipt names the policy that decided.

## 1. Write the file

```
{
 "kind": "crawlcheck-policy",
 "v": 1,
 "name": "Shopping agent, production",
 "description": "Cite and read freely on fresh readings; a person approves every purchase; never touch accounts.",
 "defaults": {
 "max_age_hours": 168
 },
 "actions": {
 "cite": {
 "require_entity": true,
 "on_warn": "require_confirmation"
 },
 "connect": {
 "max_age_hours": 72,
 "on_warn": "require_confirmation"
 },
 "transact": {
 "max_age_hours": 24,
 "on_warn": "block",
 "human_approval": [
 "transact"
 ]
 },
 "administer": {
 "on_warn": "block",
 "deny": [
 "example.net"
 ]
 }
 },
 "tests": [
 {
 "domain": "crawlcheck.io",
 "action": "read",
 "expect": [
 "allow",
 "warn"
 ],
 "note": "our own site reads cleanly"
 },
 {
 "domain": "crawlcheck.io",
 "action": "transact",
 "expect": [
 "require_confirmation",
 "block",
 "unsupported"
 ],
 "note": "a purchase always needs a person"
 }
 ]
}
```

Fields per action: max_age_hours , on_warn (warn, require_confirmation or block), require_entity , human_approval , allow , deny . defaults apply to every action; actions.`<action>` overrides them. A policy can only make a decision stricter, never looser. JSON Schema: [/schemas/policy.json](/schemas/policy.json).

## 2. Check and test it

Download [crawlcheck-policy.mjs](/crawlcheck-policy.mjs) (zero dependencies, Node 20+):

```
node crawlcheck-policy.mjs lint crawlcheck-policy.json # errors, and the policy id
node crawlcheck-policy.mjs test crawlcheck-policy.json # runs tests[] against today's answers; exit 1 on a failure
node crawlcheck-policy.mjs publish crawlcheck-policy.json # stores it under its id
```

In CI (GitHub Actions):

```
- run: curl -fsSO https://crawlcheck.io/crawlcheck-policy.mjs && node crawlcheck-policy.mjs test crawlcheck-policy.json
```

## 3. Use it by id

```
POST /api/v1/preflight
{"domain": "shop.example", "action": "transact", "policy_id": "pol1:<sha256>"}
```

The id is sha256 over the canonical normalised file, so the same rules always carry the same id, and the script re-checks the id the server returns. Stored policies never change; GET /api/v1/policy?id=… returns the exact file. A template or inline policy sent with policy_id combines with it, and the strictest value of each field wins.

API: [POST /api/v1/policy](/docs/api#policy) · [POST /api/v1/policy/test](/docs/api#policy-test) · [preflight](/api/v1/preflight)

We read your site the way crawlers do, from our own network, and every report says exactly what was asked for and what came back. [Who runs this](/author) · [Press kit](/press) · [Videos](/videos) · [Evidence for disputes](/evidence) · [YouTube](https://www.youtube.com/@crawlcheck) · [hello@crawlcheck.io](mailto:hello@crawlcheck.io)

#### How we measure, and our own machine files

CrawlCheck reads every site as itself. Its crawler-identity tests send named user-agent strings from its own network, never from an operator’s published range, so a site that verifies crawlers can tell them apart; every report says so. Results reflect what an anonymous non-browser client receives. [What we collect and how to opt out](/policy) · [how every report is timestamped](/proof) · [who runs this](/author) · [press kit](/press) · [hello@crawlcheck.io](mailto:hello@crawlcheck.io).

**Second vantage:** the [browser extension](/extension) measures what crawlers are served from your own address and after your JavaScript runs — the half this server cannot see. From 1.0.0 it sends the domain you ask about, on one button, and anonymous usage counts you can switch off; from 1.0.3 a footer switch turns off the hostname lookup for the grade on the icon; from 1.0.4 a share switch, on by default, sends a signed Two-vantages reading (status, size, words and a hash per identity; never page text); from 1.0.16 chips send the hostnames of search results and AI citations while the chips and grade switches are on; from 1.0.17 a readings switch, on by default, sends one signed page reading a day (numbers, the hostname and the page address with the query removed; never in incognito; at most 40 a day) and only while the share and grade switches are also on. Earlier versions send nothing.

**Our own machine layer for the agentic web:** [llms.txt](/llms.txt) · [llms-full.txt](/llms-full.txt) · [agents.md](/agents.md) · [SKILL.md](/SKILL.md) · [entitymap.json](/entitymap.json) · [media kit](/.well-known/media-kit.json) · [MCP server card](/.well-known/mcp/server-card.json) · [API catalog](/.well-known/api-catalog) · [OpenAPI](/openapi.json) · [robots.txt](/robots.txt) · [sitemap.xml](/sitemap.xml) · [security.txt](/.well-known/security.txt) — every one named in robots.txt, which is exactly what we check for on yours.

**Registry:** [MCP: Operator](/registry/mcp/operator) · [MCP](/registry/mcp) · [AI policy](/registry/aipolicy) · [triplinkintl.com](/registry/triplinkintl.com) · [westman-atelier.com](/registry/westman-atelier.com) · [Trade: Denver](/registry/trade/fencing/co/denver) · [Trade: Englewood](/registry/trade/tree-service/co/englewood) · [monday.com](/registry/capabilities/monday.com) | **Pages:** [IP ranges](/data/ip-ranges) | **Datasets:** [Oregon](/datasets/state/oregon) · [Technologies: New relic](/datasets/technologies/new-relic) · [Problems: Robots group name typo](/datasets/problems/robots-group-name-typo)

[Contact](/contact) · [Partnerships](/partnerships) · [Terms of service](/terms) · [Refund policy](/refunds) · [Trust center](/trust) · [Subprocessors](/subprocessors) · [Changelog](/changelog) · [Report an error](/report-error)
