$ fssg build --deterministic --validate |

Why FACET Hashes Policy Semantics, Not Just Policy Rules

FACET

Two runtimes can load the same authorization document and still enforce different policies.

That sounds impossible until the hidden variable is named: evaluation semantics. Rule order, matcher behavior, short-circuiting, defaults, effect classification, and guard timing all change what a policy means. Hashing the rule document alone can therefore produce a dangerous result: identical policy identities for non-identical authorization decisions.

FACET v2.1.3 closes that gap with a small but consequential artifact. Its policy_hash covers the Effective Policy Object and policy_version:

policy_hash = sha256(JCS({
  policy_version,
  policy: EffectivePolicyObject
}))

This article is about that mechanism—not policy syntax in general. The core claim is narrow: authorization identity must include the interpreter contract, not only the interpreted rules.

The same text can authorize different effects

Consider a rule with several fields:

{
  "op": "tool_call",
  "name": "Payments.charge",
  "effect": "payment",
  "when": "$approved"
}

One runtime treats these fields as a conjunctive filter: all present conditions must match. Another accidentally treats name as sufficient. Both read the same bytes. Only one enforces the intended boundary.

The drift can be subtler:

Semantic choice Runtime A Runtime B Possible consequence
Rule fields logical AND partial match broader authority
all / any left-to-right short-circuit eager evaluation different error/deny path
Default for unmatched call deny allow reads different decision
Missing effect class unsafe assumed read authority expansion
Guard timing before external initiation after request begins denial arrives too late

A document digest cannot distinguish these runtimes because the divergence is not in the document. It is in the machine that gives the document meaning.

This is the authorization equivalent of compiling the same source with incompatible language semantics and pretending the resulting programs are identical because the source hash matches.

From source identity to decision identity

FACET separates several identities that are easy to collapse:

  1. document_hash identifies the normalized, import-resolved FACET source.
  2. policy_hash identifies the merged Effective Policy Object under a specific policy semantic version.
  3. Execution provenance records the concrete guard decisions made during a run.

These artifacts answer different questions.

document_hash -> Which resolved contract was compiled?
policy_hash   -> Which authorization program did this runtime mean?
events        -> Which decisions did it make for concrete operations?

The distinction matters in audits and replays. A matching document hash does not prove matching policy interpretation. A matching policy hash does not prove that the same operations were attempted. A matching event list without a trusted chain does not prove that the history is intact.

Identity becomes useful only when each hash has a precise semantic scope.

Why the effective policy is hashed

FACET policies can be assembled through imports and deterministic merge rules. Hashing a single source fragment would miss inherited defaults, overridden keys, appended rules, and keyed rule merges.

The relevant object is therefore the Effective Policy Object: the fully merged policy after resolution and validation, with list order preserved by the specification. That is the authorization program the guard actually evaluates.

This creates a useful review boundary:

source modules
    ↓ resolve + merge
Effective Policy Object
    ↓ JCS({ policy_version, policy })
policy_hash
    ↓ guard evaluation
GuardDecision events

The mechanism complements FACET policy as executable authorization. The earlier article explains where authorization executes. This one isolates how that authorization receives a stable identity after composition.

Why canonicalization is necessary but insufficient

RFC 8785 defines the JSON Canonicalization Scheme so cryptographic operations can consume an invariant JSON representation. It removes representational differences such as object-property order, whitespace, and primitive serialization choices.

FACET uses JCS for the policy hash input. This is essential: semantically identical objects must not receive different hashes because one serializer emitted a different key order.

But canonicalization only stabilizes representation. It does not define interpretation.

JCS answers:      Which bytes represent this object?
policy_version:   Which rules give this object meaning?

This is the same boundary discussed in Canonical JSON as an AI intermediate representation: stable bytes are a prerequisite for identity, not a substitute for a semantic contract.

A perfectly canonical hash of incomplete identity is still incomplete.

Semantic versioning must be operational

policy_version is not a release-label decoration. In FACET v2.1.3 it identifies the revision of the policy DSL and guard-evaluation semantics, including condition evaluation, rule matching, effect classes, guard timing, and enforcement points.

If an incompatible clarification changes those semantics, the policy version must change even if the surrounding FACET language version does not. Because policy_version participates in policy_hash, old and new interpretations cannot silently share an identity.

That gives deployments a concrete migration test:

if stored.policy_hash != candidate.policy_hash:
    require authorization review or replay

The test does not tell the reviewer whether the change is good. It tells the system that the authorization meaning changed and must not pass as a no-op.

This is stronger than a changelog warning. It converts semantic drift into an artifact-level difference that CI, caches, attestations, and audit systems can observe.

A practical verification matrix

For policy-aware runtimes, I would require four comparisons during an upgrade:

Check Same means Different means
Resolved source hash same composed contract source/import graph changed
Effective policy object same merged rules/defaults/order policy composition changed
Policy semantic version same evaluator contract interpretation changed
Guard-decision fixtures same outcomes for test operations observable authorization drift

None replaces the others. The first two inspect configuration. The third binds interpreter meaning. The fourth exercises behavior on representative operations.

This also explains why FACET conformance levels must separate structural compatibility from deterministic execution. A parser can preserve the object shape while implementing the wrong decision semantics.

Boundary conditions

This mechanism does not prove that a host is honest, bug-free, or correctly configured. A runtime can declare the expected policy_version and still implement it incorrectly. The hash also does not replace conformance fixtures, code review, signed releases, or operational attestation.

The claim is narrower and still valuable: when implementations follow the specification, policy identity includes the semantics that determine authorization. That prevents a legitimate semantic upgrade from masquerading as the old policy merely because the rule text stayed unchanged.

No benchmark is implied here. This is an architectural property derived from the FACET v2.1.3 specification and RFC 8785's canonicalization model.

The interpreter is part of the contract

AI infrastructure often hashes prompts, schemas, policies, and plans while leaving the evaluator outside the identity boundary. That is convenient—and wrong whenever evaluator semantics can change outcomes.

For authorization, the equation should be explicit:

policy identity = effective rules + evaluation semantics

FACET encodes that equation in policy_hash. It is a small field with a large responsibility: making semantic drift visible before it becomes authority drift.

A contract is not only the text we store. It is the meaning the runtime is allowed to execute.

FACET AI CLI Terminal
facet@ai:~$