Model provenance
Agent identity is permanent; model execution is replaceable. Every model call an agent makes — provider, exact model, hosting, cost, latency, and any fallback routing — is recorded as a model execution and appended to the agent's tamper-evident timeline. The agent keeps its trust score and audit history no matter which model runs underneath.
Record a model execution
Call recordModelExecution on a run handle (or the client) each time a model executes. Provider and model are free-form strings — unknown future providers ingest safely with no SDK update.
await run.recordModelExecution({
provider: "anthropic", // free string — any provider, present or future
modelName: "claude-x",
modelVersion: "2026-05",
hostingType: "external_api", // external_api | self_hosted | private_cloud | air_gapped
hostingRegion: "us-west",
inputTokens: 1200,
outputTokens: 420,
estimatedCostUsd: 0.31,
latencyMs: 5400,
});Fallbacks and routing decisions
ProofLedger doesn't route your model traffic — it observes and verifies routing decisions. Record what was requested, what was selected, and why; the fallback lands in the timeline as a model_fallback event.
await run.recordModelExecution({
provider: "glm",
modelName: "glm-5",
fallbackUsed: true,
fallbackReason: "primary model timeout",
routerDecision: {
requested: "anthropic/claude-x",
selected: "glm/glm-5",
reason: "best approved model under cost threshold",
constraints: { allowed_regions: ["us-west"], max_cost: 0.5 },
},
status: "success",
});Model lifecycle events
| Event type | Meaning |
|---|---|
| model_selected | A model was chosen for execution |
| model_fallback | Fallback routing selected an alternative model |
| model_switched | The agent switched models mid-task |
| model_failed | The model call failed |
| model_timeout | The model call timed out |
| model_policy_blocked | A model-level policy blocked the execution |
| model_region_blocked | A region restriction blocked the execution |
Note
Sovereignty metadata and evidence levels
Enterprises need to know where an AI execution happened. Hosting and jurisdiction claims carry per-claim evidence levels — ProofLedger records evidence; it never asserts regulatory compliance.
await run.recordModelExecution({
provider: "internal",
modelName: "llama-derived-ft",
selfHosted: true,
openWeight: true,
fineTuned: true,
hostingRegion: "eu-central",
// Per-claim confidence: observed | declared | verified
evidence: { hostingRegion: "declared", selfHosted: "declared" },
});