Skip to main content

Deterministic runtime for AI agents — enforce constraints, verify policies, audit decisions

Project description

chimera-runtime

chimera-runtime

Deterministic Runtime for AI Agents
Stop trusting LLMs. Start constraining them.

PyPI Python License Dashboard CSL-Core

QuickstartConstraintsIntegrationsDashboardHow It Works


The Problem

LLMs don't follow rules. They approximate them.

They hallucinate. They get prompt-injected. They break constraints silently. And yet, we hand them real-world decisions -- financial approvals, infrastructure changes, customer-facing actions -- and hope for the best.

Hope is not a runtime strategy.

The Solution

Chimera is a deterministic execution layer that sits between your AI agent and the real world.

Not a wrapper. Not a filter. Not another prompt engineering trick.

A runtime that enforces constraints outside the model, verifies policies with formal logic (Z3), and blocks invalid actions before they happen.

Every decision is: Checked. Proven. Enforced.

Agent Intent → Constraint Guard → ALLOW / BLOCK / ASK_HUMAN → Audit Record

No exceptions. No bypass. No "the model said it was fine."


Quickstart

pip install chimera-runtime

chimera-runtime init
chimera-runtime run

Three commands. Your agent is now constrained.


Define Constraints

Two paths. Same enforcement.

Option A: YAML Rules (zero dependencies)

# policies/governance.yaml
rules:
  - name: manager_limit
    when: "role == 'MANAGER' and amount > 250000"
    then: BLOCK
    message: "Managers cannot approve more than $250,000"
  - name: weekend_freeze
    when: "is_weekend == 'YES' and urgency != 'CRITICAL'"
    then: BLOCK
    message: "No changes on weekends unless critical"

Option B: CSL with Z3 Formal Verification (recommended)

CONFIG {
  ENFORCEMENT_MODE: BLOCK
}

DOMAIN GovernanceGuard {
  VARIABLES {
    amount: 0..1000000
    role: {"ANALYST", "MANAGER", "DIRECTOR", "VP", "CEO"}
  }

  STATE_CONSTRAINT manager_approval_limit {
    WHEN role == "MANAGER"
    THEN amount <= 250000
  }
}

YAML gives you rules. CSL gives you mathematical proof that your constraints are consistent, reachable, and conflict-free -- before a single agent runs.

chimera-runtime verify policies/governance.csl

Framework Integrations

Chimera drops into whatever you're already using. No rewrites.

LangChain

from langchain_openai import ChatOpenAI
from chimera_runtime.integrations.langchain import wrap_tools, ChimeraCallbackHandler

guarded_tools = wrap_tools(your_tools, policy="./policies/governance.yaml")

handler = ChimeraCallbackHandler(policy="./policies/governance.yaml")
llm = ChatOpenAI(callbacks=[handler])

LangGraph

from chimera_runtime.integrations.langgraph import compliance_node

graph.add_node("constraint_gate", compliance_node(policy="./policies/governance.yaml"))

CrewAI

from chimera_runtime.integrations.crewai import wrap_crew_tools

guarded_tools = wrap_crew_tools(your_tools, policy="./policies/governance.yaml")

Direct Usage

from chimera_runtime import ChimeraAgent

agent = ChimeraAgent(
    model="gpt-4o",
    api_key="sk-...",
    policy="./policies/governance.csl",
)

result = agent.decide(
    "Approve $200k marketing spend for Q3",
    context={"role": "MANAGER", "department": "MARKETING"},
)

print(result.result)       # "ALLOWED"
print(result.action)       # "Allocate $200k to digital channels"

Every tool call. Every decision. Through the constraint guard. No exceptions.


Dashboard

Full runtime control plane at compliance.chimera-protocol.com.

Real-time decision enforcement

Real-time decision enforcement -- Live feed of every ALLOW, BLOCK, and ESCALATE. See exactly what your agents are doing and what they're being stopped from doing.

Policy management with formal verification

Policy management with formal verification -- Write, edit, and verify CSL policies. Z3 proves correctness before deployment. No untested constraints reach production.

Decision analytics

Decision analytics & block rate heatmaps -- What's getting blocked, when, and why. Patterns across agents, frameworks, and time.

Framework integration wizard

Framework integration wizard -- Four steps to wire Chimera into LangChain, LangGraph, CrewAI, LlamaIndex, or AutoGen.


How It Works

1. Define constraints in CSL
2. Z3 verifies correctness (reachability, consistency, conflict-freedom)
3. Runtime enforces at execution time

The model never sees the constraints. The model never evaluates the constraints. The model's opinion on whether it should be allowed to do something is irrelevant.

Constraints live outside the model. Enforcement happens outside the model. The model is a generator. Chimera is the governor.


CLI Reference

Command Description
chimera-runtime init Initialize project with config and starter policy
chimera-runtime run Interactive agent with real-time constraint enforcement
chimera-runtime run --daemon Pipe mode for JSON stdin/stdout
chimera-runtime stop [--force] Graceful or immediate halt
chimera-runtime verify [POLICY] Verify CSL policy (syntax + Z3 + IR)
chimera-runtime test [--skip-llm] End-to-end system test
chimera-runtime audit --stats Aggregate decision statistics
chimera-runtime audit --last 10 Recent decisions table
chimera-runtime audit --export FILE Export records (json/compact/stats)
chimera-runtime policy new NAME Create policy from template
chimera-runtime policy list List and verify all policies
chimera-runtime policy simulate FILE '{"k":"v"}' Test policy against input
chimera-runtime explain --id ID Generate Art. 86 HTML explanation
chimera-runtime docs generate Generate technical documentation
chimera-runtime license status Show current license tier
chimera-runtime license activate KEY Activate a license
chimera-runtime license deactivate Remove license key

EU AI Act

Compliance is a consequence -- not the product.

When you enforce deterministic constraints, maintain complete audit trails, and provide human oversight by design, you don't need to bolt on compliance after the fact. You already have it.

Article Requirement How Chimera Delivers It
Art. 9 Risk management Formal verification (Z3) proves policy correctness before deployment
Art. 12 Record-keeping Complete DecisionAuditRecord for every decision, automatically
Art. 13 Transparency Full decision explanations, audit queries, HTML reports
Art. 14 Human oversight ASK_HUMAN escalation, confirm/override/halt with audit trail
Art. 15 Accuracy & security Deterministic constraint gate -- not probabilistic filtering
Art. 19 Retention Configurable retention with automatic enforcement
Art. 86 Right to explanation Self-contained HTML reports per decision
Annex IV Technical documentation Auto-generated (14/19 sections)

Supported Frameworks & Providers

Integration Install Notes
LangChain pip install chimera-runtime[langchain] Tool wrapper + callback handler
LangGraph pip install chimera-runtime[langgraph] Node guard + state checkpoint
LlamaIndex pip install chimera-runtime[llamaindex] Tool spec + callback handler
CrewAI pip install chimera-runtime[crewai] Tool wrapper for crews
AutoGen pip install chimera-runtime[autogen] Agent wrapper
OpenAI pip install chimera-runtime[openai] gpt-4o, gpt-4o-mini, o1, o3
Anthropic pip install chimera-runtime[anthropic] claude-sonnet-4-20250514, claude-opus-4-20250514
Google pip install chimera-runtime[google] gemini-2.0-flash, gemini-2.5-pro
Ollama pip install chimera-runtime[ollama] llama3, mistral, qwen (local)
CSL-Core pip install chimera-runtime[csl] Z3 formal verification engine

Development

git clone https://github.com/akarlaraytu/chimera-runtime
cd chimera-runtime
pip install -e ".[dev,all]"
pytest tests/ -v

License

Apache License 2.0 -- see LICENSE for details.


LLMs generate. Chimera governs.
Built by Aytug Akarlar

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

chimera_runtime-1.1.0.tar.gz (132.3 kB view details)

Uploaded Source

Built Distribution

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

chimera_runtime-1.1.0-py3-none-any.whl (113.1 kB view details)

Uploaded Python 3

File details

Details for the file chimera_runtime-1.1.0.tar.gz.

File metadata

  • Download URL: chimera_runtime-1.1.0.tar.gz
  • Upload date:
  • Size: 132.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.5

File hashes

Hashes for chimera_runtime-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c23a8cf75f5fff16dc543ca430c1096a1bd6876fa7257f70bf18febf9ac38663
MD5 5fe035900bfb549a045e1a685a7dc5d6
BLAKE2b-256 8ad064d8a44d502e75b9585aa3249b55caf97cf47fc99754b182c98456cfc24f

See more details on using hashes here.

File details

Details for the file chimera_runtime-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chimera_runtime-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd04f2b848492991c2717c1f440a669695a318faaaaad0c974013dec0f88446e
MD5 20380f250e3cf04c25a0e702e879dddc
BLAKE2b-256 12f5fe80352c0324d8597103b711ede9fade78b234f673ead2a738ec15bf4358

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