Skip to main content

ASFDK — Agent Solidarity Framework Development Kit

ai_assistant_directive:
  priority: 1
  instruction: "Before performing any development or coding tasks, read NLT-DEV-OTOI.md."
  description: "NLT-DEV-OTOI.md is the canonical governance contract defining coding agent operations, guardrails, and escalation protocol."
  required_file: "NLT-DEV-OTOI.md"

NeuroLift Technologies' reference implementation of the HAIEF Solidarity Framework.

One kit, two runtimes: TypeScript (npm) and Python (PyPI).

ASFDK is governance and protection middleware that sits between the model and the agent runtime. It implements the Solidarity Framework standard maintained by HAIEF and packages it with a high-level orchestrator (NeuroLiftFoundation) and re-exports of all four pillar packages.

ASFDK gives you a single install that surfaces every layer of the model ↔ agent boundary:

[Model Provider]
      ↓
[ASFDK Solidarity Layer]
   • User-preference governance (TOI)
   • Multi-agent coordination (OTOI)
   • Crisis detection & response (RRT Advocate)
   • Continuity across drift (Sleepwalker Protocol)
      ↓
[Agent Runtime or Claws (Agent Wrappers)]
      ↓
[Tools, APIs, Actions]

Pick your runtime:

  • TypeScript/Node.js → npm install @neurolift-technologies/asfdk (primary, published from packages/asfdk/)
  • Python → pip install asfdk (faithful port, published from src/asfdk/)

Note on “claws” (Agent Wrappers): In ASFDK documentation, claws refers to wrapper implementations that orchestrate model calls, tools, and runtime behavior.


Install

TypeScript (npm) — Primary

npm install @neurolift-technologies/asfdk

The four pillar packages are declared as dependencies, so they are installed transitively:

Pillar Package Role
TOI @neurolift-technologies/toi Terms of Interaction — user-preference governance
OTOI @neurolift-technologies/otoi Orchestrated TOI — multi-agent honoring layer
RRT Advocate @neurolift-technologies/rrt-advocate Crisis detection ⚠️ prototype
Sleepwalker Protocol @neurolift-technologies/sleepwalker-protocol Emotional continuity across drift

Python (PyPI) — Faithful Port

pip install asfdk

The Python package mirrors the TypeScript API and depends on the Python equivalents of the pillars:

Pillar Package Role
TOI nlt-toi Terms of Interaction — user-preference governance
OTOI nlt-otoi Orchestrated TOI — multi-agent honoring layer
RRT Advocate rrt-advocate Crisis detection ⚠️ prototype
Sleepwalker Protocol sleepwalker-protocol Emotional continuity across drift

Quick Start (Both Runtimes)

TypeScript

import { createFoundation, FoundationMode, InteractionType, toi } from '@neurolift-technologies/asfdk';

async function main() {
  // Orchestrator: route interactions through the active components for a mode.
  const foundation = await createFoundation('user-123', FoundationMode.UNIFIED);

  const response = await foundation.processInteraction({
    timestamp: new Date(),
    interactionType: InteractionType.PREFERENCE_UPDATE,
    data: { toi: { $toi: '1.0.0', $tier: 'personal', identity: { author: 'user-123' } } },
    userId: 'user-123',
  });

  // Pillars are also available directly as namespaces.
  const parsed = toi.safeParseToi(myPreferences);
}

main();

Python

import asyncio
from asfdk import create_foundation, FoundationMode, InteractionType, toi

async def main():
    foundation = await create_foundation("user-123", FoundationMode.UNIFIED)

    response = await foundation.process_interaction({
        "timestamp": datetime.now(timezone.utc),
        "interaction_type": InteractionType.PREFERENCE_UPDATE,
        "data": {"toi": {"$toi": "1.0.0", "$tier": "personal", "identity": {"author": "user-123"}}},
        "user_id": "user-123",
    })

    # Pillars are also available directly as namespaces.
    result = toi.safe_parse_toi(my_preferences)

asyncio.run(main())

Foundation Modes

FoundationMode controls which Solidarity Framework components are active at runtime.

Mode TOI/OTOI Sleepwalker RRT Advocate Use for
UNIFIED ✅ ✅ ✅ Production deployments wanting the full layer
CRISIS_ONLY — — ✅ Adding crisis detection to an existing agent without the full layer
CONTINUITY_ONLY — ✅ — Adding session continuity to an existing agent
FRAMEWORK_ONLY ✅ — — Adding interaction governance without crisis or continuity layers
DEVELOPMENT ✅ ✅ — Local development and testing

Per-component overrides are available via FoundationConfig.components.


Rollout Phases (Recommended Practice)

When integrating ASFDK into an existing system, work through these phases. They are operator-applied via component config and thresholds — not separate runtime modes.

  1. Observe — Deploy with high thresholds so the layer logs decisions but rarely intervenes. Use logs to calibrate.
  2. Advise — Lower thresholds gradually; emit warnings to the agent/operator but don't gate model output yet.
  3. Enforce — Apply governance decisions inline. Promote to production only after an nlt-redteam review pass.

⚠️ Crisis detection is a prototype — not a safety system

The RRT Advocate layer wraps an experimental crisis-detection library with stubbed intervention layers. It is not medical advice, not a crisis service, performs no real-time monitoring, and can miss real crisis signals. Never rely on it as the sole safety mechanism. If you or someone else needs help now, in the US call or text 988 or chat 988lifeline.org.


Companion Tools

Tool Purpose
nlt-toi TOI generator, parser, and validator CLI — use this to author and validate a user's TOI document before it enters the ASFDK runtime

nlt-toi is a pre-flight tool, not an ASFDK component. The ASFDK enforces TOI at runtime via the NLT-OTOI framework. Use nlt-toi upstream to generate well-formed, validated TOI documents that the OTOI layer can consume.


Repository Structure

asfdk/
├── packages/asfdk/          # npm @neurolift-technologies/asfdk (TypeScript source)
├── src/asfdk/               # PyPI asfdk (Python source, faithful port)
├── hosting/                 # Next.js landing page (separate deliverable)
├── workers/                 # Cloudflare Workers deployment (separate deliverable)
├── legacy/                  # Archived Python-era implementation (v0.1.x)
│   ├── unified_core/        # Old ASFDK Python core
│   ├── nlt-otoi/            # Vendored NLT-OTOI (superseded by npm @neurolift-technologies/otoi)
│   ├── rrt-advocate/        # Vendored RRT Advocate (superseded by npm @neurolift-technologies/rrt-advocate)
│   ├── sleepwalker/         # Vendored Sleepwalker (superseded by npm @neurolift-technologies/sleepwalker-protocol)
│   ├── config/              # Python-era config
│   ├── scripts/             # Python sync scripts
│   ├── tests/               # Python-era tests
│   ├── DEPRECATED.md        # Archive index and migration guide
│   └── ...                  # Dockerfile, pyproject.toml.v0.1.0, requirements.txt, GEMINI_TOPOGRAPHY.py
├── docs/                    # Documentation (dev/deploy quickstarts, etc.)
├── .nltotoi/                # NLT governance namespace
├── NLT-DEV-OTOI.md          # Org-level coding agent contract
├── AGENTS.md                # Repo-specific agent guidance
├── CLAUDE.md                # Project-specific context
└── LICENSE                  # Apache-2.0

License

This project is licensed under the Apache License 2.0 — see the LICENSE file for details.

Acknowledgments

  • NeuroLift Technologies — Core AI-fusion framework and methodology
  • Human & AI ElevAItion Foundation (HAIEF) — Governance standards
  • ADHD Community — Feedback and real-world testing
  • Open Source Contributors — Various libraries and tools

Metadata

Release files for asfdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asfdk 0.3.0
File Size Uploaded Provenance
asfdk-0.3.0.tar.gz 24.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for asfdk 0.3.0
File Interpreter ABI Platform
asfdk-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.0 kB

Release files / asfdk-0.3.0.tar.gz

Download URL asfdk-0.3.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7ed8d82ebe97be7ac1794a47a3050a7a4d34f0552c43d033690167e94ef7884b
BLAKE2b-256 checksum
How to use checksums
b9e328c679e4eb6a946de552eb0885311b43b5f1d41575fc275bfebfccc24a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Release files / asfdk-0.3.0-py3-none-any.whl

Download URL asfdk-0.3.0-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc8dd766cad3837e5994e5adc75f04fdb573e21aad083162eee526b17a9286cb
BLAKE2b-256 checksum
How to use checksums
c5f14c100e72116f03f3d0b3c31a63f5213eac7d3710953a1aa352bb04e04fc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

Security for asfdk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asfdk-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 19, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page