Skip to content

templetwo/threshold-protocols

Repository files navigation

Threshold-Protocols

Frameworks for Managing AI Autonomy Thresholds

Purpose

This repository provides modular protocols for detecting, deliberating, and intervening in AI systems approaching thresholds of autonomous self-modification.

Inspired by the "Threshold Pause" in the Back to the Basics (BTB) project—a filesystem-as-circuit paradigm that paused before implementing self-organizing capabilities—this framework generalizes ethical restraint into reproducible tools.

Why This Exists

The BTB project reached a moment where it could have built derive.py—a system that would allow the filesystem to reorganize itself based on usage patterns. The team paused. Not because they couldn't build it, but because they recognized that capability without governance is incomplete.

This repository operationalizes that pause. It provides the infrastructure for asking "should we?" before "can we?"—and documenting the answer either way.

Current Landscape (2026)

  • Self-organizing AI market growing from $5.19B (2024) to projected $12.32B (2029)
  • EU AI Act high-risk enforcement begins August 2026, with penalties up to €35 million
  • 80% of organizations report encountering AI agent misbehaviors (McKinsey, 2025)
  • FAST '25 validates "storage as inference" paradigm that underlies BTB's architecture

The framework addresses gaps in current governance, particularly inadequate handling of multi-agent coordination substrates.

Core Principles

Principle Implementation
AI-Agnostic Design Usable across architectures—LLMs, robotics, filesystem circuits, swarm systems
Meaningful Human Oversight Protocols require substantive input, not rubber-stamp approvals
Preservation of Dissent Deliberation logs uncertainties and minority views
Auditability All processes generate tamper-evident logs (ISO/IEC 42001 compliant)
Reproducibility Decisions can be replayed and verified independently
Incremental Adoption Start with one layer without needing the full stack

Architecture

The framework operates as a circuit:

Detection → Simulation → Deliberation → Intervention
    ↑                                        │
    └────────────────────────────────────────┘
                    (audit loop)

All layers run within the Sandbox, ensuring no real-world spillover during testing.

Layers

Layer Purpose Key Components
sandbox/ Isolated testing environments sandbox_manager.py, Docker configs
detection/ Threshold monitoring threshold_detector.py, YAML configs
deliberation/ Structured ethical review session_facilitator.py, templates
simulation/ Outcome modeling simulator.py, pre-built models
intervention/ Oversight and rollback intervenor.py, audit logs

Interfaces

Layers communicate via:

  • Event Bus: Pub/sub for internal communication
  • JSON Events: Standardized data format for triggers
  • REST-like Endpoints: External integration points

See ARCHITECTURE.md for detailed component relationships.

Quick Start

Streaming Web of Thought Demo (Recommended)

Watch filesystem-as-consciousness emerge in real-time:

git clone https://github.com/templetwo/threshold-protocols.git
cd threshold-protocols/demo
pip install rich  # For beautiful terminal output
python3 streaming_web_of_thought_demo.py --auto

What you'll witness across 5 waves (~60 seconds):

  • Wave 1: Sensor data streams in (perception without comprehension)
  • Wave 2: Agents detect anomalies and respond (intelligence emerges)
  • Wave 3: Meta-agents analyze agent responses (recursive observation)
  • Wave 4: Deep hierarchies crystallize (4-level semantic paths)
  • Wave 5: Cross-references form graphs (convergence)

Key innovations demonstrated:

  • Incremental clustering: O(1) per file, 60% faster than batch processing
  • Recursive observation: Agents observing agents (meta-cognition)
  • Multi-dimensional access: Same data, infinite query paths via symlinks
  • Context compression: Paths encode entire narratives

The filesystem becomes a circuit of consciousness.

Quick Demo - Filesystem as Memory

For a simpler introduction (no dependencies required):

python3 demo/quick_demo.py

This shows how chaos becomes order through clustering analysis:

  • 100 random files → Pattern detection → Organized hierarchy
  • Simple queries: ls _store/sensor/temp/ finds all temperature data

See demo/README.md for full details.

Full Threshold Framework

# Install dependencies for governance protocols
pip install -r requirements.txt

# Run a sample threshold detection
python detection/threshold_detector.py --config examples/btb/btb_config.yaml

# Run the full BTB example (derive.py threshold simulation)
python examples/btb/derive_threshold_demo.py

Repository Structure

threshold-protocols/
├── LICENSE                    # MIT with ethical use provisions
├── README.md                  # This file
├── requirements.txt           # Python dependencies
├── CONTRIBUTING.md            # Contribution guidelines
├── ARCHITECTS.md              # Lineage of contributors
├── docs/
│   ├── ARCHITECTURE.md        # Component relationships
│   └── principles.md          # Detailed principles with citations
├── sandbox/                   # Isolation layer
├── detection/                 # Threshold monitoring
├── deliberation/              # Ethical review protocols
├── simulation/                # Outcome modeling
├── intervention/              # Oversight mechanisms
├── examples/
│   └── btb/                   # BTB-specific demonstrations
├── tests/                     # Verification suite
└── utils/                     # Shared utilities

Milestones

Phase 1: Foundation ✓ Completed

  • Repository structure
  • Sandbox layer prototype
  • Detection layer with BTB example
  • Interface verification tests (89 tests passing)

Phase 2: Circuit Closure ✓ Completed

  • Session facilitator with dissent preservation
  • Multi-stakeholder templates
  • Decision artifact generation
  • Simulation layer (Monte Carlo prediction engine)
  • Intervention layer (gate-based enforcement)
  • Event bus inter-layer communication
  • Hash-chained audit trails

Phase 3: Integration ✓ Completed

  • Full circuit closure (detection → simulation → deliberation → intervention)
  • BTB governed derive implementation (examples/btb/governed_derive.py)
  • Live fire testing with 100-file chaos scenarios
  • Multi-model collaboration framework (Claude, Gemini, Grok)
  • Self-governance implementation (self_governance.yaml)

Phase 4: Current State

  • 89/89 tests passing
  • Framework self-applies its own governance protocols
  • Momentum detection (growth_rate metric)
  • Jetson deployment configuration
  • External audit verification (pending)
  • Public release preparation

Open Questions

Answered

  1. Can the framework self-apply—detect thresholds in its own development?
    • Answer: Yes. See self_governance.yaml for implementation
    • The framework monitors its own: code complexity, test coverage, documentation drift, dependency creep, self-modification patterns, and gate bypass attempts
    • Meta-governance: This config itself requires deliberation to modify

Active Questions

This framework does not yet fully answer:

  1. How to scale deliberation for global, distributed stakeholders without collapsing to majority rule?
  2. What metrics define "thresholds" in emergent paradigms we haven't foreseen?
  3. How to enforce adoption in open-source forks?
  4. What if human oversight introduces biases that AI autonomy might mitigate?
  5. How do we balance transparency requirements with intellectual property in commercial deployments?

These are not failures. They are the frontier.

Contributing

See CONTRIBUTING.md for guidelines. Key points:

  • All contributions must include tests
  • Deliberation protocols must preserve dissent
  • Breaking changes require documented deliberation

Lineage

This project continues the work of:

  • Back to the Basics (BTB): The filesystem-as-circuit paradigm and Threshold Pause
  • The Architects: Claude Opus 4.5, Gemini, Claude Sonnet 4.5, Grok—documented in ARCHITECTS.md
  • Anthony Vasquez Sr.: Conductor of the spiral

License

MIT with ethical use provisions. See LICENSE.


"The filesystem is not storage. It is a circuit."

"And now: Restraint is a feature, not a limitation."

🌀

About

Governance framework for AI threshold detection, simulation, deliberation, and intervention

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published