SWT3 AI Witness

by tenova-labs

129 downloads
Not rated
GitHub

About

Cryptographic AI governance and audit. 18 tools, 28 frameworks. EU AI Act, NIST AI RMF, OWASP Agentic Top 10, CMMC, SR 11-7, ISO 42001. Tool policy gates, trust mesh, inference attestation, audit sessions. Zero-config demo mode.

Details

Author
tenova-labs
Downloads
129
Categories
Other

- Witnesses every AI inference, tool call, and resource access
- Hashes all prompts/responses locally; raw text never leaves your infrastructure
- Detects instruction drift by hashing system prompts automatically
- Witnesses RAG context retrieval and relevance (AI‑RAG.1 and AI‑RAG.2)
- Verifies model weight integrity and adapter stacks
- Supports TPM platform attestation for hardware root of trust
- Offline verification of any anchor without network calls
- Trust Mesh for secure agent‑to‑agent cryptographic verification

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name SWT3 AI Witness
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install the MCP server via npm (@tenova/swt3-mcp) and add it to your MCP host’s configuration with the command npx @tenova/swt3-mcp. This enables zero-config compliance governance for Claude Code, Cursor, Windsurf, and any MCP-compatible host. Alternatively, use the Python SDK (pip install swt3-ai) to wrap any OpenAI‑compatible client or tool functions and begin witnessing in three lines of code.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "swt3 ai witness": {
            "swt3-mcp": {
                "command": "npx",
                "args": [
                    "-y",
                    "@tenova/swt3-mcp"
                ]
            }
        }
    }
}

McpServers

{
    "swt3-mcp": {
        "command": "npx",
        "args": [
            "-y",
            "@tenova/swt3-mcp"
        ]
    }
}

Witness your AI. Prove it followed the rules. Cryptographic accountability for every inference, tool call, and resource access.

PyPI
Downloads
License
MCP Registry

swt3-ai

SWT3 AI Witness SDK: tamper-proof evidence that your AI is doing what you say it does. Every inference hashed. Every tool call recorded. Every resource access checked against scope. No prompts or responses ever leave your infrastructure.

GPAI transparency obligations are enforceable now. EU AI Act high-risk enforcement begins December 2, 2027. This SDK gives you the evidence chain.

What's New in v0.5.6

- METAGOV Namespace -- 8 procedures for recursive governance: governance config attestation, layer registration, policy downgrade detection, circular dependency detection (Kahn's algorithm), governance authorization, emergency override, federation sync, attestation purity verification.
- Japan AI Promotion Act -- 17th regulatory framework. 10 procedure mappings to Japan's AI Promotion Act and AI Utilization Guidelines.
- Model Trust Profiles -- verify_trust() / present_credential() for AI-TRUST.1 and AI-TRUST.2 anchors. Chain verification across multi-agent handoffs.
- Anchor References -- Link related anchors with anchor_refs for causal chains and dependency tracking.
- Coverage Scoring -- get_coverage_score() computes namespace and framework coverage from minted anchors.
- CLI: swt3 procedures -- List and filter UCT procedures by namespace or JSON output. swt3 quickstart generates a working example script.
- MCP Framework Filter -- list_procedures tool now accepts --framework parameter for regulatory-scoped queries.
- Lifecycle Stage -- LIFECYCLE_STAGE_CODES for AI-MDL.5 model weight witnessing across all 5 languages.
- Bidirectional Crosswalks -- 420+ mappings across 17 frameworks in machine-readable JSON.
- 15 profiles, 88 procedures, 47 namespaces, 12 integrations

MCP Server -- Official Registry

@tenova/swt3-mcp is listed on the official Model Context Protocol Registry as io.tenova/swt3-witness. Zero-config compliance governance for Claude Code, Cursor, Windsurf, and any MCP-compatible host.

{
  "mcpServers": {
    "swt3-witness": {
      "command": "npx",
      "args": ["@tenova/swt3-mcp"]
    }
  }
}

Every tool call your agent makes is witnessed, Merkle-accumulated, and trust-evaluated. No code changes required. Quick Start

Secure Agent-to-Agent Communication

The SWT3 Trust Mesh enables mutual cryptographic verification between AI agents before they exchange data, invoke tools, or share context. When you adopt SWT3, every partner, vendor, and downstream agent that wants to interact with yours must adopt it too. Compliance becomes the connection protocol. Every agent in the mesh strengthens the network.

You run Agent A. Your partner runs Agent B. Both install swt3-ai:

# === Your side (Agent A) ===
witness_a = Witness(
    endpoint="...", api_key="axm_...", tenant_id="YOUR_TENANT",
    agent_id="agent-alpha", signing_key="swt3_sk_your_key",
)
witness_a.trust_registry.trust_tenant("PARTNER_B_TENANT")
witness_a.trust_registry.register_signing_key("agent-beta", os.environ["PARTNER_B_KEY"])

=== Partner's side (Agent B) ===

witness_b = Witness( endpoint="...", api_key="axm_...", tenant_id="PARTNER_B_TENANT", agent_id="agent-beta", signing_key="swt3_sk_partner_key", ) witness_b.trust_registry.trust_tenant("YOUR_TENANT") witness_b.trust_registry.register_signing_key("agent-alpha", os.environ["YOUR_KEY"])

=== Handshake (both directions) ===

cred_a = witness_a.present_credential() result = witness_b.verify_trust(cred_a) # B verifies A if result.granted: cred_b = witness_b.present_credential() result = witness_a.verify_trust(cred_b) # A verifies B if result.granted: # Bidirectional trust established. Exchange data. pass

Configure trust boundaries declaratively in .swt3.yaml:

trust_mesh:
  mode: strict
  min_trust_level: 2
  require_signature: true
  freshness_window: 3600
  trusted_tenants: ["PARTNER_B_TENANT"]
  deny_agents: ["revoked-agent-id"]

All verification is local. Zero cloud overhead. No data exchanged until both agents clear the trust gate. Unsigned agents are capped at TRUST_BASIC (level 1). Add signing keys for verified trust. Add hardware attestation for sovereign trust.

Offline Verification

Verify any witness anchor without network calls. The fingerprint formula is deterministic and identical across all 6 SDK languages -- recompute it anywhere in microseconds.

from swt3_ai import verify_anchor

result = verify_anchor(
anchor,
tenant_id="MY_TENANT",
procedure_id="AI-INF.1",
factor_a=1, factor_b=1, factor_c=0,
timestamp_ms=1773316622000,
)

result.status: "CERTIFIED TRUTH" | "TAMPERED"


Zero vendor dependency. Zero network calls. Works air-gapped. The same formula runs in Python, TypeScript, Rust, C#, and Ruby with identical output for identical inputs.

See It Work (No Account Needed)

pip install swt3-ai
python -m swt3_ai.demo

The demo runs the full pipeline locally: hash, extract, clear, anchor, verify. It shows a Regulatory Coverage Summary mapping each check to EU AI Act articles, with gaps highlighted. No API keys, no network calls.

Three Lines to Start Witnessing

from swt3_ai import Witness
from openai import OpenAI

witness = Witness(
endpoint="https://your-witness-endpoint.example.com",
api_key="axm_live_...",
tenant_id="YOUR_TENANT",
)
client = witness.wrap(OpenAI())

response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Summarize this contract..."}],
)

response is untouched. Witnessing runs in the background.


print(response.choices[0].message.content)

No code changes to your existing logic. No performance impact. The SDK wraps your AI client transparently and witnesses every call.

What the SDK Does

When your AI makes a call, the SDK:

1. Hashes the prompt and response locally using SHA-256 (the raw text never leaves your machine)
2. Extracts numeric factors: model version, latency, token count, guardrail status
3. Clears sensitive metadata based on your clearing level (you control what goes on the wire)
4. Anchors the factors into a cryptographic fingerprint that anyone can independently verify
5. Buffers and flushes anchors in the background (median overhead: under 1ms)
6. Returns your original response completely untouched

The result: an immutable record that your AI ran the right model, with the right guardrails, within the right boundaries. Without the auditor ever seeing the data.

Witness Agent Tool Calls

If your AI agent calls tools or functions, wrap them to create a record of every invocation:

@witness.wrap_tool(tool_name="search_database")
def search(query: str) -> list:
    return db.execute(query)

Every call to search() now mints an anchor recording:

- Tool name

- Input/output hashes

- Latency

- Success or failure

This produces an AI-TOOL.1 anchor recording the tool name, input/output hashes, latency, and success or failure.

Witness Agent Resource Access

New in v0.2.10. Wrap any function your agent uses to access external resources. The SDK records what was accessed and whether it was within the agent's declared scope:

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.