Computational Theseus Toolkit¶
Identity Continuity & Hierarchical Guardrails for the Post-Drift AI Era.
CT Toolkit is an open-source security layer that prevents Sequential Self-Compression (SSC) in agentic systems — ensuring your AI agents remain who they were on day one, even after thousands of interactions.
Get Started with Python View on GitHub
Two lines of code. Full identity protection.¶
# Before
# response = openai.OpenAI().chat.completions.create(...)
# After — guardrails, drift detection, and audit log, all automatic
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
Why CT Toolkit?¶
-
Constitutional Kernels
Define immutable Axiomatic Anchors that never change, and Plastic Commitments that evolve through formal approval.
-
3-Tier Divergence Engine
Layered monitoring from zero-cost L1 embeddings to full L3 identity probes. Detect and block identity drift before it becomes systemic.
-
Hierarchical Safety
Mother agent constraints propagate to sub-agents as read-only axioms. Prevent small orchestrator deviations from cascading into massive fleet-wide drift.
-
Cryptographic Provenance
Every interaction is signed with HMAC-SHA256 and chained. Provide a regulator-ready audit trail of your agent's identity continuity.
-
Framework Middleware
Drop-in support for LangChain, CrewAI, and AutoGen. Add identity protection to your existing agent stack without rewriting a single chain.
-
Production Ready
Tested with latest frontier models and local endpoints. 90%+ test coverage and enterprise-grade security defaults.
Existing guardrails aren't enough¶
| Llama-Guard / Rule Engines | CT Toolkit | |
|---|---|---|
| Stateful drift detection | ✗ Stateless per-prompt | ✓ Tracks identity over thousands of calls |
| Multi-agent hierarchies | ✗ No hierarchy awareness | ✓ Propagates kernel constraints to sub-agents |
| Formal rule evolution | ✗ Binary block/allow | ✓ Reflective Endorsement with signed approval |
| Cryptographic audit trail | ✗ No provenance | ✓ HMAC hash chain, regulator-ready |
| Fine-tuning safety | ✗ No training constraints | ✓ DivergencePenaltyLoss for PyTorch |
Project status¶
| Metric | Status |
|---|---|
| Tests | ✅ 293/296 passing |
| Coverage | ✅ 89% |
| PyPI | ✅ pip install ct-toolkit |
| Downloads | |
| License | Apache 2.0 |
| Python | 3.11+ |