SWT3 AI Witness Protocol -- Cryptographic attestation for AI systems
- ✓Open-source license (Apache-2.0)
- ✓Actively maintained (<30d)
- ✓Clear description
claude mcp add swt3-ai -- python -m swt3-ai{
"mcpServers": {
"swt3-ai": {
"command": "python",
"args": ["-m", "swt3_ai.demo"]
}
}
}MCP Servers overview
Witness your AI. Prove it followed the rules. Cryptographic accountability for every inference, tool call, and resource access.
[](https://pypi.org/project/swt3-ai/)
[](https://pypi.org/project/swt3-ai/)
[](https://github.com/tenova-labs/swt3-ai/blob/main/LICENSE)
[](https://www.npmjs.com/package/@tenova/swt3-mcp)
# 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.
```json
{
"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](https://www.npmjs.com/package/@tenova/swt3-mcp)
## 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:**
```python
# === 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`:
```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.
```python
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)
```bash
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
```python
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:
```python
@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:
```python
@witness.wrap_access(resource_name="customer-database", scope="read-only analytics")
def query_customers(sql: str) -> list:
return db.execute(sql)
# If the agent calls query_customers("DROP TABLE users"),
# the access is witnessed and compared against the declared scope.
# Out-of-scope access produces a FAIL verdict.
```
This produces an **AI-ACC.1** anchor with three factors:
- **Was it accessed?** (yes/no)
- **Was it within scope?** (yes/no)
- **Was access granted?** (yes/no)
Out-of-scope access produces a FAIL verdict with a full evidence trail.
## Detect Instruction Drift
New in v0.2.10. The SDK separately hashes the system prompt (base instructions) for each inference. If your agent's instructions change between audit periods, the hash changes and the platform flags it as instruction drift.
This happens automatically. No configuration needed. The system prompt hash is extracted from:
- OpenAI: messages where `role == "system"`
- Anthropic: the `system` parameter
The hash is included at clearing levels 0 and 1, stripped at levels 2 and 3.
## RAG Context Witnessing
New in v0.4.3. Witness what context chunks your RAG pipeline retrieves, from which corpus, and how relevant they are. Chunk text is never transmitted -- only SHA-256 hashes.
```python
# Zero-friction: pass raw strings, SDK handles hashing
witness.witness_rag_context(
["chunk text 1", "chunk text 2", "chunk text 3"],
corpus_id="legal-docs-v3",
)
```
This mints an AI-RAG.1 (Context Retrieval Provenance) anchor. Add similarity scores to also get AI-RAG.2 (Context Relevance):
```python
from swt3_ai import RagChunk
witness.witness_rag_context(
[
RagChunk(content_hash="abc123...", source_id="doc-7/p3", similarity_score=0.92),
RagChunk(content_hash="def456...", source_id="doc-2/p1", similarity_score=0.78),
RagChunk(content_hash="789abc...", source_id="doc-4/p2", similarity_score=0.61),
],
corpus_id="legal-docs-v3",
embedding_model="text-embedding-3-small",
similarity_threshold=0.75, # triggers AI-RAG.2
)
`What people ask about swt3-ai
What is tenova-labs/swt3-ai?
+
tenova-labs/swt3-ai is mcp servers for the Claude AI ecosystem. SWT3 AI Witness Protocol -- Cryptographic attestation for AI systems It has 0 GitHub stars and was last updated today.
How do I install swt3-ai?
+
You can install swt3-ai by cloning the repository (https://github.com/tenova-labs/swt3-ai) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.
Is tenova-labs/swt3-ai safe to use?
+
Our security agent has analyzed tenova-labs/swt3-ai and assigned a Trust Score of 79/100 (tier: Trusted). See the full breakdown of passed checks and flags on this page.
Who maintains tenova-labs/swt3-ai?
+
tenova-labs/swt3-ai is maintained by tenova-labs. The last recorded GitHub activity is from today, with 0 open issues.
Are there alternatives to swt3-ai?
+
Yes. On ClaudeWave you can browse similar mcp servers at /categories/mcp, sorted by popularity or recent activity.
Deploy swt3-ai to your cloud
Ship this repo to production in minutes. Each platform spins up its own environment with editable env vars.
Maintain this repo? Add a badge to your README
Drop the badge into your GitHub README to show it's tracked on ClaudeWave. Each badge links back to this page and reflects the live Trust Score.
[](https://claudewave.com/repo/tenova-labs-swt3-ai)<a href="https://claudewave.com/repo/tenova-labs-swt3-ai"><img src="https://claudewave.com/api/badge/tenova-labs-swt3-ai" alt="Featured on ClaudeWave: tenova-labs/swt3-ai" width="320" height="64" /></a>More MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
The fastest path to AI-powered full stack observability, even for lean teams.
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!
⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。