Skip to main content
The ext:ai@1.0.0 extension is the most commonly used ProvenanceKit extension. Add it to any action performed by an AI entity to capture a cryptographically verifiable record of the model run.

Schema

Usage with OpenAI

Usage with Anthropic

Prompt hashing

The promptHash field lets you verify that a specific prompt produced a specific output without storing the prompt itself.
Store the promptHash in the action. If you need to audit later, hash the candidate prompt and compare — it either matches or it doesn’t.

AI training opt-out

Combine ext:ai@1.0.0 with ext:license@1.0.0 to express AI training restrictions:
Use hasAITrainingReservation() from @provenancekit/extensions to check:

Gotchas

  • Entity IDs should be cached. Don’t call pk.entity() on every request — it adds latency. Cache humanId and aiId at application startup or in a module-level variable.
  • promptHash is not the CID. The CID identifies the output content. The promptHash identifies the input prompt. They are separate fields.
  • tokensUsed is informational. The API does not validate token counts against any model billing system. Use it for analytics and auditing only.