Skip to content

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.

pip install ct-toolkit
uv add ct-toolkit
git clone https://github.com/hakandamar/ct-toolkit
cd ct-toolkit
pip install -e "."

Get Started with Python View on GitHub

OpenAIOpenAI AnthropicAnthropic OllamaOllama GoogleGoogle CohereCohere GroqGroq

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.

    Learn about Kernels

  • 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.

    Understand Divergence

  • Hierarchical Safety


    Mother agent constraints propagate to sub-agents as read-only axioms. Prevent small orchestrator deviations from cascading into massive fleet-wide drift.

    Explore Multi-Agent Safety

  • Cryptographic Provenance


    Every interaction is signed with HMAC-SHA256 and chained. Provide a regulator-ready audit trail of your agent's identity continuity.

    View Compliance Tools

  • Framework Middleware


    Drop-in support for LangChain, CrewAI, and AutoGen. Add identity protection to your existing agent stack without rewriting a single chain.

    Browse Integrations

  • Production Ready


    Tested with latest frontier models and local endpoints. 90%+ test coverage and enterprise-grade security defaults.

    Project Roadmap


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

Read the full rationale


Project status

Metric Status
Tests ✅ 293/296 passing
Coverage ✅ 89%
PyPI pip install ct-toolkit
Downloads PyPI Downloads
License Apache 2.0
Python 3.11+

Full roadmap and status