Skip to content

JamesMcDaniel04/Monora_SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

156 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monora — Agent Causal Proof

A signed, traversable causal-chain proof artifact for AI agents.

When an agent takes an action — flags a renewal, denies a claim, recommends a treatment, drafts a contract clause — Monora produces the receipt: a tamper-evident document that walks every step that led to the decision (the LLM calls, tool calls, retrievals, and intermediate decisions), with a cryptographic hash chain proving nothing was altered after the fact.

It's a flight data recorder for agents, with a legal chain of custody.

Who it's for

  • Insurance underwriters writing AI liability policies. When a claim is filed, the proof shows fault.
  • ISO 42001 / SOC 2 auditors. Every AI action is logged, causally linked, and auditable. Certification audits become a report query, not a forensics project.
  • Compliance officers and legal. Hand a PDF to opposing counsel and the proof speaks for itself.
  • Engineers building agents on regulated systems. Drop in the SDK; get the audit trail for free.

What you get

Two layers, one product:

  1. SDK (Python + Node). Wraps your agent's steps. Each step becomes a signed, immutable, hash-chained event. Auto-captures parent linkage so the causal chain builds itself.
  2. Hosted platform. Trace inbox, proof viewer with integrity banner (✓ verified / ✗ tampered), one-click PDF download, expiring share links for non-account auditors, RBAC (admin / auditor / viewer), API keys, multi-tenant projects.

The output of a query is a Causal Proof of Record — JSON for machines, PDF for humans.

CAUSAL PROOF OF RECORD
Proof ID: prf_a1b2c3
✓ HASH CHAIN VERIFIED — EVENT LOG UNTAMPERED

Root Cause: classify_intent returned "renewal_at_risk" because
the linked CRM opportunity had no close_date populated across 47 deals.

Step 1 → llm_call:classify_intent     (t=0ms,    confidence 99%)
Step 2 → tool_call:crm.getOpportunities (t=342ms,  confidence 97%)
Step 3 → decision:correlate_signals    (t=15ms,   confidence 94%)
Step 4 → outcome:flag_renewal_at_risk  (t=89ms,   confidence 91%)

Quick start

Install

# Python
pip install monora

# Node
npm install @monora/sdk

Instrument your agent

import { MonoraAgent } from '@monora/sdk'

const agent = new MonoraAgent({ traceId: 'deal-review-abc123', agentName: 'renewal-watcher' })

const meetings = await agent.step('llm_call', 'classify_intent',
  { prompt }, async () => llm.complete(prompt))

const opps = await agent.step('tool_call', 'crm.getOpportunities',
  { stage: 'Renewal' }, async () => crm.fetch({ stage: 'Renewal' }))

const choice = await agent.step('decision', 'pick_action',
  { candidates }, async () => rank(candidates))

await agent.outcome('renewal_at_risk', { account_id, recommended_action })

Get a proof

# JSON proof from local WAL
monora proof <trace_id> <outcome_event_id>

# PDF causal proof of record (via the hosted server)
curl https://<your-monora-host>/api/v1/traces/<trace_id>/proof/<outcome_event_id>.pdf -o proof.pdf

Share a proof with an auditor

curl -X POST https://<host>/api/v1/share-links \
  -d '{"proof_id":"prf_a1b2c3","ttl_hours":72}'
# → returns a signed URL the recipient can open without an account

How it works

  1. Each agent step emits an event. The envelope carries event_id, trace_id, parent_event_id, event_type, inputs, outputs, latency, and a SHA256 hash linking it to the previous event.
  2. Optional Ed25519 / HMAC signing at emit time. Tampering breaks the signature.
  3. Append-only persistence. Events go to a write-ahead log (local) or the hosted proof_events table (Supabase). UPDATE/DELETE are denied at the row-level.
  4. Proof = walk + verify. Given an outcome event, walk parent_event_id back to root. Recompute the hash chain. If anything is altered, integrity_verified = false and the failing step is identified by event_id.
  5. Render. Same JSON renders as machine-readable proof or as the PDF Causal Proof of Record.

What this is not

  • Not a dashboard with alerts and thresholds.
  • Not a CRM/calendar/Salesforce integration.
  • Not a RevOps natural-language query tool.
  • Not a "renewal use case" demo.
  • Not generic LLM observability.

It's one thing: the proof artifact. Everything else got cut.

Status

The pivot is in flight. See the plan for the 6-day execution shape (SDK strip → MonoraAgent → causal-proof builder → PDF generator → Supabase schema + edge function → REST API + RBAC → Vite SPA inbox/viewer).

License

MIT.

About

Lightweight governance and trace SDK for AI systems: Monora provides minimal viable trust through immutable event logs, policy enforcement, and comprehensive auditability for LLM applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors