@tenova/swt3-mcp 0.5.1 → 0.5.3

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 ADDED
@@ -0,0 +1,191 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to the Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by the Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding any notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright 2025-2026 Tenable Nova LLC
180
+
181
+ Licensed under the Apache License, Version 2.0 (the "License");
182
+ you may not use this file except in compliance with the License.
183
+ You may obtain a copy of the License at
184
+
185
+ http://www.apache.org/licenses/LICENSE-2.0
186
+
187
+ Unless required by applicable law or agreed to in writing, software
188
+ distributed under the License is distributed on an "AS IS" BASIS,
189
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
190
+ See the License for the specific language governing permissions and
191
+ limitations under the License.
package/README.md CHANGED
@@ -1,7 +1,117 @@
1
1
  # @tenova/swt3-mcp
2
2
 
3
+ > Listed on the [MCP Registry](https://github.com/modelcontextprotocol/servers) as `io.tenova/swt3-witness`
4
+
3
5
  MCP server for the SWT3 AI Witness protocol. Adds cryptographic compliance attestation to any MCP-compatible AI agent.
4
6
 
7
+ SWT3 (Sovereign Witness Traceability) works by hashing your AI's inputs and outputs locally, extracting numeric factors (latency, token count, guardrail status), and anchoring them into a cryptographic fingerprint that anyone can independently verify. Your prompts and responses never leave your machine. The auditor gets tamper-proof evidence. You keep your data.
8
+
9
+ ## Why This Exists
10
+
11
+ In 2026, MCP configuration injection in Flowise led to arbitrary code execution across thousands of AI workflow instances. A compromised third-party AI tool (Context.ai) pivoted into Vercel's internal systems. Microsoft disclosed RCE vulnerabilities in Semantic Kernel. 65% of firms reported AI agent incidents. Only 14.4% of agents go live with full compliance approval.
12
+
13
+ Every tool call your agent makes should be witnessed. This server records those calls, evaluates them against declared policy, and produces a cryptographic evidence chain that proves what happened. The audit trail is immutable. If a tool call doesn't match policy, the witness records the violation -- creating proof of what was attempted and what rule applied.
14
+
15
+ ## Trust Mesh -- Secure Agent-to-Agent Communication
16
+
17
+ Witnessing your own agent is step one. The next question is: can you trust the agent on the other side? Before two agents exchange data, invoke each other's tools, or share context, each side verifies the other's compliance posture. No anchor, no handshake.
18
+
19
+ **You run Agent A. Your partner runs Agent B. Here's what happens:**
20
+
21
+ ```
22
+ Your Agent (A) Partner's Agent (B)
23
+ | |
24
+ |--- presentCredential() --------->|
25
+ | |-- verifyTrust(credential)
26
+ | |-- signed? yes
27
+ | |-- procedures witnessed? 12 of 12
28
+ | |-- trust level? 2 (verified)
29
+ |<---------- GRANTED --------------|
30
+ | |
31
+ | (data exchange begins) |
32
+ | |
33
+ |<-- presentCredential() ----------|
34
+ |-- verifyTrust(credential) |
35
+ |-- signed? yes |
36
+ |-- trusted tenant? yes |
37
+ |------------ GRANTED ------------>|
38
+ | |
39
+ | (bidirectional trust) |
40
+ ```
41
+
42
+ **What each side needs:**
43
+
44
+ 1. Both agents install the SDK (`pip install swt3-ai` or `npm install @tenova/swt3-ai`)
45
+ 2. Both configure `.swt3.yaml` with signing keys and trust boundaries
46
+ 3. Both add each other's tenant to `trusted_tenants`
47
+ 4. Exchange signing keys out-of-band (env vars, secrets manager, KMS)
48
+ 5. Call `presentCredential()` / `verifyTrust()` before any data exchange
49
+
50
+ That's it. When you adopt the SWT3 witness layer, your partners and vendors must adopt it too in order to interact with your agents. Compliance becomes the connection protocol. Every agent in the mesh strengthens the network.
51
+
52
+ ```yaml
53
+ # Your .swt3.yaml
54
+ trust_mesh:
55
+ mode: strict
56
+ min_trust_level: 2
57
+ require_signature: true
58
+ trusted_tenants: ["PARTNER_B_TENANT"]
59
+
60
+ # Partner's .swt3.yaml
61
+ trust_mesh:
62
+ mode: strict
63
+ min_trust_level: 2
64
+ require_signature: true
65
+ trusted_tenants: ["YOUR_TENANT"]
66
+ ```
67
+
68
+ **Trust levels:**
69
+
70
+ | Level | Name | What It Means |
71
+ |-------|------|---------------|
72
+ | 1 | Basic | Valid credential, no signature verified |
73
+ | 2 | Verified | Credential + HMAC signature confirmed |
74
+ | 3 | Attested | Verified + hardware attestation + guardrails |
75
+ | 4 | Sovereign | Attested + clearing level 2+ |
76
+
77
+ Unsigned agents are capped at level 1. You decide the minimum level your agents accept. All verification is local. Zero cloud overhead. No data leaves until both sides clear the gate.
78
+
79
+ ## Policy-as-Code (swt3.yaml)
80
+
81
+ Define your entire witnessing policy in a YAML file. No constructor parameters, no environment variable sprawl:
82
+
83
+ ```bash
84
+ # Generate a config from a built-in profile
85
+ npx @tenova/swt3-mcp # reads .swt3.yaml automatically
86
+ ```
87
+
88
+ ```yaml
89
+ # .swt3.yaml
90
+ endpoint: https://sovereign.tenova.io
91
+ tenant_id: YOUR_TENANT
92
+ api_key_env: SWT3_API_KEY
93
+ clearing_level: 2
94
+ signing_key_env: SWT3_SIGNING_KEY
95
+ agent_id: my-agent
96
+
97
+ trust_mesh:
98
+ mode: strict
99
+ min_trust_level: 2
100
+ require_signature: true
101
+
102
+ mcp_policy:
103
+ require_witness: true
104
+ blocked_tools: ["shell_exec", "rm_rf"]
105
+ ```
106
+
107
+ Layer configs with `extends:` for environment-specific overrides. Three built-in profiles ship with the SDK: `eu-ai-act-high-risk`, `nist-ai-rmf`, and `minimal`.
108
+
109
+ Validate your config:
110
+
111
+ ```bash
112
+ npx swt3 doctor # 8 checks: YAML, env vars, profile, trust mesh
113
+ ```
114
+
5
115
  ## Zero-config start
6
116
 
7
117
  ```bash
@@ -10,6 +120,19 @@ npx @tenova/swt3-mcp
10
120
 
11
121
  That's it. No account, no API key, no configuration. The server starts in demo mode and mints local witness anchors immediately.
12
122
 
123
+ Ask your agent to witness an inference and you'll see:
124
+
125
+ ```
126
+ Verdict: PASS
127
+ Anchor: SWT3-DEMO-LOCAL-AI-AIINF1-PASS-1779146826-ed28dc4c2698
128
+ Procedure: AI-INF.1
129
+ Model: gpt-4o
130
+ Clearing Level: 1
131
+ Fingerprint: ed28dc4c2698
132
+ ```
133
+
134
+ That fingerprint is a SHA-256 hash of the tenant, procedure, factors, and timestamp. Anyone can recompute it independently. If it matches, the anchor is real. If a single bit changed, the hash breaks.
135
+
13
136
  When you're ready to persist anchors to the SWT3 ledger, use the `signup` tool from within your agent conversation -- no need to leave your editor.
14
137
 
15
138
  ## Setup
@@ -68,49 +191,55 @@ claude mcp add swt3 -- npx @tenova/swt3-mcp
68
191
  | **API key only** | `SWT3_API_KEY` | Tenant auto-resolved, anchors persisted |
69
192
  | **Full config** | `SWT3_API_KEY` + `SWT3_TENANT_ID` | Explicit tenant, anchors persisted |
70
193
 
71
- ## Tools
72
-
73
- ### witness_inference
194
+ ## Regulatory Coverage
74
195
 
75
- Mint a cryptographic witness anchor for an AI inference.
196
+ Every anchor maps to specific regulatory obligations:
76
197
 
77
- ```
78
- model_id: "gpt-4o" # required -- everything else is optional
79
- prompt: "What is 2+2?" # hashed locally, never sent to server
80
- response: "4" # hashed locally, never sent to server
81
- ```
198
+ - **EU AI Act**: Articles 9, 10, 12, 13, 14, 53, 72
199
+ - **NIST AI RMF**: GOVERN, MAP, MEASURE, MANAGE functions
200
+ - **OWASP Agentic Top 10**: Tool abuse, prompt injection, chain exploitation
201
+ - **CMMC**: Level 2 evidence automation for defense contractors
202
+ - **NIST 800-53**: SI-7 (integrity), AU-2/AU-3 (audit), AC controls
203
+ - **SR 11-7**: Model risk management for financial services
204
+ - **ISO 42001**: Annex A AI management controls
82
205
 
83
- Returns verdict (PASS/FAIL), anchor token, and verification URL.
206
+ ## Tools (18)
84
207
 
85
- ### verify_anchor
208
+ **Witnessing:**
209
+ `witness_inference` -- mint a cryptographic anchor for any AI inference. Prompt and response are hashed locally, never sent to the server. Returns verdict (PASS/FAIL), anchor token, and verification URL.
86
210
 
87
- Verify the cryptographic integrity of an existing anchor.
211
+ **Verification:**
212
+ `verify_anchor` -- verify the cryptographic integrity of an existing anchor.
88
213
 
89
- ```
90
- token: "SWT3-E-VULTR-AI-AIINF1-PASS-1700000000-96b7d56c0245"
91
- ```
214
+ **Trust Mesh:**
215
+ `verify_agent_trust` -- verify another agent's compliance credential.
216
+ `present_trust_credential` -- present your agent's credential for verification.
92
217
 
93
- ### list_procedures
218
+ **Audit Sessions:**
219
+ `start_audit_session` -- begin a scoped audit session with a session ID.
220
+ `end_audit_session` -- close the session and get a summary with Merkle root.
94
221
 
95
- Browse the UCT procedure registry. 151+ compliance controls.
222
+ **Agent Chains:**
223
+ `start_chain` -- initialize a multi-agent chain with a cycle ID.
224
+ `chain_handoff` -- record a handoff between agents in the chain.
225
+ `report_violation` -- report a policy violation with severity and category.
96
226
 
97
- ```
98
- namespace: "AI" # optional filter
99
- ```
227
+ **Model Governance:**
228
+ `witness_model_integrity` -- witness model weight hashes for tamper detection.
229
+ `witness_adapter_stack` -- witness LoRA/adapter configurations.
100
230
 
101
- ### check_posture
231
+ **Skill Attestation:**
232
+ `attest_skill_manifest` -- witness which skills and plugins are loaded.
233
+ `attest_memory_context` -- witness which memory sources the agent accesses.
102
234
 
103
- Check current tenant compliance posture. No arguments.
104
-
105
- ### signup
106
-
107
- Get a signup link to create a free account. No credentials pass through the AI.
108
-
109
- ```
110
- framework: "EU-AI-ACT" # optional (default: NIST-800-53)
111
- ```
235
+ **Authorization:**
236
+ `witness_authorization` -- witness pre-inference authorization decisions.
112
237
 
113
- Returns a browser URL. Complete signup there, copy your API key, add it to your MCP config.
238
+ **Discovery:**
239
+ `list_procedures` -- browse the UCT procedure registry (151+ controls).
240
+ `suggest_procedures` -- get recommended procedures based on your use case.
241
+ `check_posture` -- check current tenant compliance posture.
242
+ `signup` -- create a free account without leaving your editor.
114
243
 
115
244
  ## Environment variables (optional)
116
245
 
@@ -143,4 +272,4 @@ Raw prompt and response text never leaves your machine at any clearing level.
143
272
 
144
273
  Apache 2.0. Patent pending.
145
274
 
146
- Built by [TeNova](https://tenova.io).
275
+ Built by [TeNova](https://tenova.io). Questions: engineering@tenovaai.com
@@ -15,8 +15,9 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
15
15
  import { loadConfig } from "../config.js";
16
16
  import { createServer } from "../server.js";
17
17
  try {
18
- const config = loadConfig();
19
- const server = createServer(config);
18
+ const bundle = loadConfig();
19
+ const config = bundle.config;
20
+ const server = createServer(config, bundle);
20
21
  const transport = new StdioServerTransport();
21
22
  if (config.demo) {
22
23
  process.stderr.write("swt3-mcp: running in demo mode (local-only anchors)\n" +
@@ -1 +1 @@
1
- {"version":3,"file":"swt3-mcp.js","sourceRoot":"","sources":["../../src/bin/swt3-mcp.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,IAAI,CAAC;IACH,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;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,aAAc,GAAa,CAAC,OAAO,IAAI,CAAC,CAAC;IAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
@@ -12,7 +12,7 @@
12
12
  * 4. Evaluate density policy
13
13
  * 5. Return structured result
14
14
  *
15
- * Patent coverage: PPA #5, PPA #7, PPA #9
15
+ * Patent pending.
16
16
  */
17
17
  import type { McpConfig } from "./config.js";
18
18
  import type { AxiomClient } from "./client.js";
@@ -12,7 +12,7 @@
12
12
  * 4. Evaluate density policy
13
13
  * 5. Return structured result
14
14
  *
15
- * Patent coverage: PPA #5, PPA #7, PPA #9
15
+ * Patent pending.
16
16
  */
17
17
  import { queryAnchors } from "./redis-reader.js";
18
18
  import { signPayload } from "./fingerprint.js";
package/dist/config.d.ts CHANGED
@@ -1,11 +1,15 @@
1
1
  /**
2
- * SWT3 MCP Server Configuration from environment variables.
2
+ * SWT3 MCP Server -- Configuration.
3
3
  *
4
- * Three modes:
5
- * 1. Demo mode (no env vars) — local-only anchors, no account needed
6
- * 2. API key only — tenant auto-resolved from first API call
7
- * 3. Full config API key + explicit tenant ID
4
+ * Priority: env vars > YAML file > defaults
5
+ *
6
+ * Four modes:
7
+ * 1. Demo mode (no env vars, no YAML) -- local-only anchors, no account needed
8
+ * 2. YAML config (SWT3_CONFIG_FILE) -- one file governs MCP + SDK
9
+ * 3. API key only -- tenant auto-resolved from first API call
10
+ * 4. Full config -- API key + explicit tenant ID
8
11
  */
12
+ import type { DensityPolicy } from "./density-policy.js";
9
13
  export interface McpConfig {
10
14
  endpoint: string;
11
15
  apiKey: string;
@@ -22,6 +26,44 @@ export interface McpConfig {
22
26
  redisStream: string;
23
27
  /** Maximum seconds between consecutive anchors in a chain. */
24
28
  maxChainGapSeconds: number;
29
+ /** SHA-256 hash of the config file (if loaded from YAML). */
30
+ configHash?: string;
31
+ }
32
+ export interface YamlTrustMesh {
33
+ trustedTenants: string[];
34
+ deniedAgents: string[];
35
+ deniedTenants: string[];
36
+ }
37
+ export interface McpToolPolicy {
38
+ /** Glob patterns for tools that MUST be witnessed. */
39
+ witnessedTools: string[];
40
+ /** Glob patterns for tools exempt from witnessing. */
41
+ exemptTools: string[];
42
+ /** Minimum trust level required before executing any MCP tool. */
43
+ requireTrustLevel: number;
44
+ /** Auto-witness all MCP tool calls without explicit wrapping. */
45
+ autoWitness: boolean;
46
+ /** Block tool execution if witnessing fails (true) or log-only (false). */
47
+ blockOnFailure: boolean;
48
+ /** Rate limit: "N/Xs" format (e.g., "4/30s"). */
49
+ maxVelocity?: string;
50
+ /** Maximum sequential dependent tool calls. */
51
+ maxChainDepth?: number;
52
+ /** Only these tools are permitted. Empty = all. */
53
+ toolAllowlist?: string[];
54
+ /** These tools are always blocked. */
55
+ toolBlocklist?: string[];
56
+ /** On enforcement error: true = block, false = log. Default true. */
57
+ failSecure?: boolean;
25
58
  }
26
- export declare function loadConfig(): McpConfig;
59
+ export interface McpConfigBundle {
60
+ config: McpConfig;
61
+ densityPolicy: DensityPolicy | null;
62
+ trustMesh: YamlTrustMesh | null;
63
+ mcpPolicy: McpToolPolicy | null;
64
+ }
65
+ /**
66
+ * Load configuration. Checks SWT3_CONFIG_FILE first, falls back to env vars.
67
+ */
68
+ export declare function loadConfig(): McpConfigBundle;
27
69
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,kEAAkE;IAClE,WAAW,EAAE,OAAO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