Decision Records for production AI.
Project description
Lumyn
Decision Records for production AI.
Lumyn is a deterministic decide() gateway for AI systems that take real actions (refunds,
ticket operations, account changes). Instead of “the model said so,” Lumyn returns a
verdict — TRUST | ABSTAIN | ESCALATE | QUERY — and writes a durable Decision Record
you can replay during incidents.
Why teams adopt Lumyn
- Write-path safety: gates consequential actions with explicit policy and outcomes.
- Replayable decisions: stable digests (
policy.policy_hash,request.context.digest,determinism.inputs_digest). - No bluffing: uncertainty becomes
ABSTAIN,ESCALATE, orQUERYwith reason codes. - Compounding reliability: labeled failures/successes feed Experience Memory similarity.
- Drop-in: works as a Python library and as an optional HTTP service.
The primitive
You wrap a risky action with decide():
- you provide a
DecisionRequest(subject, action, evidence,context.digest) - Lumyn evaluates deterministic policy + risk signals + experience similarity
- Lumyn returns a
DecisionRecordand persists it (append-only)
The Decision Record is the unit you export into incidents, tickets, and postmortems.
What a Decision Record looks like
{
"schema_version": "decision_record.v0",
"decision_id": "dec_01JZ1S7Y1NQ2A0D5JQK2Q2P3X4",
"created_at": "2026-01-13T14:12:05Z",
"request": {
"schema_version": "decision_request.v0",
"subject": { "type": "service", "id": "support-agent", "tenant_id": "acme" },
"action": {
"type": "support.refund",
"intent": "Refund duplicate charge for order 82731",
"target": { "system": "stripe", "resource_type": "charge", "resource_id": "ch_123" },
"amount": { "value": 201.0, "currency": "USD" },
"tags": ["duplicate_charge"]
},
"evidence": { "ticket_id": "ZD-1001", "order_id": "82731", "customer_id": "C-9" },
"context": { "mode": "digest_only", "digest": "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }
},
"policy": {
"policy_id": "lumyn-support",
"policy_version": "0.1.0",
"policy_hash": "sha256:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"mode": "enforce"
},
"verdict": "ESCALATE",
"reason_codes": ["REFUND_OVER_ESCALATION_LIMIT"],
"matched_rules": [
{ "rule_id": "R008", "stage": "ESCALATIONS", "effect": "ESCALATE", "reason_codes": ["REFUND_OVER_ESCALATION_LIMIT"] }
],
"risk_signals": {
"uncertainty_score": 0.12,
"failure_similarity": { "score": 0.07, "top_k": [] }
},
"determinism": {
"engine_version": "0.1.0",
"evaluation_order": ["REQUIREMENTS", "HARD_BLOCKS", "ESCALATIONS", "TRUST_PATHS", "DEFAULT"],
"inputs_digest": "sha256:cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc"
}
}
Quickstart (intended)
The MVP ships as:
- a Python package + CLI (
lumyn) - an optional local service (
POST /v0/decide)
Install (once published to PyPI):
pip install lumyn
Key CLI workflows:
lumyn init(creates local SQLite + starter policy)lumyn demo(emits a few real-looking Decision Records as JSON)lumyn decide --in request.json(prints a Decision Record)lumyn show <decision_id>,lumyn explain <decision_id>,lumyn export <decision_id>lumyn export <decision_id> --pack --out decision_pack.ziplumyn label <decision_id> --label failure --summary "Bad outcome in prod"lumyn policy validate(validates.lumyn/policy.yml) orlumyn policy validate --path ./policy.ymllumyn doctor(workspace health + counts)
Service mode (FastAPI):
uv run python -c "from lumyn.api.app import create_app; app = create_app(); print(app)"(sanity)- Run with Uvicorn:
uv run uvicorn --factory lumyn.api.app:create_app --host 127.0.0.1 --port 8000 - Env config:
LUMYN_POLICY_PATH,LUMYN_STORAGE_URL(e.g.sqlite:.lumyn/lumyn.db),LUMYN_MODE,LUMYN_REDACTION_PROFILE,LUMYN_SIGNING_SECRET - If
LUMYN_SIGNING_SECRETis set,POST /v0/deciderequiresX-Lumyn-Signature: sha256:<hmac(body)>over the exact request body bytes. GET /v0/policyreturns{policy_id, policy_version, policy_hash}for the currently loaded policy.
Docs:
docs/quickstart.md
Documentation
PRD.md: what we’re building, for whom, and whySPECS_SCHEMAS.md: canonical contracts + determinism rules (v0)PLAN.md: epics/stories with acceptance criteria and testsREPO_STRUCTURE.md: proposed OSS layout
Design principles
- Decision as an artifact: every gate yields a record.
- Policy + outcomes, not prompts: rules tie to action classes and objective outcomes.
- Telemetry ≠ truth: OpenTelemetry is for visibility; the Decision Record is the system of record.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lumyn-0.1.0.tar.gz.
File metadata
- Download URL: lumyn-0.1.0.tar.gz
- Upload date:
- Size: 122.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0e7a28963dafeafc41705e3d41e546a28d60d6e96bfcebc037d82daa05fa857
|
|
| MD5 |
2e9951d1bc3057c47fdf42141370fa7a
|
|
| BLAKE2b-256 |
4659c28b06758232d791e9b50306880a45437456e8305934fff58bb100bc7d57
|
Provenance
The following attestation bundles were made for lumyn-0.1.0.tar.gz:
Publisher:
release.yml on davidahmann/lumyn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lumyn-0.1.0.tar.gz -
Subject digest:
a0e7a28963dafeafc41705e3d41e546a28d60d6e96bfcebc037d82daa05fa857 - Sigstore transparency entry: 764479156
- Sigstore integration time:
-
Permalink:
davidahmann/lumyn@67c5ed5e600bf548c218e387c5fc8cbfd67765a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/davidahmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67c5ed5e600bf548c218e387c5fc8cbfd67765a8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file lumyn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lumyn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23a30e0f7a0e11e5f74af95880653181a4c7f2d0137f2f85c648a254022c6e73
|
|
| MD5 |
58c11a84e536e5741d3c07012f12c9b9
|
|
| BLAKE2b-256 |
52cf9b7b428e4ddb7e57ca656e78b87b6d6ebbaab532713fa6560ab901cbf627
|
Provenance
The following attestation bundles were made for lumyn-0.1.0-py3-none-any.whl:
Publisher:
release.yml on davidahmann/lumyn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lumyn-0.1.0-py3-none-any.whl -
Subject digest:
23a30e0f7a0e11e5f74af95880653181a4c7f2d0137f2f85c648a254022c6e73 - Sigstore transparency entry: 764479160
- Sigstore integration time:
-
Permalink:
davidahmann/lumyn@67c5ed5e600bf548c218e387c5fc8cbfd67765a8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/davidahmann
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67c5ed5e600bf548c218e387c5fc8cbfd67765a8 -
Trigger Event:
push
-
Statement type: