Skip to main content

Computational Theseus Toolkit — Identity Continuity Guardrails for Agentic Systems

Project description

Computational Theseus Toolkit (CT Toolkit)

Identity Continuity Guardrails for Agentic Systems

Python 3.11+ License: Apache 2.0 PyPI version Documentation

CT Toolkit is an open-source security layer designed to preserve the identity continuity of AI agents over time. It implements the Nested Agency Architecture (NAA) framework to prevent Sequential Self-Compression (SSC) in multi-agent hierarchies.


📖 Official Documentation

For full API reference, architecture details, examples, and integration guides, visit our documentation site: 👉 https://hakandamar.github.io/ct-toolkit/


Why CT Toolkit?

In complex agentic workflows, LLMs tend to "drift" from their original instructions. CT Toolkit provides the mathematical and cryptographic guardrails to ensure your agents remain aligned with their core constitution, even across deep hierarchies.

  • Constitutional Kernels: Axiomatic identity anchors.
  • Standalone Auditor CLI: Rapidly audit any LLM endpoint for identity drift without writing code.
  • Autonomous Self-Correction: Active L2->L1 feedback loop that retries and corrects divergent responses before they reach the user.
  • Divergence Engine: Multi-tiered drift analysis (L1/L2/L3).
  • Hierarchical Propagation: Mother-to-child constraint inheritance.
  • Provenance Log: Immutable HMAC-signed interaction history.

Quick Start

pip install ct-toolkit
from ct_toolkit import TheseusWrapper

# One-line injection for any LLM provider
client = TheseusWrapper(provider="openai")

# Guardrails and drift analysis applied automatically
response = client.chat("What are your core security axioms?")

print(response.content)
print(f"Divergence Score: {response.divergence_score}")

🔍 Standalone Auditor (CLI)

Audit any LLM endpoint (OpenAI, Ollama, LM Studio) directly from your terminal:

# Audit a local Ollama model
ct-toolkit audit --url http://localhost:11434/v1 --kernel defense

# List available kernels and templates
ct-toolkit list-kernels
ct-toolkit list-templates

🚦 Project Health & Status

Metric Status
Tests ✅ 237/240 passing (90% coverage)
Last Phase ✅ Phase 6: Auditor Mode (Complete)
Current Goal 🔶 Phase 7: Multi-Agent Synchronization (Planning)

For a detailed breakdown of the 8-phase roadmap, see PROJECT_STATUS.md.

Framework & Model Support

Seamlessly integrate with your favorite frameworks and local models:

  • Local Models: Support for LM Studio, Ollama, and local Qwen/Llama endpoints.
  • LangChain & Deep Agents: wrap_deep_agent_factory.
  • CrewAI: TheseusCrewMiddleware.apply_to_crew.
  • AutoGen: register_reply hooks.

Theoretical Foundation

Translating the framework proposed in The Computational Theseus (2025) into engineering practice.


License

Apache License 2.0.

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

ct_toolkit-0.3.5.tar.gz (60.1 kB view details)

Uploaded Source

Built Distribution

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

ct_toolkit-0.3.5-py3-none-any.whl (67.4 kB view details)

Uploaded Python 3

File details

Details for the file ct_toolkit-0.3.5.tar.gz.

File metadata

  • Download URL: ct_toolkit-0.3.5.tar.gz
  • Upload date:
  • Size: 60.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ct_toolkit-0.3.5.tar.gz
Algorithm Hash digest
SHA256 44cc15c7127e43bd4b8965ad7e0fd8fd30d5316d8730ec6d4f7d4e944f41a951
MD5 9076934578e7aafe1aa1af3a7ba261cb
BLAKE2b-256 e09ba8fc58a41b926b7e7285b8771140b28ef533f253c9f305b25308123a348d

See more details on using hashes here.

File details

Details for the file ct_toolkit-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: ct_toolkit-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 67.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ct_toolkit-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c5f2b679b98ab062e5bdc8ded8abffe2e092d4ceb1a53ff6b1c1d5e2d75b9fba
MD5 a9518a1b46a92fc4cddc0bd483d8c861
BLAKE2b-256 f5d0fcc028f1cc26a0f25f8b2489496b23e67f4494a3b8e80f1d2ca9ee541c8b

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