age-policy 1.0 · draft · free to implement
Agent age policy
A small JSON file that tells AI agents the legal drinking age for a site, and whether they may read it for a user.
In short
A site points agents to one JSON policy. A hosted service can serve it, for example generalspirit.com/policy/solaz.json for the sample brand Solaz, and a site may also publish a copy at /.well-known/age-policy.json. Agents that support the standard read it before other pages, then allow, attest or stop. The format is free to implement. General Spirit is one implementation.
Discovery
Agents SHOULD look for the policy in this order:
- A line on the page that links the policy file.
- A
Linkheader, or<link rel="age-policy">, on the page. /.well-known/age-policy.jsonon the site.- A comment in
/robots.txtthat names the policy file.
The first one found wins.
# option 2: a Link header on the page response (one line)
Link: <https://example.com/.well-known/age-policy.json>; rel="age-policy"File format
UTF-8 JSON, served as application/json. Unknown fields MUST be ignored.
{
"version": "1.0",
"default": "attest",
"legal_age": { "US": 21, "MX": 18, "JP": 20, "DE": 18 },
"agents": { "PerplexityBot": "disallow" },
"search_crawlers": "allow",
"paths": [{ "match": "/promos/*", "policy": "attest" }],
"message": "For people of legal drinking age."
}Fields
versionstring- major.minor, such as "1.0".
defaultallow · attest · disallow- Policy for any agent and path not listed.
legal_ageobject- ISO 3166 country or region code to minimum age.
agentsobject- Per-agent rules, keyed by agent token.
search_crawlersallow- Search crawlers are always allowed.
pathsarray- Ordered path rules. The first match wins.
messagestring- Text an agent SHOULD pass to its user.
Attestation
When the policy is attest, an agent that supports the standard confirms its user is of legal drinking age in their country by sending a header with its request.
GET /promos/holiday
X-Age-Attestation: true
X-Age-Country: US
200 OKAgent behavior
An agent that supports the standard reads the policy once per host and session, applies the rule for its own token first, then the first matching path, then default. On disallow it SHOULD tell its user that the site asks agents not to read the page.
Per-page rules
paths is an ordered list. Each rule has a match glob and a policy. The first match wins.
Versioning
The version field uses major.minor. Agents MUST accept any 1.x file and ignore fields they do not know.
Questions
Is attestation an ID check?
No. It is a statement by the agent that its user is of legal drinking age, like the age affirmation a person gives at a gate.
Do I need General Spirit to publish a policy?
No. The format is free to implement. General Spirit hosts the file, keeps the ages current and shows you agent visits.
What happens with an agent that does not support the standard?
Nothing changes for it. The policy guides agents that read it. Your gate still shows to people.