Bundle Structure
A bundle is APF’s unit of authority. It is a signed manifest that lists every policy document by path and SHA-256 digest, plus the documents themselves. The signature covers the manifest, and the manifest covers each document, so one signature makes the whole bundle tamper-evident.
Directory Layout
A bundle is a directory. The manifest sits at the root, and member paths resolve relative to the manifest’s directory.
Subdirectory names are a convention. APF routes each member by its kind, not by its location.
The Manifest
The verifying key ID is not a manifest field. It travels in the signature document.
Manifest Order
The manifest order is the evaluation order for rules and the attribution order for annotators. List members in this order:
SandboxPolicyand provider documents.PolicyAnnotatordocuments.PolicyFindingandPolicyEffectdocuments.PolicyRuledocuments. The firstforbidthat fires decides the deny reason.
The Signature Document
A signed manifest is the manifest payload followed by a YAML document separator and a signature document in the yaml-sigil format:
Member Documents
Every member is a YAML document with a kind. APF recognizes these kinds:
A YAML document with no kind but with a top-level id and endpoints is treated as an OpenShell-native provider profile. A member with any other kind is ignored. Every member of a recognized kind needs a name, and names must be unique within their kind.
A member may itself be signed in the yaml-sigil format. APF uses the member’s payload in that case. The manifest digest is always taken over the file’s raw bytes, so the bundle signature covers a signed member’s signature too.
Two Digests
Verification reports two digests, and they mean different things.
To check whether two bundles carry the same policy, compare their manifest payloads, the part of each file before the signature document.
The Distribution Tarball
The HTTP policy source expects a gzipped tar archive of the bundle directory. After unpacking, the policy service finds the manifest by trying .yaml files in this order until one verifies against its trust roots and parses as a bundle: manifest.yaml, then files whose name contains bundle, then the rest.
Create the archive from inside the bundle directory, so member paths stay relative to the manifest:
Next Steps
- To sign a bundle, refer to Compile and Sign.
- For the protobuf and JSON Schema definitions, refer to Bundle Specification.