◆ Swift-native · on-device · Apache 2.0

Your AI agent changed its mind. Now you know exactly why.

DProvenanceKit turns every AI run into a queryable, diffable trace of its reasoning — then signs it with CryptoKit into a tamper-evident attestation you can verify offline. When an OS or model update makes your on-device agent silently drop a tool call or skip a step, it catches the regression and fails your build — before your users hit it.

$ swift run FoundationModelsRegressionDemo --gate
The 30-second demo

Watch it catch a regression

A weather agent, traced through the Foundation Models adapter. Before an OS update it called getWeather for live conditions. After the update, the same prompt was answered straight from the model's prior — fluent, plausible, and wrong. Every traditional test stays green. Press run.

Real output from FoundationModelsRegressionDemo — nothing here is faked.
terminal
$ swift run FoundationModelsRegressionDemo --gate
reasoning diff — Weather agent
Weather agent · baseline → candidate
⚠ regression risk: HIGH drift 60 / 100 ✕ CI gate FAILED

This is a scripted recording of real output. Open the live Explorer → to poke at the bundled sample diff in your browser, or drop in your own swift run DProvenanceKitCLI web-export JSON.

Why this matters

AI systems don't fail like software

Traditional software crashes. AI usually doesn't — it fails quietly, and your logs show what happened, not why.

Steps vanish

An agent silently stops calling a tool after a model update and answers from memory instead of live data.

Order drifts

Reasoning steps reorder between runs; a validation that used to gate a decision now runs after it.

Same input, new path

Two supposedly identical runs take different routes and produce different results — with no obvious cause.

Isn't this just OpenTelemetry?
OpenTelemetry
Traces requests.

Latency, spans, service health, infrastructure. Answers what happened.

DProvenanceKit
Traces reasoning.

Decision lineage, logic diffs, regression detection. Answers why the AI reached this conclusion.

And when you need both, DProvenanceOTel exports finished runs as standard OTLP spans to Langfuse or any collector — DPK stays the on-device capture layer. Export, not equivalence.

Get started

Two lines to a diffable AI trace

1. Add the package (Swift Package Manager):

// Package.swift
.package(url: "https://github.com/Therealdk8890/DProvenanceKit", from: "0.8.1")

2. Trace an Apple Foundation Models session — one line:

import FoundationModels
import DProvenanceFoundationModels

try await FMTrace.run(contextID: "chat", store: store) {
    let s = LanguageModelSession.traced(instructions: "Be terse.")
    _ = try await s.respond(to: "Plan my day.")
}

Already have working FoundationModels code? session.recordProvenance() ingests the transcript after the fact — zero refactor. Every prompt, response, tool call, and generation error becomes a queryable trace event you can diff, align, and gate in CI.

Who it's for

If your reasoning happens in Swift, this is built for you

Agents, LLM workflows, tool-using models, and reasoning that runs on-device with Apple Foundation Models, MLX, or Core ML. The observability ecosystem — LangSmith, Langfuse, Phoenix, OTel — is Python- and JS-first, built around requests crossing a network. DProvenanceKit works at the reasoning layer, in your language, with nothing leaving the device.

on-device

No service to stand up

Pure Swift package. System SQLite + CryptoKit. Runs in your process; traces never leave the machine unless you export them.

CI-native

Fails the build on drift

The regression gate exits non-zero when a critical reasoning step disappears — the same way a failing test breaks your PR.

portable

Python port + GitHub Action

Not writing Swift? DProvenanceKitPython mirrors the API, with a drop-in CI action.

Open source + services

The library is free. The service is paid.

Everything in the public library — capture, query, diff, lineage, local signed attestation, offline proof packs, the FoundationModels adapter, and OTLP export — is Apache 2.0. The live paid offer is a defined 30-day assurance pilot, with other maintainer help scoped per engagement. There's no hosted service, recurring support tier, SLA, indemnity, or compliance-certification package.

Open Source

$0 · Apache 2.0
  • Full recording, query DSL, diff & alignment engine
  • Local signed trace attestation & role-bound proof packs, verified offline
  • Provenance / lineage recording and export
  • FoundationModels adapter (live + post-hoc)
  • OTLP export to Langfuse or any collector
  • CI regression gate + web Explorer to share one diff
  • Community support on GitHub
Get it on GitHub
native app

Prefer a desktop workbench? The D.P.K Mac app

The free web Explorer shares or previews one frozen before/after diff in the browser. D.P.K: Reasoning Traces is the native workbench over your live, local trace database — diff runs you choose, replay timelines, drill into payloads and span lineage, and surface anomalies across loaded runs. Basic is currently free. As of July 2026, an optional $99/year Pro Annual subscription is planned but not publicly purchasable; metadata, the D.P.K 1.3.0 submission, and Apple review still remain. Check the App Store for current availability.

Get the Mac app →

Need an invoice or a different scoped engagement? therealdk8890+lineage@gmail.com · Full offer details in COMMERCIAL.md

Ship AI you can actually debug.

Start free in five minutes — capture, diff, and gate PRs on reasoning drift in the open-source library. When one workflow needs hands-on integration and an assurance report, start the 30-day pilot.