@tenova/swt3-ai 0.5.2 → 0.5.4
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/LICENSE +191 -0
- package/README.md +113 -7
- package/dist/adapters/cerebras.d.ts +25 -0
- package/dist/adapters/cerebras.d.ts.map +1 -0
- package/dist/adapters/cerebras.js +79 -0
- package/dist/adapters/cerebras.js.map +1 -0
- package/dist/clearing.d.ts +15 -3
- package/dist/clearing.d.ts.map +1 -1
- package/dist/clearing.js +42 -10
- package/dist/clearing.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +54 -2
- package/dist/config.js.map +1 -1
- package/dist/demo.d.ts.map +1 -1
- package/dist/demo.js +6 -2
- package/dist/demo.js.map +1 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +20 -0
- package/dist/doctor.js.map +1 -1
- package/dist/exporters/evidence.d.ts +59 -0
- package/dist/exporters/evidence.d.ts.map +1 -0
- package/dist/exporters/evidence.js +148 -0
- package/dist/exporters/evidence.js.map +1 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/merkle.d.ts +15 -0
- package/dist/merkle.d.ts.map +1 -1
- package/dist/merkle.js +24 -0
- package/dist/merkle.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +60 -4
- package/dist/schema.js.map +1 -1
- package/dist/sentinel-client.d.ts +90 -0
- package/dist/sentinel-client.d.ts.map +1 -0
- package/dist/sentinel-client.js +179 -0
- package/dist/sentinel-client.js.map +1 -0
- package/dist/signing.d.ts +31 -6
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +105 -12
- package/dist/signing.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -0
- package/dist/types.js.map +1 -1
- package/dist/wal.d.ts +1 -1
- package/dist/wal.js +1 -1
- package/dist/witness.d.ts +117 -0
- package/dist/witness.d.ts.map +1 -1
- package/dist/witness.js +334 -9
- package/dist/witness.js.map +1 -1
- package/package.json +5 -6
- package/templates/autonomous-systems.yaml +70 -0
- package/templates/content-platform.yaml +68 -0
- package/templates/cost-conscious.yaml +35 -0
- package/templates/defense-govcon.yaml +77 -0
- package/templates/fintech-model-risk.yaml +69 -0
- package/templates/github-action.yml +44 -0
- package/templates/healthcare-clinical.yaml +67 -0
- package/templates/insurance-underwriting.yaml +68 -0
- package/templates/telecom-compliance.yaml +72 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# SWT3 Profile: Fintech Model Risk (SR 11-7 + GDPR + Basel III/IV)
|
|
2
|
+
# AI governance for credit decisioning, fraud scoring, AML detection,
|
|
3
|
+
# trading algorithms, and customer risk classification models.
|
|
4
|
+
#
|
|
5
|
+
# Covers Federal Reserve SR 11-7 (model risk management), OCC 2011-12,
|
|
6
|
+
# GDPR Art. 22 (automated decisions), Basel III/IV operational risk,
|
|
7
|
+
# ECOA/Reg B (fair lending), and FCRA (adverse action notices).
|
|
8
|
+
#
|
|
9
|
+
# Financial AI models directly affect credit access, fraud flags, and
|
|
10
|
+
# regulatory reporting. Explainability for adverse actions and bias
|
|
11
|
+
# monitoring for protected classes are regulatory requirements.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# profile: fintech-model-risk
|
|
15
|
+
# api_key_env: SWT3_API_KEY
|
|
16
|
+
# tenant_id: YOUR_TENANT
|
|
17
|
+
# agent_id: credit-scoring-v4
|
|
18
|
+
|
|
19
|
+
clearing_level: 2 # Sensitive (financial PII)
|
|
20
|
+
|
|
21
|
+
policy:
|
|
22
|
+
require_agent_id: true
|
|
23
|
+
require_signing: true
|
|
24
|
+
min_clearing_level: 2
|
|
25
|
+
require_jurisdiction: true # Multi-jurisdiction financial regulation
|
|
26
|
+
required_procedures:
|
|
27
|
+
# Inference provenance
|
|
28
|
+
- AI-INF.1 # Prompt/response hash capture
|
|
29
|
+
- AI-INF.2 # Latency monitoring (SLA compliance)
|
|
30
|
+
# Model lifecycle
|
|
31
|
+
- AI-MDL.1 # Model validation (SR 11-7 requirement)
|
|
32
|
+
# Fairness (lending, credit, insurance bias)
|
|
33
|
+
- AI-FAIR.1 # Bias disparity measurement (ECOA/Reg B)
|
|
34
|
+
- AI-FAIR.3 # Bias audit witnessing
|
|
35
|
+
# Explainability (adverse action notices -- FCRA/ECOA)
|
|
36
|
+
- AI-EXPL.1 # Explanation generation
|
|
37
|
+
- AI-EXPL.2 # Confidence scoring
|
|
38
|
+
# Automated decisions (credit, fraud, AML)
|
|
39
|
+
- AI-AUTO.1 # Automated decision notification (GDPR Art. 22)
|
|
40
|
+
# Human oversight
|
|
41
|
+
- AI-HITL.1 # Human review of denials/flags
|
|
42
|
+
- AI-HITL.2 # Human override event tracking
|
|
43
|
+
# Data governance
|
|
44
|
+
- AI-CONSENT.1 # Data subject consent
|
|
45
|
+
- AI-DPIA.1 # Data protection impact assessment
|
|
46
|
+
- AI-TRANS.1 # Transparency disclosure
|
|
47
|
+
# Continuous monitoring (SR 11-7 ongoing validation)
|
|
48
|
+
- AI-DRIFT.1 # Model decay detection
|
|
49
|
+
- AI-PERF.1 # Model performance metrics
|
|
50
|
+
- AI-AUDIT.1 # Audit log integrity
|
|
51
|
+
|
|
52
|
+
trust_mesh:
|
|
53
|
+
mode: strict
|
|
54
|
+
min_trust_level: 3
|
|
55
|
+
require_signature: true
|
|
56
|
+
freshness_window: 3600 # 1 hour
|
|
57
|
+
|
|
58
|
+
density_policy:
|
|
59
|
+
min_anchors_per_1000_tokens: 3
|
|
60
|
+
max_chain_gap_seconds: 120
|
|
61
|
+
require_signing_key: true
|
|
62
|
+
|
|
63
|
+
mcp_policy:
|
|
64
|
+
witnessed_tools: ["*"]
|
|
65
|
+
auto_witness: true
|
|
66
|
+
block_on_failure: true
|
|
67
|
+
max_velocity: "20/60s"
|
|
68
|
+
max_chain_depth: 8
|
|
69
|
+
fail_secure: true
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# SWT3 AI Witness -- Config Validation for CI/CD
|
|
2
|
+
# Ensures your governance config (swt3.yaml) is valid before deploy.
|
|
3
|
+
#
|
|
4
|
+
# Setup:
|
|
5
|
+
# 1. Run: npx swt3 init --profile <profile> --tenant <your-tenant>
|
|
6
|
+
# 2. Commit swt3.yaml to your repo
|
|
7
|
+
# 3. Copy this file to .github/workflows/swt3-ci.yml
|
|
8
|
+
# 4. (Optional) Add SWT3_API_KEY to repository secrets for cloud mode
|
|
9
|
+
#
|
|
10
|
+
# This validates config structure, not runtime behavior.
|
|
11
|
+
# Runtime witnessing happens in your application code via the SDK.
|
|
12
|
+
|
|
13
|
+
name: SWT3 Config Validation
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
branches: [main]
|
|
18
|
+
paths: [swt3.yaml, .swt3.yaml]
|
|
19
|
+
pull_request:
|
|
20
|
+
branches: [main]
|
|
21
|
+
paths: [swt3.yaml, .swt3.yaml]
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
swt3-validate:
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
|
|
29
|
+
- uses: actions/setup-node@v4
|
|
30
|
+
with:
|
|
31
|
+
node-version: "20"
|
|
32
|
+
|
|
33
|
+
- name: Install SWT3 SDK
|
|
34
|
+
run: npm install @tenova/swt3-ai
|
|
35
|
+
|
|
36
|
+
- name: Validate governance config
|
|
37
|
+
env:
|
|
38
|
+
SWT3_API_KEY: ${{ secrets.SWT3_API_KEY }}
|
|
39
|
+
run: |
|
|
40
|
+
if [ ! -f swt3.yaml ] && [ ! -f .swt3.yaml ]; then
|
|
41
|
+
echo "No swt3.yaml found. Run: npx swt3 init"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
npx swt3 doctor --ci
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# SWT3 Profile: Healthcare Clinical AI (HIPAA + FDA AI/ML + EU MDR)
|
|
2
|
+
# AI governance for clinical decision support, diagnostic AI, patient
|
|
3
|
+
# risk scoring, and treatment recommendation systems.
|
|
4
|
+
#
|
|
5
|
+
# Covers HIPAA Privacy/Security Rules, FDA AI/ML SaMD guidance,
|
|
6
|
+
# EU Medical Device Regulation (MDR), GDPR Art. 22/35, and
|
|
7
|
+
# NIST AI RMF GOVERN/MAP/MEASURE/MANAGE.
|
|
8
|
+
#
|
|
9
|
+
# Clinical AI processes protected health information (PHI) and makes
|
|
10
|
+
# decisions with direct patient safety implications. Maximum clearing
|
|
11
|
+
# level and strict human oversight are non-negotiable.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# profile: healthcare-clinical
|
|
15
|
+
# api_key_env: SWT3_API_KEY
|
|
16
|
+
# tenant_id: YOUR_TENANT
|
|
17
|
+
# agent_id: diagnostic-radiology-v2
|
|
18
|
+
|
|
19
|
+
clearing_level: 3 # Classified (PHI and clinical data)
|
|
20
|
+
|
|
21
|
+
policy:
|
|
22
|
+
require_agent_id: true
|
|
23
|
+
require_signing: true
|
|
24
|
+
min_clearing_level: 3
|
|
25
|
+
require_jurisdiction: true # HIPAA / MDR jurisdiction tracking
|
|
26
|
+
required_procedures:
|
|
27
|
+
# Inference provenance
|
|
28
|
+
- AI-INF.1 # Prompt/response hash capture
|
|
29
|
+
# Fairness (diagnostic equity across demographics)
|
|
30
|
+
- AI-FAIR.1 # Bias disparity measurement
|
|
31
|
+
- AI-FAIR.3 # Bias audit witnessing
|
|
32
|
+
# Explainability (clinical decision transparency)
|
|
33
|
+
- AI-EXPL.1 # Explanation generation (feature attribution)
|
|
34
|
+
- AI-EXPL.2 # Confidence scoring (diagnostic certainty)
|
|
35
|
+
# Automated decisions (clinical recommendations)
|
|
36
|
+
- AI-AUTO.1 # Automated decision notification
|
|
37
|
+
# Human oversight (clinician review -- mandatory)
|
|
38
|
+
- AI-HITL.1 # Human review completion
|
|
39
|
+
- AI-HITL.2 # Human override event tracking
|
|
40
|
+
# Patient rights
|
|
41
|
+
- AI-CONSENT.1 # Patient consent (HIPAA authorization)
|
|
42
|
+
- AI-DPIA.1 # Data protection impact assessment
|
|
43
|
+
- AI-TRANS.1 # Transparency disclosure to patients
|
|
44
|
+
# Continuous monitoring
|
|
45
|
+
- AI-PERF.1 # Diagnostic accuracy metrics
|
|
46
|
+
- AI-SAFE.1 # Clinical safe state (failover to human)
|
|
47
|
+
- AI-AUDIT.1 # Audit log integrity (HIPAA requirement)
|
|
48
|
+
- AI-DRIFT.1 # Model drift (population shift detection)
|
|
49
|
+
|
|
50
|
+
trust_mesh:
|
|
51
|
+
mode: strict
|
|
52
|
+
min_trust_level: 3
|
|
53
|
+
require_signature: true
|
|
54
|
+
freshness_window: 1800 # 30 minutes (clinical shift-aligned)
|
|
55
|
+
|
|
56
|
+
density_policy:
|
|
57
|
+
min_anchors_per_1000_tokens: 4
|
|
58
|
+
max_chain_gap_seconds: 60 # Tight gap for clinical decisions
|
|
59
|
+
require_signing_key: true
|
|
60
|
+
|
|
61
|
+
mcp_policy:
|
|
62
|
+
witnessed_tools: ["*"]
|
|
63
|
+
auto_witness: true
|
|
64
|
+
block_on_failure: true # Never allow unwitnessed clinical decisions
|
|
65
|
+
max_velocity: "15/60s"
|
|
66
|
+
max_chain_depth: 5
|
|
67
|
+
fail_secure: true
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# SWT3 Profile: Insurance Underwriting AI (NAIC + State Regs + GDPR)
|
|
2
|
+
# AI governance for actuarial modeling, claims processing, pricing
|
|
3
|
+
# algorithms, risk classification, and underwriting decisions.
|
|
4
|
+
#
|
|
5
|
+
# Covers NAIC Model AI Governance Guidelines, state insurance
|
|
6
|
+
# commissioner regulations, FCRA (adverse action), GDPR Art. 22
|
|
7
|
+
# (automated profiling), and emerging state AI disclosure laws.
|
|
8
|
+
#
|
|
9
|
+
# Insurance AI makes decisions that directly affect coverage access
|
|
10
|
+
# and pricing for protected classes. Bias monitoring, adverse action
|
|
11
|
+
# explainability, and ongoing model validation are regulatory
|
|
12
|
+
# requirements in most US states and EU member states.
|
|
13
|
+
#
|
|
14
|
+
# Usage:
|
|
15
|
+
# profile: insurance-underwriting
|
|
16
|
+
# api_key_env: SWT3_API_KEY
|
|
17
|
+
# tenant_id: YOUR_TENANT
|
|
18
|
+
# agent_id: underwriting-model-v5
|
|
19
|
+
|
|
20
|
+
clearing_level: 2 # Sensitive (policyholder PII)
|
|
21
|
+
|
|
22
|
+
policy:
|
|
23
|
+
require_agent_id: true
|
|
24
|
+
require_signing: true
|
|
25
|
+
min_clearing_level: 2
|
|
26
|
+
require_jurisdiction: true # State-by-state regulation
|
|
27
|
+
required_procedures:
|
|
28
|
+
# Inference provenance
|
|
29
|
+
- AI-INF.1 # Prompt/response hash capture
|
|
30
|
+
# Model lifecycle
|
|
31
|
+
- AI-MDL.1 # Model validation (actuarial standards)
|
|
32
|
+
# Fairness (protected classes in underwriting)
|
|
33
|
+
- AI-FAIR.1 # Bias disparity measurement
|
|
34
|
+
- AI-FAIR.3 # Bias audit witnessing
|
|
35
|
+
# Explainability (adverse action notices)
|
|
36
|
+
- AI-EXPL.1 # Explanation generation (denial reasons)
|
|
37
|
+
- AI-EXPL.2 # Confidence scoring
|
|
38
|
+
# Automated decisions (underwriting, pricing, claims)
|
|
39
|
+
- AI-AUTO.1 # Automated decision notification
|
|
40
|
+
# Human oversight
|
|
41
|
+
- AI-HITL.1 # Human review of denials and edge cases
|
|
42
|
+
# Data governance
|
|
43
|
+
- AI-CONSENT.1 # Policyholder consent
|
|
44
|
+
- AI-DPIA.1 # Data protection impact assessment
|
|
45
|
+
- AI-TRANS.1 # Transparency disclosure
|
|
46
|
+
# Continuous monitoring
|
|
47
|
+
- AI-DRIFT.1 # Model drift (loss ratio shift detection)
|
|
48
|
+
- AI-PERF.1 # Actuarial accuracy metrics
|
|
49
|
+
- AI-AUDIT.1 # Audit log integrity
|
|
50
|
+
|
|
51
|
+
trust_mesh:
|
|
52
|
+
mode: strict
|
|
53
|
+
min_trust_level: 3
|
|
54
|
+
require_signature: true
|
|
55
|
+
freshness_window: 3600 # 1 hour
|
|
56
|
+
|
|
57
|
+
density_policy:
|
|
58
|
+
min_anchors_per_1000_tokens: 3
|
|
59
|
+
max_chain_gap_seconds: 180
|
|
60
|
+
require_signing_key: true
|
|
61
|
+
|
|
62
|
+
mcp_policy:
|
|
63
|
+
witnessed_tools: ["*"]
|
|
64
|
+
auto_witness: true
|
|
65
|
+
block_on_failure: true
|
|
66
|
+
max_velocity: "15/60s"
|
|
67
|
+
max_chain_depth: 6
|
|
68
|
+
fail_secure: true
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# SWT3 Profile: Telecom Compliance (FCC + EU AI Act + NIST AI RMF)
|
|
2
|
+
# Comprehensive AI governance for telecommunications providers operating
|
|
3
|
+
# fraud detection, network optimization, customer scoring, call routing,
|
|
4
|
+
# and predictive maintenance models.
|
|
5
|
+
#
|
|
6
|
+
# Covers FCC AI transparency requirements, EU AI Act Art. 9-15 (high-risk),
|
|
7
|
+
# GDPR Art. 22 (automated decisions), and NIST AI RMF GOVERN/MAP/MEASURE/MANAGE.
|
|
8
|
+
#
|
|
9
|
+
# Telecom AI models process regulated customer data across jurisdictions,
|
|
10
|
+
# requiring strict clearing levels, fairness monitoring, and human oversight
|
|
11
|
+
# for decisions with legal or financial effects.
|
|
12
|
+
#
|
|
13
|
+
# Usage:
|
|
14
|
+
# profile: telecom-compliance
|
|
15
|
+
# api_key_env: SWT3_API_KEY
|
|
16
|
+
# tenant_id: YOUR_TENANT
|
|
17
|
+
# agent_id: fraud-scoring-v3
|
|
18
|
+
|
|
19
|
+
clearing_level: 2 # Sensitive (telecom customer data is regulated)
|
|
20
|
+
|
|
21
|
+
policy:
|
|
22
|
+
require_agent_id: true
|
|
23
|
+
require_signing: true
|
|
24
|
+
min_clearing_level: 2
|
|
25
|
+
require_jurisdiction: true # Multi-country operations require jurisdiction tracking
|
|
26
|
+
required_procedures:
|
|
27
|
+
# Inference provenance (all models)
|
|
28
|
+
- AI-INF.1 # Prompt/response hash capture
|
|
29
|
+
- AI-INF.2 # Latency monitoring (SLA compliance)
|
|
30
|
+
# Model lifecycle
|
|
31
|
+
- AI-MDL.1 # Model weight integrity verification
|
|
32
|
+
- AI-MDL.3 # Model drift scoring
|
|
33
|
+
# Fairness (fraud scoring, credit, customer classification)
|
|
34
|
+
- AI-FAIR.1 # Bias disparity measurement
|
|
35
|
+
- AI-FAIR.3 # Bias audit witnessing
|
|
36
|
+
# Explainability (regulatory requirement for customer-facing decisions)
|
|
37
|
+
- AI-EXPL.1 # Explanation generation
|
|
38
|
+
- AI-EXPL.2 # Confidence scoring
|
|
39
|
+
# Human oversight (flagged transactions, escalations)
|
|
40
|
+
- AI-HITL.1 # Human review completion
|
|
41
|
+
- AI-HITL.2 # Human override event tracking
|
|
42
|
+
# Automated decisions (fraud flags, service denial, credit scoring)
|
|
43
|
+
- AI-AUTO.1 # Automated decision notification (GDPR Art. 22)
|
|
44
|
+
- AI-CONSENT.1 # Data subject consent (GDPR)
|
|
45
|
+
- AI-TRANS.1 # Transparency disclosure (FCC + Art. 13)
|
|
46
|
+
# Continuous monitoring
|
|
47
|
+
- AI-DRIFT.1 # Model drift detection
|
|
48
|
+
- AI-PERF.1 # Performance metrics (accuracy, precision, recall)
|
|
49
|
+
- AI-ROBUST.1 # Robustness testing (adversarial inputs)
|
|
50
|
+
- AI-AUDIT.1 # Audit log integrity
|
|
51
|
+
# Safety and environment
|
|
52
|
+
- AI-SAFE.1 # Safe state transition (network AI failover)
|
|
53
|
+
- AI-ENV.1 # Runtime environment attestation
|
|
54
|
+
|
|
55
|
+
trust_mesh:
|
|
56
|
+
mode: strict # Inter-system handoffs in telecom require strict trust
|
|
57
|
+
min_trust_level: 3
|
|
58
|
+
require_signature: true
|
|
59
|
+
freshness_window: 3600 # 1 hour (shift-aligned)
|
|
60
|
+
|
|
61
|
+
density_policy:
|
|
62
|
+
min_anchors_per_1000_tokens: 3
|
|
63
|
+
max_chain_gap_seconds: 120 # Tight gap for real-time fraud detection
|
|
64
|
+
require_signing_key: true
|
|
65
|
+
|
|
66
|
+
mcp_policy:
|
|
67
|
+
witnessed_tools: ["*"]
|
|
68
|
+
auto_witness: true
|
|
69
|
+
block_on_failure: true # Fail closed for regulated decisions
|
|
70
|
+
max_velocity: "20/60s" # Higher throughput for batch fraud scoring
|
|
71
|
+
max_chain_depth: 8
|
|
72
|
+
fail_secure: true
|