@tenova/swt3-ai 0.5.0 → 0.5.2
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.
- package/README.md +279 -2
- package/dist/buffer.d.ts +7 -1
- package/dist/buffer.d.ts.map +1 -1
- package/dist/buffer.js +38 -3
- package/dist/buffer.js.map +1 -1
- package/dist/cli.d.ts +13 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +202 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +18 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +346 -42
- package/dist/config.js.map +1 -1
- package/dist/demo.d.ts +1 -1
- package/dist/demo.d.ts.map +1 -1
- package/dist/demo.js +88 -4
- package/dist/demo.js.map +1 -1
- package/dist/doctor.d.ts +20 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +357 -0
- package/dist/doctor.js.map +1 -0
- package/dist/environment.d.ts +34 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +99 -0
- package/dist/environment.js.map +1 -0
- package/dist/exporters/chain-monitor.d.ts +55 -0
- package/dist/exporters/chain-monitor.d.ts.map +1 -0
- package/dist/exporters/chain-monitor.js +172 -0
- package/dist/exporters/chain-monitor.js.map +1 -0
- package/dist/hardware.d.ts +96 -0
- package/dist/hardware.d.ts.map +1 -0
- package/dist/hardware.js +265 -0
- package/dist/hardware.js.map +1 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/merkle.d.ts +107 -0
- package/dist/merkle.d.ts.map +1 -0
- package/dist/merkle.js +226 -0
- package/dist/merkle.js.map +1 -0
- package/dist/schema.d.ts +18 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +255 -0
- package/dist/schema.js.map +1 -0
- package/dist/trust.d.ts +100 -0
- package/dist/trust.d.ts.map +1 -0
- package/dist/trust.js +222 -0
- package/dist/trust.js.map +1 -0
- package/dist/types.d.ts +167 -11
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +42 -1
- package/dist/types.js.map +1 -1
- package/dist/wal.d.ts +69 -0
- package/dist/wal.d.ts.map +1 -0
- package/dist/wal.js +223 -0
- package/dist/wal.js.map +1 -0
- package/dist/witness.d.ts +293 -1
- package/dist/witness.d.ts.map +1 -1
- package/dist/witness.js +1234 -5
- package/dist/witness.js.map +1 -1
- package/package.json +4 -2
- package/templates/eu-ai-act-high-risk.yaml +56 -0
- package/templates/granite-sovereign.yaml +55 -0
- package/templates/minimal.yaml +38 -0
- package/templates/mythos-defense.yaml +65 -0
- package/templates/nist-ai-rmf.yaml +47 -0
- package/templates/owasp-agentic-top10.yaml +50 -0
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@ Witness your AI. Prove it followed the rules. Cryptographic accountability for e
|
|
|
3
3
|
[](https://www.npmjs.com/package/@tenova/swt3-ai)
|
|
4
4
|
[](https://www.npmjs.com/package/@tenova/swt3-ai)
|
|
5
5
|
[](https://github.com/tenova-labs/swt3-ai/blob/main/LICENSE)
|
|
6
|
+
[](https://www.npmjs.com/package/@tenova/swt3-mcp)
|
|
6
7
|
|
|
7
8
|
# @tenova/swt3-ai
|
|
8
9
|
|
|
@@ -12,6 +13,72 @@ Works with OpenAI, Anthropic, AWS Bedrock, Vercel AI SDK, and any OpenAI-compati
|
|
|
12
13
|
|
|
13
14
|
GPAI transparency obligations are enforceable now. EU AI Act high-risk enforcement begins **December 2, 2027**. This SDK gives you the evidence chain.
|
|
14
15
|
|
|
16
|
+
## MCP Server -- Official Registry
|
|
17
|
+
|
|
18
|
+
`@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.
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"mcpServers": {
|
|
23
|
+
"swt3-witness": {
|
|
24
|
+
"command": "npx",
|
|
25
|
+
"args": ["@tenova/swt3-mcp"]
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
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)
|
|
32
|
+
|
|
33
|
+
## Secure Agent-to-Agent Communication
|
|
34
|
+
|
|
35
|
+
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.
|
|
36
|
+
|
|
37
|
+
**You run Agent A. Your partner runs Agent B. Both install @tenova/swt3-ai:**
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
// === Your side (Agent A) ===
|
|
41
|
+
const witnessA = new Witness({
|
|
42
|
+
endpoint: "...", apiKey: "axm_...", tenantId: "YOUR_TENANT",
|
|
43
|
+
agentId: "agent-alpha", signingKey: "swt3_sk_your_key",
|
|
44
|
+
});
|
|
45
|
+
witnessA.trustRegistry.trustTenant("PARTNER_B_TENANT");
|
|
46
|
+
witnessA.trustRegistry.registerSigningKey("agent-beta", process.env.PARTNER_B_KEY!);
|
|
47
|
+
|
|
48
|
+
// === Partner's side (Agent B) ===
|
|
49
|
+
const witnessB = new Witness({
|
|
50
|
+
endpoint: "...", apiKey: "axm_...", tenantId: "PARTNER_B_TENANT",
|
|
51
|
+
agentId: "agent-beta", signingKey: "swt3_sk_partner_key",
|
|
52
|
+
});
|
|
53
|
+
witnessB.trustRegistry.trustTenant("YOUR_TENANT");
|
|
54
|
+
witnessB.trustRegistry.registerSigningKey("agent-alpha", process.env.YOUR_KEY!);
|
|
55
|
+
|
|
56
|
+
// === Handshake (both directions) ===
|
|
57
|
+
const credA = witnessA.presentCredential();
|
|
58
|
+
const resultB = witnessB.verifyTrust(credA); // B verifies A
|
|
59
|
+
if (resultB.granted) {
|
|
60
|
+
const credB = witnessB.presentCredential();
|
|
61
|
+
const resultA = witnessA.verifyTrust(credB); // A verifies B
|
|
62
|
+
if (resultA.granted) {
|
|
63
|
+
// Bidirectional trust established. Exchange data.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Configure trust boundaries declaratively in `.swt3.yaml`:
|
|
69
|
+
|
|
70
|
+
```yaml
|
|
71
|
+
trust_mesh:
|
|
72
|
+
mode: strict
|
|
73
|
+
min_trust_level: 2
|
|
74
|
+
require_signature: true
|
|
75
|
+
freshness_window: 3600
|
|
76
|
+
trusted_tenants: ["PARTNER_B_TENANT"]
|
|
77
|
+
deny_agents: ["revoked-agent-id"]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
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.
|
|
81
|
+
|
|
15
82
|
## See It Work (No Account Needed)
|
|
16
83
|
|
|
17
84
|
```bash
|
|
@@ -216,6 +283,55 @@ witness.witnessQuantization("gptq", { bits: 4, groupSize: 128 });
|
|
|
216
283
|
|
|
217
284
|
Maps to: EU AI Act Art. 15(4) (resilience against modification), Art. 12(2)(b) (version logging).
|
|
218
285
|
|
|
286
|
+
## TPM Platform Attestation (AI-HW.3)
|
|
287
|
+
|
|
288
|
+
Prove host firmware integrity via TPM 2.0. Reads PCR registers 0-7 and mints a hardware root-of-trust anchor. All raw values are SHA-256 hashed before leaving the module:
|
|
289
|
+
|
|
290
|
+
```typescript
|
|
291
|
+
// Auto-detect: reads /dev/tpm0 via tpm2-tools
|
|
292
|
+
witness.witnessTPMAttestation();
|
|
293
|
+
|
|
294
|
+
// Or provide a pre-computed snapshot
|
|
295
|
+
import { queryTPM } from "@tenova/swt3-ai";
|
|
296
|
+
const snapshot = queryTPM();
|
|
297
|
+
witness.witnessTPMAttestation({ snapshot });
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
If no TPM is available (cloud VM, dev machine), returns a valid anchor with factor_a=0. No crash, no error. Graceful degradation by design.
|
|
301
|
+
|
|
302
|
+
Use case: sovereign/air-gapped deployments where you must prove the host was not tampered with. Combined with AI-HW.1 (GPU inventory), gives full hardware root-of-trust from silicon to model.
|
|
303
|
+
|
|
304
|
+
Maps to: NIST 800-53 SC-12 (cryptographic key establishment). Patent pending.
|
|
305
|
+
|
|
306
|
+
## Environmental Attestation (Residential and Edge AI)
|
|
307
|
+
|
|
308
|
+
Witness the physical compute environment for distributed, edge-deployed, or residential AI nodes. Proves the hardware operated within safe thermal and power bounds during inference:
|
|
309
|
+
|
|
310
|
+
```typescript
|
|
311
|
+
// Zero-config: auto-detects Linux thermal sensors
|
|
312
|
+
witness.witnessEnvironment();
|
|
313
|
+
|
|
314
|
+
// Manual readings from smart panel APIs or IPMI
|
|
315
|
+
witness.witnessEnvironment({
|
|
316
|
+
temperatureCelsius: 42,
|
|
317
|
+
thresholdCelsius: 75,
|
|
318
|
+
nodeType: "residential",
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// Power integrity: draw vs capacity
|
|
322
|
+
witness.witnessEnergyDraw({
|
|
323
|
+
powerWatts: 1200,
|
|
324
|
+
capacityWatts: 2400,
|
|
325
|
+
nodeType: "edge",
|
|
326
|
+
});
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
If no sensors are available (dev machine, cloud VM), returns a valid anchor with zero readings. No crash, no error.
|
|
330
|
+
|
|
331
|
+
Use case: enterprises renting compute on distributed residential nodes need cryptographic proof that the node was operating within safe bounds, was not throttled, and was not physically tampered with during their inference window.
|
|
332
|
+
|
|
333
|
+
Maps to: NIST 800-53 PE-14 (environmental controls), EU AI Act Annex I (product safety for home-integrated AI).
|
|
334
|
+
|
|
219
335
|
## Skill Manifest Attestation
|
|
220
336
|
|
|
221
337
|
Witness which skills, tools, and plugins are loaded in your agent:
|
|
@@ -291,6 +407,146 @@ The `agentId` survives all clearing levels. The `signingKey` produces an HMAC-SH
|
|
|
291
407
|
|
|
292
408
|
Receipts include `signature_verified: true` when the server confirms the signature.
|
|
293
409
|
|
|
410
|
+
## Trust Mesh (Mutual Agent Verification)
|
|
411
|
+
|
|
412
|
+
Before two agents exchange data or invoke each other's tools, each verifies the other's compliance posture. No anchor, no handshake.
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
// Agent A: present a signed credential
|
|
416
|
+
const credentialA = witnessA.presentCredential();
|
|
417
|
+
// Send credentialA to Agent B over your transport layer
|
|
418
|
+
|
|
419
|
+
// Agent B: verify Agent A's credential
|
|
420
|
+
witnessB.trustRegistry.trustTenant("TENANT_A");
|
|
421
|
+
witnessB.trustRegistry.registerSigningKey("agent-alpha", "shared-secret-a");
|
|
422
|
+
const result = witnessB.verifyTrust(credentialA);
|
|
423
|
+
|
|
424
|
+
if (result.granted) {
|
|
425
|
+
// Trust level: 1=basic, 2=verified, 3=attested, 4=sovereign
|
|
426
|
+
console.log(`Trusted at level ${result.trustLevel}`);
|
|
427
|
+
} else {
|
|
428
|
+
console.log(`Denied: ${result.denialReason}`);
|
|
429
|
+
}
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
**Trust levels:**
|
|
433
|
+
|
|
434
|
+
| Level | Name | Requires |
|
|
435
|
+
|-------|------|----------|
|
|
436
|
+
| 1 | Basic | Valid credential, unsigned or unverifiable |
|
|
437
|
+
| 2 | Verified | Valid credential + verified HMAC signature |
|
|
438
|
+
| 3 | Attested | Verified + hardware attestation + guardrails |
|
|
439
|
+
| 4 | Sovereign | Attested + clearing level >= 2 |
|
|
440
|
+
|
|
441
|
+
Unsigned credentials are automatically capped at TRUST_BASIC. You cannot claim a higher trust level without a verified signature.
|
|
442
|
+
|
|
443
|
+
**Key exchange:** Exchange signing keys out-of-band (environment variables, secrets manager, KMS). Never send keys over the wire alongside credentials. Each agent registers the counterpart's key:
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
// Agent A registers B's key, B registers A's key
|
|
447
|
+
witnessA.trustRegistry.registerSigningKey("agent-beta", process.env.AGENT_B_KEY!);
|
|
448
|
+
witnessB.trustRegistry.registerSigningKey("agent-alpha", process.env.AGENT_A_KEY!);
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
**Zero-friction path:** Trust mesh works without signing keys. Agents without keys get TRUST_BASIC (level 1), which is sufficient for non-sensitive coordination. Add keys when you need verified or attested trust.
|
|
452
|
+
|
|
453
|
+
**Credential auto-population:** `presentCredential()` automatically includes which procedures the agent has witnessed and whether hardware attestation (AI-HW.1 or AI-HW.3) has been performed. No manual tracking needed.
|
|
454
|
+
|
|
455
|
+
Every verification (pass or fail) mints AI-TRUST.1 + AI-TRUST.2 anchors. Denials produce evidence too.
|
|
456
|
+
|
|
457
|
+
Maps to: EU AI Act Art. 14 (human oversight and mutual accountability between AI systems).
|
|
458
|
+
|
|
459
|
+
## Policy-as-Code (swt3.yaml)
|
|
460
|
+
|
|
461
|
+
New in v0.5.2. Define your entire witnessing policy in a YAML file instead of passing 25+ constructor parameters:
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
npx swt3 init # interactive profile picker
|
|
465
|
+
npx swt3 init --profile eu-ai-act-high-risk --tenant ACME
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
This generates a `swt3.yaml` file. Then load it:
|
|
469
|
+
|
|
470
|
+
```typescript
|
|
471
|
+
const witness = Witness.fromConfig(); // auto-finds swt3.yaml
|
|
472
|
+
const witness = Witness.fromConfig("prod.yaml"); // explicit path
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### File Composition (extends)
|
|
476
|
+
|
|
477
|
+
Layer configs for environment-specific overrides:
|
|
478
|
+
|
|
479
|
+
```yaml
|
|
480
|
+
# prod.yaml
|
|
481
|
+
extends: base.yaml
|
|
482
|
+
clearing_level: 2
|
|
483
|
+
signing_key_env: SWT3_SIGNING_KEY
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
Supports single files or chains (`extends: [base.yaml, team.yaml]`). Merge order: extends < profile < explicit config. Cycle detection and depth limit (10) built in.
|
|
487
|
+
|
|
488
|
+
### Built-in Profiles
|
|
489
|
+
|
|
490
|
+
Three profiles ship with the SDK:
|
|
491
|
+
|
|
492
|
+
| Profile | Use Case |
|
|
493
|
+
|---------|----------|
|
|
494
|
+
| `eu-ai-act-high-risk` | EU AI Act high-risk: clearing 2, signing required, jurisdiction required |
|
|
495
|
+
| `nist-ai-rmf` | NIST AI RMF: full procedure coverage, moderate policy |
|
|
496
|
+
| `minimal` | Development: clearing 0, no policy enforcement |
|
|
497
|
+
|
|
498
|
+
### Diagnostics
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
npx swt3 doctor # 8 checks: YAML, env vars, profile, extends, sections
|
|
502
|
+
npx swt3 doctor --json # machine-readable for CI/CD
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### Schema Validation
|
|
506
|
+
|
|
507
|
+
Validate config files programmatically:
|
|
508
|
+
|
|
509
|
+
```typescript
|
|
510
|
+
import { validateSchema } from "@tenova/swt3-ai";
|
|
511
|
+
|
|
512
|
+
const result = validateSchema(parsedYaml);
|
|
513
|
+
if (!result.valid) {
|
|
514
|
+
console.error(result.errors);
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
## Merkle Accumulator (Session-Level Integrity)
|
|
519
|
+
|
|
520
|
+
New in v0.5.2. Compute Merkle roots over batches of anchors for tamper-evident session integrity:
|
|
521
|
+
|
|
522
|
+
```typescript
|
|
523
|
+
import { MerkleAccumulator, verifyMerkleProof } from "@tenova/swt3-ai";
|
|
524
|
+
|
|
525
|
+
const acc = new MerkleAccumulator({ tenantId: "ACME" });
|
|
526
|
+
|
|
527
|
+
// Accumulate fingerprints as anchors are minted
|
|
528
|
+
acc.add("abc123def456");
|
|
529
|
+
acc.add("789012345678");
|
|
530
|
+
|
|
531
|
+
// Compute session root (persisted to JSONL automatically)
|
|
532
|
+
const session = acc.flush();
|
|
533
|
+
console.log(session.root); // 64-char hex Merkle root
|
|
534
|
+
|
|
535
|
+
// Generate an inclusion proof for any fingerprint
|
|
536
|
+
const proof = acc.prove("abc123def456");
|
|
537
|
+
console.log(verifyMerkleProof("abc123def456", proof)); // true
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
Enable via config:
|
|
541
|
+
|
|
542
|
+
```yaml
|
|
543
|
+
merkle:
|
|
544
|
+
enabled: true
|
|
545
|
+
accumulator_interval: 0 # 0 = compute on every flush
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
Cross-language parity with Python SDK. Domain-separated (SWT3:LEAF: / SWT3:NODE:) to prevent second-preimage attacks.
|
|
549
|
+
|
|
294
550
|
## Gatekeeper Mode (Pre-Call Enforcement)
|
|
295
551
|
|
|
296
552
|
New in v0.3.4. Require guardrails to be active *before* the model is called, not just observed after:
|
|
@@ -378,7 +634,7 @@ Each inference produces anchors for these checks. Every check maps to a regulati
|
|
|
378
634
|
|
|
379
635
|
### EU AI Act Article Mapping
|
|
380
636
|
|
|
381
|
-
All
|
|
637
|
+
All 43 SWT3 AI witnessing procedures map to specific EU AI Act obligations:
|
|
382
638
|
|
|
383
639
|
| Procedure | EU AI Act Article | Obligation | Demo | Production |
|
|
384
640
|
|-----------|-------------------|------------|------|------------|
|
|
@@ -395,7 +651,7 @@ All 42 SWT3 AI witnessing procedures map to specific EU AI Act obligations:
|
|
|
395
651
|
| AI-EXPL.1 | Art. 13(1) | Transparency & Explainability | -| ✓ |
|
|
396
652
|
| AI-EXPL.2 | Art. 13(3b) | Confidence Calibration | -| ✓ |
|
|
397
653
|
|
|
398
|
-
The demo demonstrates 5 procedures using simulated data. All
|
|
654
|
+
The demo demonstrates 5 procedures using simulated data. All 43 are available in production with real inference data. 38 cross-language test vectors ensure fingerprint parity across Python, TypeScript, Rust, C#, and Ruby. [See live conformity →](https://sovereign.tenova.io/audit/axm_audit_demo_eu_ai_act_public)
|
|
399
655
|
|
|
400
656
|
## How Verdicts Work
|
|
401
657
|
|
|
@@ -640,6 +896,24 @@ Your prompts and responses **never leave your infrastructure**. The SDK computes
|
|
|
640
896
|
|
|
641
897
|
---
|
|
642
898
|
|
|
899
|
+
## Upgrading to v0.5.2
|
|
900
|
+
|
|
901
|
+
**Policy-as-Code (new):** `swt3 init`, `swt3 doctor`, `extends:` composition, profile templates, YAML schema validator. No breaking changes.
|
|
902
|
+
|
|
903
|
+
**Merkle Accumulator (new):** `MerkleAccumulator` class for session-level integrity proofs. `merkle:` config section. No breaking changes.
|
|
904
|
+
|
|
905
|
+
**Trust Mesh (v0.5.0):** `presentCredential()` and `verifyTrust()`. No breaking changes for existing code.
|
|
906
|
+
|
|
907
|
+
**Credential signing (behavioral change):** If your Witness has a `signingKey`, credentials are now HMAC-signed automatically. Counterpart agents must register your key via `trustRegistry.registerSigningKey()` to verify the signature. Without key registration, signed credentials are denied with `signature_unverifiable`.
|
|
908
|
+
|
|
909
|
+
**TPM attestation (v0.5.2):** `witnessTPMAttestation()` for AI-HW.3. Reads PCR registers via tpm2-tools. Graceful degradation without TPM. No breaking changes.
|
|
910
|
+
|
|
911
|
+
**Environmental attestation (v0.5.0):** `witnessEnvironment()` and `witnessEnergyDraw()` for AI-ENV.1/AI-ENV.2. No breaking changes.
|
|
912
|
+
|
|
913
|
+
**MCP server:** 16 procedure keyword suggestions (was 8). MCP policy section in swt3.yaml. No breaking changes.
|
|
914
|
+
|
|
915
|
+
---
|
|
916
|
+
|
|
643
917
|
## Documentation
|
|
644
918
|
|
|
645
919
|
- [SDK Reference](https://sovereign.tenova.io/docs/) -- full API, all providers, clearing levels, configuration
|
|
@@ -649,6 +923,9 @@ Your prompts and responses **never leave your infrastructure**. The SDK computes
|
|
|
649
923
|
- [UCT Registry](https://sovereign.tenova.io/registry) -- 162 procedures, full factor definitions
|
|
650
924
|
- [Anchor Verifier](https://sovereign.tenova.io/verify) -- verify any anchor, zero server calls
|
|
651
925
|
- [EU AI Act Regulatory Architecture](https://sovereign.tenova.io/guides/futurium-submission.html) -- VI+CJT+ALF+LAVR framework mapping for conformity assessment bodies
|
|
926
|
+
- [Five Eyes Agentic AI Overlay](https://sovereign.tenova.io/guides/five-eyes-overlay.html) -- CISA/NSA guidance mapped to SWT3 procedures
|
|
927
|
+
- [CMMC Compliance Overlay](https://sovereign.tenova.io/guides/cmmc-overlay.html) -- clearing levels mapped to CMMC and NIST 800-171
|
|
928
|
+
- [SR 11-7 Model Risk Overlay](https://sovereign.tenova.io/guides/sr-11-7-overlay.html) -- clearing levels mapped to SR 11-7 requirements
|
|
652
929
|
|
|
653
930
|
---
|
|
654
931
|
|
package/dist/buffer.d.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* prevents unbounded memory growth.
|
|
11
11
|
*/
|
|
12
12
|
import type { WitnessConfig, WitnessPayload, WitnessReceipt } from "./types.js";
|
|
13
|
+
import type { WriteAheadLog } from "./wal.js";
|
|
13
14
|
export declare class WitnessBuffer {
|
|
14
15
|
private config;
|
|
15
16
|
private queue;
|
|
@@ -20,8 +21,13 @@ export declare class WitnessBuffer {
|
|
|
20
21
|
private stopped;
|
|
21
22
|
private consecutiveFailures;
|
|
22
23
|
private ctaShown;
|
|
24
|
+
private tokenAccumulator;
|
|
23
25
|
private onFlush?;
|
|
24
|
-
|
|
26
|
+
private wal;
|
|
27
|
+
private walSeqMap;
|
|
28
|
+
constructor(config: WitnessConfig, maxRetryBuffer?: number, wal?: WriteAheadLog);
|
|
29
|
+
/** Cumulative tokens accumulated since last flush (for token_budget monitoring). */
|
|
30
|
+
get tokensSinceFlush(): number;
|
|
25
31
|
/** Add a single payload to the buffer. */
|
|
26
32
|
enqueue(payload: WitnessPayload): void;
|
|
27
33
|
/** Add multiple payloads. */
|
package/dist/buffer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../src/buffer.ts"],"names":[],"mappings":"AAA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AAoD;IACpD,IAAI,eAAe,IAAI,MAAM,CAE5B;IAED,2CAA2C;IAC3C,IAAI,QAAQ,IAAI,cAAc,EAAE,CAE/B;IAED,OAAO,CAAC,UAAU;YAYJ,aAAa;YAYb,SAAS;CA8GxB"}
|
package/dist/buffer.js
CHANGED
|
@@ -20,19 +20,41 @@ export class WitnessBuffer {
|
|
|
20
20
|
stopped = false;
|
|
21
21
|
consecutiveFailures = 0;
|
|
22
22
|
ctaShown = false;
|
|
23
|
+
tokenAccumulator = 0;
|
|
23
24
|
onFlush;
|
|
24
|
-
|
|
25
|
+
wal = null;
|
|
26
|
+
walSeqMap = new Map();
|
|
27
|
+
constructor(config, maxRetryBuffer = DEFAULT_MAX_RETRY_BUFFER, wal) {
|
|
25
28
|
this.config = config;
|
|
26
29
|
this.maxRetryBuffer = maxRetryBuffer;
|
|
27
30
|
this.onFlush = config.onFlush;
|
|
31
|
+
this.wal = wal ?? null;
|
|
28
32
|
this.startTimer();
|
|
29
33
|
}
|
|
34
|
+
/** Cumulative tokens accumulated since last flush (for token_budget monitoring). */
|
|
35
|
+
get tokensSinceFlush() {
|
|
36
|
+
return this.tokenAccumulator;
|
|
37
|
+
}
|
|
30
38
|
/** Add a single payload to the buffer. */
|
|
31
39
|
enqueue(payload) {
|
|
32
40
|
if (this.stopped)
|
|
33
41
|
return;
|
|
42
|
+
// WAL: replay protection (reject duplicates) + persist to disk
|
|
43
|
+
if (this.wal) {
|
|
44
|
+
const seq = this.wal.append(payload);
|
|
45
|
+
if (seq === -1) {
|
|
46
|
+
// Duplicate fingerprint -- silently skip
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.walSeqMap.set(payload, seq);
|
|
50
|
+
}
|
|
51
|
+
// Track token accumulation for tokenBudget flush trigger
|
|
52
|
+
const tokens = (payload.ai_input_tokens ?? 0) + (payload.ai_output_tokens ?? 0);
|
|
53
|
+
if (tokens > 0)
|
|
54
|
+
this.tokenAccumulator += tokens;
|
|
34
55
|
this.queue.push(payload);
|
|
35
|
-
|
|
56
|
+
const tokenBudgetHit = this.config.tokenBudget != null && this.tokenAccumulator >= this.config.tokenBudget;
|
|
57
|
+
if (this.queue.length >= this.config.bufferSize || tokenBudgetHit) {
|
|
36
58
|
this.flushInternal();
|
|
37
59
|
}
|
|
38
60
|
}
|
|
@@ -89,6 +111,7 @@ export class WitnessBuffer {
|
|
|
89
111
|
const payloads = [...this.deadLetter, ...this.queue];
|
|
90
112
|
this.deadLetter = [];
|
|
91
113
|
this.queue = [];
|
|
114
|
+
this.tokenAccumulator = 0;
|
|
92
115
|
if (payloads.length === 0)
|
|
93
116
|
return [];
|
|
94
117
|
return this.sendBatch(payloads);
|
|
@@ -118,7 +141,7 @@ export class WitnessBuffer {
|
|
|
118
141
|
// Client error — don't retry, don't dead-letter
|
|
119
142
|
const text = await resp.text();
|
|
120
143
|
// Scrub any key material that might appear in error response body
|
|
121
|
-
const safe = text.replace(/(?:Bearer|Authorization|api[_-]?key|signing[_-]?key)[^\s,;"]
|
|
144
|
+
const safe = text.replace(/(?:Bearer|Authorization|api[_-]?key|signing[_-]?key)\s*[^\s,;"]{4,}/gi, "[REDACTED]");
|
|
122
145
|
console.error(`[swt3-ai] Batch flush failed (${resp.status}): ${safe.slice(0, 200)}`);
|
|
123
146
|
return [];
|
|
124
147
|
}
|
|
@@ -126,6 +149,18 @@ export class WitnessBuffer {
|
|
|
126
149
|
const receipts = result.receipts ?? [];
|
|
127
150
|
this.allReceipts.push(...receipts);
|
|
128
151
|
this.consecutiveFailures = 0;
|
|
152
|
+
// WAL: mark flushed entries
|
|
153
|
+
if (this.wal) {
|
|
154
|
+
let maxSeq = 0;
|
|
155
|
+
for (const p of payloads) {
|
|
156
|
+
const s = this.walSeqMap.get(p);
|
|
157
|
+
if (s !== undefined && s > maxSeq)
|
|
158
|
+
maxSeq = s;
|
|
159
|
+
this.walSeqMap.delete(p);
|
|
160
|
+
}
|
|
161
|
+
if (maxSeq > 0)
|
|
162
|
+
this.wal.markFlushed(maxSeq);
|
|
163
|
+
}
|
|
129
164
|
if (result.rejected > 0) {
|
|
130
165
|
console.warn(`[swt3-ai] Batch flush: ${result.accepted} accepted, ${result.rejected} rejected`);
|
|
131
166
|
}
|
package/dist/buffer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../src/buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../src/buffer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAEtC,MAAM,OAAO,aAAa;IAChB,MAAM,CAAgB;IACtB,KAAK,GAAqB,EAAE,CAAC;IAC7B,UAAU,GAAqB,EAAE,CAAC;IAClC,cAAc,CAAS;IACvB,WAAW,GAAqB,EAAE,CAAC;IACnC,KAAK,GAAyC,IAAI,CAAC;IACnD,OAAO,GAAG,KAAK,CAAC;IAChB,mBAAmB,GAAG,CAAC,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC;IACjB,gBAAgB,GAAG,CAAC,CAAC;IACrB,OAAO,CAAoE;IAC3E,GAAG,GAAyB,IAAI,CAAC;IACjC,SAAS,GAAgC,IAAI,GAAG,EAAE,CAAC;IAE3D,YAAY,MAAqB,EAAE,cAAc,GAAG,wBAAwB,EAAE,GAAmB;QAC/F,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC;QACvB,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,oFAAoF;IACpF,IAAI,gBAAgB;QAClB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,0CAA0C;IAC1C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,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;oBACzC,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;QACH,CAAC;QAED,oDAAoD;QACpD,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QACtC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC;QAElC,4BAA4B;QAC5B,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;YACjD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC;YAC7D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjD,OAAO,CAAC,KAAK,CACX,qCAAqC,OAAO,kCAAkC,IAAI,CAAC,cAAc,GAAG,CACrG,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CACV,oCAAoC,QAAQ,CAAC,MAAM,0CAA0C,IAAI,CAAC,UAAU,CAAC,MAAM,aAAa,SAAS,EAAE,CAC5I,CAAC;QACJ,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF"}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* SWT3 CLI -- governance tooling for AI systems.
|
|
4
|
+
*
|
|
5
|
+
* Commands:
|
|
6
|
+
* swt3 init Interactive governance setup
|
|
7
|
+
* swt3 init --profile X Non-interactive (CI/CD friendly)
|
|
8
|
+
* swt3 demo Run the zero-friction demo
|
|
9
|
+
* swt3 doctor Diagnose config health
|
|
10
|
+
* swt3 help Show usage
|
|
11
|
+
*/
|
|
12
|
+
export declare function generateInitYaml(profile: string, tenantId: string, agentId: string): string;
|
|
13
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AA4CH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAoB3F"}
|