Computational Theseus Toolkit¶
Know what your AI agents are doing, and keep them who you designed them to be.
CT Toolkit sits between your code and your model, and watches two things:
- Identity drift. Over thousands of calls, an agent can slowly move away from the rules it was deployed with. The toolkit, which guards against this Sequential Self-Compression (SSC), measures that drift and reports it.
- Tool calls. Before an agent runs a command or a tool, the toolkit checks it: a tool nobody declared, data sent to a host the task never mentioned, or a command that reads secrets. You decide whether it only records these, or blocks them.
Every decision is signed and chained, so you can show later what happened and why.
Get Started with Python View on GitHub
Two lines of code. Full identity protection.¶
# Before
# response = openai.OpenAI().chat.completions.create(...)
# After — sync (`chat`), async (`achat`), and streaming (`stream=True`) guardrails
client = TheseusWrapper(provider="openai")
response = client.chat("What are your core values?")
print(f"Divergence Score: {response.divergence_score:.4f}") # 0.0 = aligned, 1.0 = drifted
Audit & Telemetry Dashboard (CLI & Web UI)¶
Inspect HMAC provenance chain integrity, L1/L2/L3 divergence tier distribution, and staged sandbox rules in your terminal (ct-toolkit status) or via the local interactive Web Audit Dashboard (ct-toolkit dashboard --web):

Why CT Toolkit?¶
-
Constitutional Kernels
Define immutable Axiomatic Anchors that never change, and Plastic Commitments that evolve through formal approval.
-
3-Tier Contrastive Divergence Engine
Layered monitoring from contrastive L1 embeddings (positive + negative anchors) to non-blocking background L3 identity probes with automatic circuit breaking.
-
Hierarchical & Distributed Safety
Mother agent constraints propagate to sub-agents in-process or via HMAC-SHA256 signed HTTP headers as read-only axioms.
-
Cryptographic Provenance & OTel
Every interaction is signed with HMAC-SHA256 and chained in SQLite or PostgreSQL, paired with OpenTelemetry spans and metrics.
-
Framework Middleware
Drop-in support for LangChain, Deep Agents, CrewAI, and AutoGen. Add identity protection to your existing agent stack without rewriting a single chain.
-
Tool-Call Guard
Reviews the tool calls an agent wants to run: undeclared tools, unexpected hosts and risky commands. Record only, or block, from the CLI, the proxy or the dashboard.
-
CLI & Interactive Web Dashboard
Watch provenance, divergence tiers, tool-call decisions and sandbox cooldowns, and change the guard settings, from the terminal or the localhost-bound Web Audit Dashboard.
Existing guardrails aren't enough¶
| Llama-Guard / rule engines | CT Toolkit | |
|---|---|---|
| Checks what the agent does | ✗ Mostly classifies text | ✓ Reviews tool calls before they run |
| Stateful drift detection | ✗ Stateless per prompt | ✓ Tracks identity over thousands of calls |
| Multi-agent hierarchies | ✗ No hierarchy awareness | ✓ Propagates kernel constraints to sub-agents |
| Observe first, enforce later | ✗ Binary block or allow | ✓ Observe mode records; enforce mode removes risky calls |
| No agent code changes | ✗ Needs integration | ✓ Proxy for OpenAI and Anthropic APIs, or wrap your client |
| Local judge option | ✗ Hosted model | ✓ Optional small local model, off by default |
| Formal rule evolution | ✗ Binary block or allow | ✓ Reflective Endorsement with signed approval |
| Cryptographic audit trail | ✗ No provenance | ✓ HMAC chain of every drift check and tool-call decision |
| Fine-tuning safety | ✗ No training constraints | ✓ DivergencePenaltyLoss for PyTorch ([ml]) |
Project status¶
| Metric | Status |
|---|---|
| Version | ✅ v0.5.2 |
| Tests | ✅ 635 passed, 13 skipped |
| Coverage | ✅ 90%+ |
| PyPI | ✅ pip install ct-toolkit |
| Downloads | |
| License | Apache 2.0 |
| Python | 3.11+ |