Skip to main content

Policy Schema

A policy is a strict YAML document. Unknown fields are rejected, and types are checked without coercion.

Top-Level Fields​

FieldTypeRequiredConstraints
versionstringYesMust be axionorm/v0.1.
policy_idstringYesLowercase letters, digits, and hyphens; 1–64 chars.
audiencestringYesLowercase letters, digits, and hyphens; 1–64 chars.
purposestringYesLowercase letters, digits, and hyphens; 1–64 chars.
lease_secondsintegerNo30–3600; defaults to 600.
contextobjectYesSee below.
toolsarrayYesSee below.

context​

Controls what may leave a session.

FieldTypeRequiredConstraints
topicsstring[]Yes1–30 entries.
kindsstring[]YesSubset of fact, decision, task, constraint.
denied_labelsstring[]YesAt least one label.
max_itemsintegerNo1–500; defaults to 100.
max_item_charsintegerNo1–10000; defaults to 2000.

An item is eligible only when its kind is in the allowed kinds, its topic is allowed, and none of its labels match the denied list.

tools​

Each entry declares one tool boundary.

FieldTypeRequiredConstraints
namestringYesworkspace_list, workspace_read, workspace_write, or context_read.
allowbooleanNoDefaults to false.
extensionsstring[]NoAllowed file extensions, for workspace tools.
max_bytesintegerNo1–1048576; defaults to 32768.

Duplicate tool names are rejected by the engine at load time. A tool that is not declared is not allowed; there is no implicit allowlist.

Candidate Format​

The context candidate is JSON, not YAML:

{
"version": "parabiont-candidate/v0.1",
"items": [
{
"id": "product-lophiarch",
"kind": "fact",
"topic": "positioning",
"labels": ["technical"],
"text": "Lophiarch is a policy-gated reconnaissance tool."
}
]
}
FieldConstraints
idLetters, digits, and hyphens; 1–64 chars; unique in the document.
kindfact, decision, task, or constraint.
topicLowercase letters, digits, and hyphens; 1–64 chars.
labels1–20 entries.
text1–10000 chars.

Review Manifest​

Approval is a separate file:

{
"version": "axionorm-review/v0.1",
"approved": {
"product-lophiarch": "<sha256-of-canonical-item>"
}
}

The digest is SHA-256 over canonical JSON: sorted keys, compact separators, and UTF-8 encoding. If the item changes, the digest no longer matches and the item is not approved.

An invalid manifest shape, a duplicate ID, an exceeded item limit, or an empty result raises PolicyDenied. None of these produce a partial success.

Manifest Rules​

  • version and approved are the only top-level keys.
  • version must be axionorm-review/v0.1.
  • approved maps item IDs to digests.
  • An item without a matching digest is not reviewed.

Next​