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
# Or with CLI, Web Dashboard, Enterprise & Observability extras:
pip install "ct-toolkit[all]"
uv add "ct-toolkit[all]"
git clone https://github.com/Theseus-Guard/ct-toolkit
cd ct-toolkit
pip install -e ".[all]"

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 — 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):

CT Toolkit Web Audit & Telemetry Dashboard


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 Contrastive Divergence Engine


    Layered monitoring from contrastive L1 embeddings (positive + negative anchors) to non-blocking background L3 identity probes with automatic circuit breaking.

    Understand Divergence

  • Hierarchical & Distributed Safety


    Mother agent constraints propagate to sub-agents in-process or via HMAC-SHA256 signed HTTP headers as read-only axioms.

    Explore Multi-Agent Safety

  • Cryptographic Provenance & OTel


    Every interaction is signed with HMAC-SHA256 and chained in SQLite or PostgreSQL, paired with OpenTelemetry spans and metrics.

    View Compliance Tools

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

    Browse Integrations

  • CLI & Interactive Web Dashboard


    Monitor provenance chains, divergence tiers, and sandbox cooldowns via Rich CLI or the localhost-bound Web Audit Dashboard.

    Explore CLI & Web UI


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
Version ✅ v0.4.1
Tests ✅ 426 passed, 3 skipped
Coverage ✅ 90%+
PyPI ✅ pip install ct-toolkit
Downloads PyPI Downloads
License Apache 2.0
Python 3.11+

Full roadmap and status