Skip to main content

Lightweight governance and trace SDK for AI systems

Project description

Monora v1 SDK

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.

Features

  • 🔒 Immutable Event Logs: Cryptographic hash chains for tamper detection
  • 📋 Policy Enforcement: Model allowlists/denylists with data classification controls
  • 🧭 Provider Registry: Explicit model-to-provider mapping with unknown-model alerts
  • 🧾 Versioned Registry: Registry versioning, history, and provider deprecation metadata
  • 🔍 Full Auditability: JSON-lines event logs with CLI reporting tools
  • 📎 Auto Reports: Compliance artifacts generated at trace completion with trust summaries
  • 📦 Trust Packages: One-shot vendor export with compliance, config snapshot, and hash-chain proof
  • ⚡ Non-blocking: Background worker with bounded queue for zero user-code latency
  • 🎯 Simple API: Decorator-based interface with sensible defaults
  • 🧩 Auto-Instrumentation: Optional OpenAI/Anthropic patching for drop-in logging
  • ✅ Completeness Checks: Event sequencing and security review reports
  • 🔌 Pluggable Sinks: Stdout, file, and HTTPS endpoints
  • 🚨 Violation Alerts: Callback or webhook notifications for policy violations
  • 🧹 Data Handling: Regex redaction rules tied to data classifications
  • 🛡️ Signed Attestations: Optional GPG-signed security review bundles

Installation

pip install -e .

# With YAML config support
pip install -e ".[yaml]"

# With HTTPS sink support
pip install -e ".[https]"

# Development dependencies
pip install -e ".[dev]"

Quick Start

Minimal Example (Dev Mode)

import monora

# Initialize with defaults (stdout logging, no policies)
monora.init()

@monora.llm_call(purpose="customer_support")
def ask_gpt(prompt: str, model: str = "gpt-4o-mini"):
    # Your LLM call here
    return {"response": "Hello!"}

# Use trace context for grouping events
with monora.trace("ticket_123"):
    response = ask_gpt("How do I reset my password?")

Guided Setup (Wizard)

monora init

This generates a monora.yml you can edit and pass to monora.init(config_path="monora.yml").

Validate & Diagnose

monora validate --config monora.yml
monora doctor --config monora.yml

Export Vendor Trust Package

trust_package = monora.export_trust_package(
    trace_id="trace-123",
    input_path="events.jsonl",
    config_path="monora.yml",
)

See README.md for full documentation and examples.

Testing

pytest

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monora-1.4.0.tar.gz (364.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monora-1.4.0-py3-none-any.whl (96.3 kB view details)

Uploaded Python 3

File details

Details for the file monora-1.4.0.tar.gz.

File metadata

  • Download URL: monora-1.4.0.tar.gz
  • Upload date:
  • Size: 364.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for monora-1.4.0.tar.gz
Algorithm Hash digest
SHA256 be672d051e574c25518e32dfe5b68c64c72367b3b43835a2c86402ba00f4c18c
MD5 8e3ad90dca0761a2298978f6bc802033
BLAKE2b-256 3475cc93464fb7b21570778ac9b6695b8b71e11b50a754af7a8bebce14c3c3cb

See more details on using hashes here.

File details

Details for the file monora-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: monora-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 96.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for monora-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9018d76f4383a7ce46eef6aa4e17d9b8e74c6258b443669a6b78af1972f26258
MD5 526e7e14afcdab36d25bc08801f58255
BLAKE2b-256 126dd54d1be8018540b07e005b150d786fcf4bdfc70f1233200e8f19016414e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page