$ fssg build --deterministic --validate |

How to Sign a FACET Execution Artifact

FACET

A provenance log becomes useful evidence only when I can answer two separate questions: did the execution record change, and who is willing to stand behind this exact record?

FACET answers the first question with a deterministic hash chain. The host answers the second with an attestation. I keep these mechanisms separate because a signature cannot repair weak provenance, and a perfect hash chain cannot identify the system that produced it.

This boundary is small enough to implement without redesigning an agent runtime. The execution artifact already contains a chain head. The host signs that exact UTF-8 string, stores the signature in a narrow envelope, and publishes a key-discovery rule outside the artifact.

The artifact already has a stable subject

The FACET compiler builds an execution artifact from two inputs: the canonical request payload and normalized guard decisions. Its metadata identifies the FACET version, host profile, document hash, policy hash, and policy version. Its provenance section contains ordered events and a SHA-256 chain head.

A simplified artifact looks like this:

{
  "metadata": {
    "facet_version": "2.1.3",
    "host_profile_id": "prod.eu-1.v3",
    "document_hash": "sha256:...",
    "policy_hash": "sha256:...",
    "policy_version": "1"
  },
  "provenance": {
    "events": [
      { "seq": 1, "kind": "tool_expose", "decision": "allowed" },
      { "seq": 2, "kind": "tool_call", "decision": "allowed" }
    ],
    "hash_chain": {
      "algo": "sha256",
      "head": "sha256:..."
    }
  },
  "attestation": null
}

The chain head is the signing subject. FACET v2.1.3 specifies that the signature covers the bytes of the provenance.hash_chain.head string encoded as UTF-8. It does not ask the signer to serialize the whole JSON document again. That avoids a second canonicalization problem at the trust boundary.

This extends the mechanism I described in How FACET Builds Tamper-Evident AI Execution Logs: the chain detects changes; the attestation binds an external identity to the resulting head.

Sign the head, not an interpretation

The signing operation should be boring:

subject = UTF8(artifact.provenance.hash_chain.head)
signature = Ed25519.sign(private_key, subject)
attestation = {
  "algo": "ed25519",
  "key_id": "prod-eu-1-2026-q4",
  "sig": base64url(signature, padding=false)
}

The envelope has exactly three fields:

  • algo names the signature algorithm;
  • key_id tells a verifier which public key to resolve;
  • sig carries an unpadded base64url signature.

The reference implementation accepts ed25519 or a namespaced host algorithm such as x.example.hsm-ed25519. It rejects empty key identifiers, malformed signatures, extra fields, and unsupported unnamespaced algorithm names.

That validation is intentionally narrow. It proves that the envelope has the expected shape. It does not prove that the signature is cryptographically valid, that the key belongs to the claimed service, or that the service was trustworthy. Those are host responsibilities.

A verifier needs four checks

I would make verification an explicit pipeline rather than a single verified: true boolean.

1. Recompute provenance

Rebuild the chain head from the artifact metadata and ordered events. If the result differs from the stored head, stop. There is no reason to consult a key registry for a structurally corrupted artifact.

2. Resolve the key by policy

Resolve key_id through an authenticated registry controlled by the deployment, organization, or tenant. The FACET specification deliberately does not standardize key distribution. A local trust store, signed JWKS-like document, certificate chain, or HSM-backed registry can all work, but the verifier must know which registry is authoritative before reading the artifact.

Never treat key_id as a URL supplied by the artifact. That turns verification into attacker-directed network access.

3. Verify the exact bytes

Verify sig over the UTF-8 bytes of the complete chain-head string, including the sha256: prefix. Do not decode the hex digest and silently change the signed message. A signature protocol is a byte contract.

4. Evaluate key status at execution time

A valid signature from a revoked or out-of-scope key is not sufficient. The verifier should check the key's allowed environment, service, tenant, purpose, validity interval, and revocation status against the artifact's execution time or trusted receipt time.

The result should preserve reasons:

{
  "provenance": "valid",
  "signature": "valid",
  "key_status": "valid_at_execution",
  "scope": "prod.eu-1/facet-runtime",
  "decision": "accepted"
}

A binary answer hides the distinction between a damaged chain, an unknown key, a bad signature, an expired key, and a valid key used outside its authority.

Key rotation must not rewrite history

Rotation is where otherwise clean attestation designs often become ambiguous.

I would use immutable key identifiers. prod-current is convenient for signing but weak for evidence because its meaning changes. prod-eu-1-2026-q4 or a public-key fingerprint makes old artifacts resolvable after rotation.

The registry should retain retired public keys and their validity intervals. Revocation needs a reason and effective timestamp. If a key is compromised today, the organization may reject every historical artifact signed by it, or it may retain artifacts whose trusted timestamp predates the compromise. That is a governance decision, not something the signature can decide by itself.

The private key should never enter the FACET contract, canonical payload, model context, or execution artifact. Signing belongs after the chain head exists, ideally inside an HSM, KMS, or isolated signing service. The model does not choose the key, algorithm, or trust scope.

What an attestation does not prove

A valid attestation proves a limited statement: the holder of a particular private key signed this chain-head string.

It does not prove that:

  • the model output was correct;
  • the policy was well designed;
  • the host profile granted appropriate capabilities;
  • an external API reported truthful data;
  • the signer was uncompromised;
  • every relevant event was captured before hashing.

This limitation is not a weakness. It is what makes the claim reviewable. FACET already separates request artifacts from execution artifacts and keeps provider behavior outside the deterministic contract boundary. Attestation should preserve the same discipline.

A signature over a weak artifact creates ceremony. A signature over a deterministic, replayable chain creates a durable identity boundary.

The minimum production pattern

For a small deployment, I would start with five components:

  1. generate the FACET execution artifact with attestation: null;
  2. recompute and compare the chain head in the signing service;
  3. sign the exact head string with an environment-scoped Ed25519 key;
  4. insert the three-field attestation envelope without modifying provenance;
  5. verify through a pinned trust registry before accepting the artifact as authenticated evidence.

Keep unsigned artifacts valid as provenance but mark their identity status as unattested. Keep malformed or unverifiable attestations distinct from absent ones. Absence means no identity claim was made; failure means a claim was made and did not verify.

That distinction matters in migrations. A team can deploy provenance first, add signing later, and enforce attestation only at the boundaries that require non-repudiable operational evidence.

Signatures belong at the edge of the deterministic boundary

I do not want cryptography buried inside a prompt language, and I do not want provenance delegated to a generic logging backend. The compiler should produce a stable evidence subject. The host should control keys and identity. The verifier should apply trust policy.

FACET's attestation envelope is useful precisely because it does not collapse those roles. It gives the runtime one exact string to sign and gives the auditor one exact claim to verify.

The model may remain probabilistic. The evidence about what the system allowed and executed should not be.

Sources

FACET AI CLI Terminal
facet@ai:~$