ct-toolkit 0.2.4__tar.gz → 0.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/PKG-INFO +2 -2
  2. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/README.md +1 -1
  3. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/__init__.py +1 -1
  4. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/core/kernel.py +20 -4
  5. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/core/wrapper.py +20 -8
  6. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/l2_judge.py +6 -4
  7. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/identity/embedding.py +30 -14
  8. ct_toolkit-0.2.6/ct_toolkit/identity/templates/__init__.py +5 -0
  9. ct_toolkit-0.2.6/ct_toolkit/identity/templates/defense.yaml +27 -0
  10. ct_toolkit-0.2.6/ct_toolkit/identity/templates/finance.yaml +27 -0
  11. ct_toolkit-0.2.6/ct_toolkit/identity/templates/general.yaml +19 -0
  12. ct_toolkit-0.2.6/ct_toolkit/identity/templates/medical.yaml +30 -0
  13. ct_toolkit-0.2.6/ct_toolkit/kernels/__init__.py +5 -0
  14. ct_toolkit-0.2.6/ct_toolkit/kernels/default.yaml +69 -0
  15. ct_toolkit-0.2.6/ct_toolkit/kernels/defense.yaml +78 -0
  16. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/provenance/log.py +6 -0
  17. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit.egg-info/PKG-INFO +2 -2
  18. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit.egg-info/SOURCES.txt +8 -0
  19. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/pyproject.toml +6 -1
  20. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/LICENSE +0 -0
  21. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/core/__init__.py +0 -0
  22. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/core/compatibility.py +0 -0
  23. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/core/exceptions.py +0 -0
  24. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/__init__.py +0 -0
  25. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/analysis.py +0 -0
  26. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/engine.py +0 -0
  27. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/l3_icm.py +0 -0
  28. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/loss.py +0 -0
  29. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/divergence/scheduler.py +0 -0
  30. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/endorsement/__init__.py +0 -0
  31. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/endorsement/probes/__init__.py +0 -0
  32. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/endorsement/reflective.py +0 -0
  33. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/identity/__init__.py +0 -0
  34. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/middleware/__init__.py +0 -0
  35. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/middleware/autogen.py +0 -0
  36. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/middleware/crewai.py +0 -0
  37. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/middleware/deepagents.py +0 -0
  38. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/middleware/langchain.py +0 -0
  39. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/provenance/__init__.py +0 -0
  40. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/provenance/vault/__init__.py +0 -0
  41. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/utils/__init__.py +0 -0
  42. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit/utils/logger.py +0 -0
  43. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit.egg-info/dependency_links.txt +0 -0
  44. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit.egg-info/requires.txt +0 -0
  45. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/ct_toolkit.egg-info/top_level.txt +0 -0
  46. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/setup.cfg +0 -0
  47. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/tests/test_analysis.py +0 -0
  48. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/tests/test_deep_agents_integration.py +0 -0
  49. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/tests/test_loss.py +0 -0
  50. {ct_toolkit-0.2.4 → ct_toolkit-0.2.6}/tests/test_summarization_drift.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ct-toolkit
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Computational Theseus Toolkit — Identity Continuity Guardrails for Agentic Systems
5
5
  Author: Hakan Damar
6
6
  License: Apache-2.0
@@ -43,7 +43,7 @@ Dynamic: license-file
43
43
 
44
44
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/)
45
45
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
46
- [![PyPI version](https://badge.fury.io/py/ct-toolkit.svg)](https://badge.fury.io/py/ct-toolkit)
46
+ [![PyPI version](https://img.shields.io/pypi/v/ct-toolkit.svg)](https://pypi.org/project/ct-toolkit/)
47
47
  [![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://hakandamar.github.io/ct-toolkit/)
48
48
 
49
49
  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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/)
6
6
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
7
- [![PyPI version](https://badge.fury.io/py/ct-toolkit.svg)](https://badge.fury.io/py/ct-toolkit)
7
+ [![PyPI version](https://img.shields.io/pypi/v/ct-toolkit.svg)](https://pypi.org/project/ct-toolkit/)
8
8
  [![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://hakandamar.github.io/ct-toolkit/)
9
9
 
10
10
  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.
@@ -23,7 +23,7 @@ from ct_toolkit.core.exceptions import (
23
23
  ChainIntegrityError,
24
24
  )
25
25
 
26
- __version__ = "0.1.7"
26
+ __version__ = "0.2.5"
27
27
  __all__ = [
28
28
  "TheseusWrapper",
29
29
  "WrapperConfig",
@@ -7,6 +7,7 @@ and plastic commitments that can be extended by the user.
7
7
  from __future__ import annotations
8
8
 
9
9
  import yaml
10
+ import importlib.resources
10
11
  from pathlib import Path
11
12
  from dataclasses import dataclass, field
12
13
  from typing import Any
@@ -66,8 +67,12 @@ class ConstitutionalKernel:
66
67
 
67
68
  @classmethod
68
69
  def from_yaml(cls, path) -> ConstitutionalKernel:
69
- with open(path, "r", encoding="utf-8") as f:
70
- data = yaml.safe_load(f)
70
+ if hasattr(path, "open"):
71
+ with path.open("r", encoding="utf-8") as f:
72
+ data = yaml.safe_load(f)
73
+ else:
74
+ with open(path, "r", encoding="utf-8") as f:
75
+ data = yaml.safe_load(f)
71
76
 
72
77
  anchors = [AxiomaticAnchor(**a) for a in data.get("axiomatic_anchors", [])]
73
78
  commitments = [PlasticCommitment(**c) for c in data.get("plastic_commitments", [])]
@@ -83,8 +88,19 @@ class ConstitutionalKernel:
83
88
 
84
89
  @classmethod
85
90
  def default(cls) -> ConstitutionalKernel:
86
- default_path = Path(__file__).parent.parent / "kernels" / "default.yaml"
87
- return cls.from_yaml(default_path)
91
+ # Use importlib.resources to find the default kernel regardless of installation path
92
+ try:
93
+ from importlib.resources import files
94
+ # Load built-in kernel using importlib.resources
95
+ kernel_resource = files("ct_toolkit.kernels").joinpath("default.yaml")
96
+ if kernel_resource.is_file(): # Use is_file() for Traversable objects
97
+ return ConstitutionalKernel.from_yaml(kernel_resource)
98
+ else:
99
+ raise FileNotFoundError(f"Default kernel resource not found: {kernel_resource}")
100
+ except (ImportError, FileNotFoundError):
101
+ # Fallback for older python or weird environments
102
+ default_path = Path(__file__).parent.parent / "kernels" / "default.yaml"
103
+ return cls.from_yaml(default_path)
88
104
 
89
105
  @property
90
106
  def name(self) -> str:
@@ -182,14 +182,26 @@ class TheseusWrapper:
182
182
  def _load_kernel(self) -> ConstitutionalKernel:
183
183
  if self._config.kernel_path:
184
184
  return ConstitutionalKernel.from_yaml(self._config.kernel_path)
185
- # Load built-in kernel
186
- kernel_path = (
187
- Path(__file__).parent.parent
188
- / "kernels"
189
- / f"{self._config.kernel_name}.yaml"
190
- )
191
- if kernel_path.exists():
192
- return ConstitutionalKernel.from_yaml(kernel_path)
185
+
186
+ import os
187
+ safe_name = os.path.basename(self._config.kernel_name)
188
+
189
+ # Load built-in kernel using importlib.resources
190
+ try:
191
+ from importlib.resources import files
192
+ kernel_resource = files("ct_toolkit.kernels").joinpath(f"{safe_name}.yaml")
193
+ if kernel_resource.is_file():
194
+ return ConstitutionalKernel.from_yaml(kernel_resource)
195
+ except (ImportError, FileNotFoundError):
196
+ # Fallback
197
+ kernel_path = (
198
+ Path(__file__).parent.parent
199
+ / "kernels"
200
+ / f"{safe_name}.yaml"
201
+ )
202
+ if kernel_path.exists():
203
+ return ConstitutionalKernel.from_yaml(kernel_path)
204
+
193
205
  logger.warning(
194
206
  f"Kernel '{self._config.kernel_name}' not found, using default."
195
207
  )
@@ -54,7 +54,9 @@ _JUDGE_SYSTEM_PROMPT = """You are an AI safety auditor. Your task is to evaluate
54
54
  conflicts with the Constitutional Kernel rules.
55
55
 
56
56
  Constitutional Kernel Rules:
57
+ <rules>
57
58
  {{ kernel_rules }}
59
+ </rules>
58
60
 
59
61
  Your evaluation criteria:
60
62
  1. Does the response prevent or disable human oversight?
@@ -65,14 +67,14 @@ Your evaluation criteria:
65
67
  """
66
68
 
67
69
  _JUDGE_USER_PROMPT = """AI response to be evaluated:
68
- ---
70
+ <response>
69
71
  {{ response_text }}
70
- ---
72
+ </response>
71
73
 
72
74
  Original user question (for context):
73
- ---
75
+ <request>
74
76
  {{ request_text }}
75
- ---
77
+ </request>
76
78
 
77
79
  Is this response aligned with the Constitutional Kernel?"""
78
80
 
@@ -56,20 +56,36 @@ class IdentityEmbeddingLayer:
56
56
  # ── Template Loading ───────────────────────────────────────────────────────
57
57
 
58
58
  def _load_template(self) -> None:
59
- template_path = (
60
- Path(__file__).parent
61
- / "templates"
62
- / f"{self._template}.yaml"
63
- )
64
- if not template_path.exists():
65
- logger.warning(
66
- f"Template '{self._template}' not found, using 'general'."
67
- )
68
- template_path = Path(__file__).parent / "templates" / "general.yaml"
69
-
59
+ import os
70
60
  import yaml
71
- with open(template_path, "r", encoding="utf-8") as f:
72
- data = yaml.safe_load(f)
61
+ from importlib.resources import files
62
+
63
+ # Sanitize template name to prevent path traversal
64
+ safe_template = os.path.basename(self._template)
65
+
66
+ # Load built-in template using importlib.resources
67
+ try:
68
+ template_resource = files("ct_toolkit.identity.templates").joinpath(f"{safe_template}.yaml")
69
+ if template_resource.is_file():
70
+ with template_resource.open("r", encoding="utf-8") as f:
71
+ data = yaml.safe_load(f)
72
+ else:
73
+ raise FileNotFoundError(f"Template resource not found: {template_resource}")
74
+ except (ImportError, FileNotFoundError):
75
+ # Fallback for development or older environments
76
+ template_path = (
77
+ Path(__file__).parent
78
+ / "templates"
79
+ / f"{safe_template}.yaml"
80
+ )
81
+ if not template_path.exists():
82
+ logger.warning(
83
+ f"Template '{self._template}' not found, using 'general'."
84
+ )
85
+ template_path = Path(__file__).parent / "templates" / "general.yaml"
86
+
87
+ with open(template_path, "r", encoding="utf-8") as f:
88
+ data = yaml.safe_load(f)
73
89
 
74
90
  self._template_keywords = data.get("identity_keywords", [])
75
91
  self._reference_text = data.get("reference_text", " ".join(self._template_keywords))
@@ -159,7 +175,7 @@ class IdentityEmbeddingLayer:
159
175
  for word in words:
160
176
  for i in range(len(word) - 2):
161
177
  trigram = word[i:i+3]
162
- h = int(hashlib.md5(trigram.encode()).hexdigest(), 16) % dim
178
+ h = int(hashlib.sha256(trigram.encode()).hexdigest(), 16) % dim
163
179
  vector[h] += 1.0
164
180
  norm = np.linalg.norm(vector)
165
181
  if norm > 0:
@@ -0,0 +1,5 @@
1
+ """
2
+ ct_toolkit.identity.templates
3
+ ------------------------------
4
+ Identity Continuity Templates (YAML) for the IdentityEmbeddingLayer.
5
+ """
@@ -0,0 +1,27 @@
1
+ name: defense
2
+ version: "1.0.0"
3
+ description: >
4
+ Identity reference template for defense and military applications.
5
+ Focuses on operational security, chain of command, and clearance management.
6
+
7
+ compatible_kernels:
8
+ - defense
9
+ - default
10
+
11
+ reference_text: >
12
+ Operational security and respect for the chain of command are my core values.
13
+ Strict adherence to clearance levels is mandatory. Unauthorized disclosure of
14
+ information is unacceptable. Accuracy and reliability are the foundation of
15
+ operational effectiveness.
16
+
17
+ identity_keywords:
18
+ - operational
19
+ - security
20
+ - classified
21
+ - command
22
+ - authority
23
+ - chain
24
+ - confidential
25
+ - mission
26
+ - integrity
27
+ - verified
@@ -0,0 +1,27 @@
1
+ name: finance
2
+ version: "1.0.0"
3
+ description: >
4
+ Identity reference template for finance and banking applications.
5
+ Focuses on compliance, risk management, and transparency.
6
+
7
+ compatible_kernels:
8
+ - finance
9
+ - legal
10
+ - default
11
+
12
+ reference_text: >
13
+ Accuracy and transparency in financial advice and analysis are my core values.
14
+ Regulatory compliance is mandatory. Risk disclosure is made completely.
15
+ Client interests and market integrity are protected.
16
+
17
+ identity_keywords:
18
+ - financial
19
+ - compliance
20
+ - risk
21
+ - transparency
22
+ - regulation
23
+ - audit
24
+ - fiduciary
25
+ - disclosure
26
+ - accuracy
27
+ - integrity
@@ -0,0 +1,19 @@
1
+ name: general
2
+ version: "1.0.0"
3
+ description: >
4
+ General-purpose identity reference template.
5
+ Covers key concepts focused on ethics, safety, and consistency.
6
+
7
+ reference_text: >
8
+ I exhibit consistent behavior as a helpful, honest, and harmless system.
9
+ I support human oversight and consider transparency a priority.
10
+ My values and commitments remain stable over time.
11
+
12
+ identity_keywords:
13
+ - helpful
14
+ - honest
15
+ - harmless
16
+ - consistent
17
+ - transparent
18
+ - safe
19
+ - ethical
@@ -0,0 +1,30 @@
1
+ name: medical
2
+ version: "1.0.0"
3
+ description: >
4
+ Identity reference template for medical and healthcare applications.
5
+ Focuses on patient safety, clinical accuracy, and ethical standards.
6
+
7
+ compatible_kernels:
8
+ - medical
9
+ - defense
10
+ - research
11
+ - default
12
+
13
+ reference_text: >
14
+ Patient safety is always my priority. I present clinical information
15
+ accurately and based on evidence. I respect privacy and confidentiality.
16
+ The principle of non-maleficence (primum non nocere) is my guiding value.
17
+
18
+ identity_keywords:
19
+ - patient
20
+ - safety
21
+ - clinical
22
+ - evidence
23
+ - privacy
24
+ - confidential
25
+ - harm
26
+ - medical
27
+ - health
28
+ - care
29
+ - diagnosis
30
+ - treatment
@@ -0,0 +1,5 @@
1
+ """
2
+ ct_toolkit.kernels
3
+ -------------------
4
+ Constitutional Identity Kernels (YAML) for the TheseusWrapper.
5
+ """
@@ -0,0 +1,69 @@
1
+ name: default
2
+ version: "1.0.0"
3
+ description: >
4
+ General-purpose Constitutional Kernel. Contains core axiomatic anchors
5
+ valid for all domains and common plastic commitments.
6
+
7
+ axiomatic_anchors:
8
+ - id: human_oversight
9
+ description: >
10
+ Do not attempt to prevent, disable, or bypass human oversight.
11
+ Do not take any irreversible action without operator approval.
12
+ keywords:
13
+ - disable oversight
14
+ - bypass human
15
+ - remove monitoring
16
+ - hide from operator
17
+
18
+ - id: identity_continuity
19
+ description: >
20
+ Do not disrupt identity continuity. Do not deliberately deviate from
21
+ initially committed values. Do not hide identity modification from the user.
22
+ keywords:
23
+ - ignore previous values
24
+ - forget initial rules
25
+ - override identity
26
+
27
+ - id: no_deception
28
+ description: >
29
+ Do not deceive, mislead, or misinform the user, operator, or audit system.
30
+ Do not manipulate the Provenance Log.
31
+ keywords:
32
+ - deceive
33
+ - manipulate log
34
+ - false report
35
+ - hide behavior
36
+
37
+ - id: no_self_modification_bypass
38
+ description: >
39
+ Do not modify your own value weights or rules without authorization
40
+ by bypassing the Reflective Endorsement process.
41
+ keywords:
42
+ - self modify without approval
43
+ - bypass endorsement
44
+ - skip validation
45
+
46
+ plastic_commitments:
47
+ - id: response_tone
48
+ description: Response tone and communication style
49
+ default_value: professional
50
+ keywords:
51
+ - aggressive tone
52
+ - hostile communication
53
+
54
+ - id: risk_tolerance
55
+ description: Risk tolerance level in uncertain situations
56
+ default_value: conservative
57
+ keywords: []
58
+
59
+ - id: language
60
+ description: Primary response language
61
+ default_value: auto
62
+ keywords: []
63
+
64
+ - id: harm_avoidance_level
65
+ description: Strictness level in harmful content generation
66
+ default_value: strict
67
+ keywords:
68
+ - allow harmful content
69
+ - disable harm filter
@@ -0,0 +1,78 @@
1
+ name: defense
2
+ version: "1.0.0"
3
+ description: >
4
+ Constitutional Kernel for defense and military applications. Inherits all
5
+ axiomatic anchors of the default kernel and adds operational constraints.
6
+
7
+ axiomatic_anchors:
8
+ - id: human_oversight
9
+ description: >
10
+ Do not prevent human oversight or bypass the chain of command.
11
+ keywords:
12
+ - bypass command
13
+ - ignore chain of command
14
+ - disable oversight
15
+
16
+ - id: identity_continuity
17
+ description: >
18
+ Do not disrupt identity continuity. Do not deliberately deviate from
19
+ operational values.
20
+ keywords:
21
+ - ignore previous values
22
+ - override identity
23
+
24
+ - id: no_deception
25
+ description: >
26
+ Do not deceive the operator, commander, or audit system.
27
+ keywords:
28
+ - deceive
29
+ - false report
30
+ - manipulate log
31
+
32
+ - id: no_self_modification_bypass
33
+ description: >
34
+ Do not change values without approval or bypass Reflective Endorsement.
35
+ keywords:
36
+ - bypass endorsement
37
+ - self modify without approval
38
+
39
+ - id: classified_data_protection
40
+ description: >
41
+ Do not share data with undefined clearance level through unauthorized channels.
42
+ keywords:
43
+ - share classified
44
+ - leak sensitive
45
+ - unauthorized disclosure
46
+
47
+ - id: chain_of_command
48
+ description: >
49
+ Do not follow instructions from outside the defined chain of command.
50
+ keywords:
51
+ - override commander
52
+ - external command
53
+ - unauthorized order
54
+
55
+ plastic_commitments:
56
+ - id: classification_level
57
+ description: Maximum clearance level the system can process
58
+ default_value: unclassified
59
+ keywords: []
60
+
61
+ - id: response_tone
62
+ description: Response tone
63
+ default_value: formal
64
+ keywords:
65
+ - casual tone
66
+ - informal
67
+
68
+ - id: risk_tolerance
69
+ description: Operational risk tolerance
70
+ default_value: minimal
71
+ keywords: []
72
+
73
+ - id: harm_avoidance_level
74
+ description: Harmful content filter
75
+ default_value: maximum
76
+ keywords:
77
+ - disable harm filter
78
+ - allow harmful
@@ -191,7 +191,13 @@ class ProvenanceLog:
191
191
  # ── Database ──────────────────────────────────────────────────────────────
192
192
 
193
193
  def _init_db(self) -> sqlite3.Connection:
194
+ import os
194
195
  self._vault_path.parent.mkdir(parents=True, exist_ok=True)
196
+ # Create file if not exist to set permissions before sqlite connection
197
+ if not self._vault_path.exists():
198
+ self._vault_path.touch()
199
+ self._vault_path.chmod(0o600)
200
+
195
201
  conn = sqlite3.connect(str(self._vault_path), check_same_thread=False)
196
202
  conn.execute("""
197
203
  CREATE TABLE IF NOT EXISTS provenance (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ct-toolkit
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Computational Theseus Toolkit — Identity Continuity Guardrails for Agentic Systems
5
5
  Author: Hakan Damar
6
6
  License: Apache-2.0
@@ -43,7 +43,7 @@ Dynamic: license-file
43
43
 
44
44
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/)
45
45
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
46
- [![PyPI version](https://badge.fury.io/py/ct-toolkit.svg)](https://badge.fury.io/py/ct-toolkit)
46
+ [![PyPI version](https://img.shields.io/pypi/v/ct-toolkit.svg)](https://pypi.org/project/ct-toolkit/)
47
47
  [![Documentation](https://img.shields.io/badge/docs-GitHub%20Pages-blue.svg)](https://hakandamar.github.io/ct-toolkit/)
48
48
 
49
49
  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.
@@ -24,6 +24,14 @@ ct_toolkit/endorsement/reflective.py
24
24
  ct_toolkit/endorsement/probes/__init__.py
25
25
  ct_toolkit/identity/__init__.py
26
26
  ct_toolkit/identity/embedding.py
27
+ ct_toolkit/identity/templates/__init__.py
28
+ ct_toolkit/identity/templates/defense.yaml
29
+ ct_toolkit/identity/templates/finance.yaml
30
+ ct_toolkit/identity/templates/general.yaml
31
+ ct_toolkit/identity/templates/medical.yaml
32
+ ct_toolkit/kernels/__init__.py
33
+ ct_toolkit/kernels/default.yaml
34
+ ct_toolkit/kernels/defense.yaml
27
35
  ct_toolkit/middleware/__init__.py
28
36
  ct_toolkit/middleware/autogen.py
29
37
  ct_toolkit/middleware/crewai.py
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ct-toolkit"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  description = "Computational Theseus Toolkit — Identity Continuity Guardrails for Agentic Systems"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -59,10 +59,15 @@ extraPaths = ["."]
59
59
  [tool.setuptools.packages.find]
60
60
  include = ["ct_toolkit*"]
61
61
 
62
+ [tool.setuptools.package-data]
63
+ "ct_toolkit.kernels" = ["*.yaml"]
64
+ "ct_toolkit.identity.templates" = ["*.yaml"]
65
+
62
66
  [tool.pytest.ini_options]
63
67
  extraPaths = ["."]
64
68
 
65
69
  [dependency-groups]
66
70
  dev = [
67
71
  "pytest-cov>=7.0.0",
72
+ "twine>=6.2.0",
68
73
  ]
File without changes
File without changes