Computational Theseus Toolkit — Identity Continuity Guardrails for Agentic Systems
Project description
Computational Theseus Toolkit (CT Toolkit)
Identity Continuity Guardrails for Agentic Systems
CT Toolkit is an open-source security layer designed to preserve the identity continuity of AI agents over time. It implements the Nested Agentic 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/
- Live Examples & Case Studies: Real-world scenarios like Financial Auditor Integrity.
- FastAPI Integration Test Project: Reference FastAPI app for validating CT Toolkit end-to-end across L1/L2/L3 guardrails and provenance logs with local model infrastructure.
- Deep Agents Integration Test Project: Reference Deep Agents app for validating CT Toolkit end-to-end with hierarchical agent workflows, L1/L2/L3 guardrails, and provenance logs.
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.
- Staged Approval (Cooldown): Verify risky kernel updates in a sandbox via shadow requests before production promotion.
- Passive Context Compression Detection: Automatically detects silent provider-side history compression (e.g., OpenAI/Anthropic).
- 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, WrapperConfig
# Protect against silent provider context compression
config = WrapperConfig(compression_passive_detection=True)
# One-line injection for any LLM provider
client = TheseusWrapper(provider="openai", config=config)
# 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
If you want a runnable application example instead of a CLI-only flow, see ct-toolkit-fastapi, a small FastAPI validation project that developers can use to test CT Toolkit locally with automated endpoints and pytest coverage.
For Deep Agents workflows, see ct-toolkit-deep-agents, a reference integration project for validating CT Toolkit in multi-agent orchestration scenarios.
🚦 Project Health & Status
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_replyhooks.
Theoretical Foundation
Translating the framework proposed in The Computational Theseus (2025) into engineering practice.
Community
- Contributing Guide: How to propose changes, run tests, and submit pull requests.
- Security Policy: How to report vulnerabilities responsibly.
- Code of Conduct: Expected behavior for contributors and maintainers.
- Support Guide: Where to ask questions, report bugs, and request features.
License
Apache License 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ct_toolkit-0.3.25.tar.gz.
File metadata
- Download URL: ct_toolkit-0.3.25.tar.gz
- Upload date:
- Size: 93.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bfb304eca56a3b77f524ff1559a9cee24b09266dc41723b421090d621566ad4b
|
|
| MD5 |
4bf9ce0123070c9665b68f0c046191f4
|
|
| BLAKE2b-256 |
3a68f4faa1ea81562deea19938559c0209f885b2d92d3c3d254c82937ecfa43f
|
File details
Details for the file ct_toolkit-0.3.25-py3-none-any.whl.
File metadata
- Download URL: ct_toolkit-0.3.25-py3-none-any.whl
- Upload date:
- Size: 105.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f22bc3c96bbf0b1055dc735b089cefc09e864861f4a92e1ac5f1a57862170225
|
|
| MD5 |
5fdc52b07564f5fb5d13e042a4d0d4d8
|
|
| BLAKE2b-256 |
1d34c8ddb696bc18bc8cd1cbc7d077519386d71b7cefc1e2a84db8debb602f64
|