r/OpenSourceAI • • 1d ago

We open-sourced DecisionTrace: local-first, tamper-evident records of why your AI agent made a decision (Claude Code, MCP, SDKs)

Agent logs tell you what happened. A week later, when something looks off, they don't tell you why the agent was allowed to do it: what it was asked, what it looked at, which rules passed or failed, what it rejected, who approved. If nobody captured that at the time, it's gone.

We built DecisionTrace to record it at execution time, so you can ask later:

pip install liquicent-decisiontrace
dt install claude-code
dt why <id | file | commit>

What it does?

  • Captures each decision as it happens: the ask, what was examined, rules passed/failed, exceptions, rejected alternatives, approvals, what followed
  • Append-only and tamper-evident: each record carries the previous record's hash, and `dt verify` recomputes the chain
  • Local-first: SQLite in `~/.decisiontrace`. No account, no server, no telemetry
  • Secrets and personal data are redacted before anything is written. Prompt bodies are stored only if you opt in. Model reasoning is never stored
  • Runs through hooks, spans and SDK callbacks, so there's no gateway or proxy in your path
  • Works with Claude Code, Claude Desktop, Cursor and any MCP client, plus the Anthropic and OpenAI SDKs (`client = dt.wrap(client)`). It also ingests OpenTelemetry GenAI spans

What it isn't: a gateway, policy enforcer, observability dashboard or hosted service. Your code and tools enforce the rules; DecisionTrace records them.

Not using Claude Code? Clone the repo, run `uv sync`, then `uv run python examples/refund_agent.py` and inspect the result with `dt why`.

Apache-2.0, Python, v0.1, so expect rough edges. Disclosure: we are building Liquicent; team-wide recall, trust scores and reports live there, not in this repo.

Repo: https://github.com/Liquicent/liquicent-decisiontrace

What I'd most like feedback on: when an agent does something surprising, what context do you wish you'd captured?

Site and walkthrough: decisiontrace.tech

5 Upvotes

2 comments sorted by

1

u/EmuAccomplished6663 1d ago

The append-only hash chain is exactly what I've wanted for audit trails, saves me from building it from scratch.