audit-ledger-mcp 0.2.1 → 0.3.0
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 +332 -302
- package/dist/client.d.ts +19 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +21 -0
- package/dist/client.js.map +1 -1
- package/dist/hashing.d.ts +27 -4
- package/dist/hashing.d.ts.map +1 -1
- package/dist/hashing.js +60 -7
- package/dist/hashing.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/verify_completeness.d.ts +52 -0
- package/dist/tools/verify_completeness.d.ts.map +1 -0
- package/dist/tools/verify_completeness.js +62 -0
- package/dist/tools/verify_completeness.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,302 +1,332 @@
|
|
|
1
|
-
# audit-ledger-mcp
|
|
2
|
-
|
|
3
|
-
**MCP server for the [AI Audit Ledger](https://github.com/shahidh68/audit-ledger).** Lets any AI agent — Claude Desktop, Cursor, LangGraph, custom — record decisions to a tamper-evident audit trail with one line of config.
|
|
4
|
-
|
|
5
|
-
Built for teams shipping AI in regulated contexts: EU AI Act Article 12 logging, FCA SS1/23 model risk evidence, GDPR data minimisation. Personal data is hashed locally before any payload leaves the server — the ledger only ever sees fingerprints.
|
|
6
|
-
|
|
7
|
-
[](https://www.npmjs.com/package/audit-ledger-mcp) [](./LICENSE) [](https://modelcontextprotocol.io)
|
|
8
|
-
|
|
9
|
-
**[Try the live dashboard →](https://d2pfirb2397ixy.cloudfront.net/?demo=1)** · 30 synthetic decisions written via this MCP server, queryable and verifiable.
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<img src="./demo.gif" alt="LangGraph agents using audit-ledger-mcp — triage, risk, and human-in-the-loop each calling record_decision" />
|
|
13
|
-
</p>
|
|
14
|
-
|
|
15
|
-
> A LangGraph workflow calls `record_decision` after each agent step. Three audit events written to the live ledger; every one independently verifiable.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## What it does
|
|
20
|
-
|
|
21
|
-
Exposes
|
|
22
|
-
|
|
23
|
-
| Tool | What it does |
|
|
24
|
-
|---|---|
|
|
25
|
-
| `record_decision`
|
|
26
|
-
| `verify_decision`
|
|
27
|
-
| `
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
[audit-ledger-mcp]
|
|
46
|
-
[audit-ledger-mcp]
|
|
47
|
-
[audit-ledger-mcp]
|
|
48
|
-
[audit-ledger-mcp]
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
| **
|
|
57
|
-
| **
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
export
|
|
92
|
-
export
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
| |
|
|
204
|
-
|
|
|
205
|
-
|
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
- **
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
1
|
+
# audit-ledger-mcp
|
|
2
|
+
|
|
3
|
+
**MCP server for the [AI Audit Ledger](https://github.com/shahidh68/audit-ledger).** Lets any AI agent — Claude Desktop, Cursor, LangGraph, custom — record decisions to a tamper-evident audit trail with one line of config.
|
|
4
|
+
|
|
5
|
+
Built for teams shipping AI in regulated contexts: EU AI Act Article 12 logging, FCA SS1/23 model risk evidence, GDPR data minimisation. Personal data is hashed locally before any payload leaves the server — the ledger only ever sees fingerprints.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/audit-ledger-mcp) [](./LICENSE) [](https://modelcontextprotocol.io)
|
|
8
|
+
|
|
9
|
+
**[Try the live dashboard →](https://d2pfirb2397ixy.cloudfront.net/?demo=1)** · 30 synthetic decisions written via this MCP server, queryable and verifiable.
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="./demo.gif" alt="LangGraph agents using audit-ledger-mcp — triage, risk, and human-in-the-loop each calling record_decision" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
> A LangGraph workflow calls `record_decision` after each agent step. Three audit events written to the live ledger; every one independently verifiable.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## What it does
|
|
20
|
+
|
|
21
|
+
Exposes four tools to any MCP-compatible agent:
|
|
22
|
+
|
|
23
|
+
| Tool | What it does |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `record_decision` | Log an AI decision. Hashes inputs locally, then writes through to the ledger. Returns an event ID. |
|
|
26
|
+
| `verify_decision` | Cross-check a stored record against the immutable S3 Object Lock copy. Returns `integrity_verified: true/false`. |
|
|
27
|
+
| `verify_completeness` | Detect deleted or missing records. Compares the ledger's per-tenant counter against the rows actually present and returns any sequence numbers that are gone. The answer to "can you prove the log is complete?" |
|
|
28
|
+
| `list_decisions` | Query recent decisions, optionally filtered by time window. Tenant-scoped by API key. |
|
|
29
|
+
|
|
30
|
+
Each call ends up as a regulator-grade audit record in your deployed ledger — DynamoDB for query, S3 Object Lock COMPLIANCE mode for the immutable copy, 7-year retention by default.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Quick start — zero configuration
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
npx -y audit-ledger-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
That's it. With no environment variables, the server boots into **sandbox mode** and writes records to a shared public tenant on a hosted ledger. You can try every tool — `record_decision`, `verify_decision`, `verify_completeness`, `list_decisions` — without provisioning anything.
|
|
41
|
+
|
|
42
|
+
When sandbox mode is active, you'll see a banner on stderr:
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
[audit-ledger-mcp] ─────────────── SANDBOX MODE ───────────────
|
|
46
|
+
[audit-ledger-mcp] No AUDIT_API_URL configured.
|
|
47
|
+
[audit-ledger-mcp] Using the public sandbox at sandbox-public.
|
|
48
|
+
[audit-ledger-mcp] View: https://d2pfirb2397ixy.cloudfront.net
|
|
49
|
+
[audit-ledger-mcp] Do NOT write real personal data...
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Sandbox properties
|
|
53
|
+
|
|
54
|
+
| | |
|
|
55
|
+
|---|---|
|
|
56
|
+
| **Hosted by** | github.com/shahidh68/audit-ledger (same AWS deployment) |
|
|
57
|
+
| **Tenant** | `sandbox-public` (shared, public) |
|
|
58
|
+
| **Rate limit** | 100 requests/minute per IP |
|
|
59
|
+
| **Retention** | 7 years (records cannot be deleted) |
|
|
60
|
+
| **Audience** | Tyre-kickers, integration tests, framework demos |
|
|
61
|
+
| **NOT for** | Production data, customer PII, real compliance records |
|
|
62
|
+
|
|
63
|
+
### Wire it into Claude Desktop with zero config
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"mcpServers": {
|
|
68
|
+
"audit-ledger-sandbox": {
|
|
69
|
+
"command": "npx",
|
|
70
|
+
"args": ["-y", "audit-ledger-mcp"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Restart Claude Desktop. The three tools appear in the MCP menu immediately. Try asking Claude to "record this decision: should X be approved?" and watch a record land in the sandbox dashboard.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Production install
|
|
81
|
+
|
|
82
|
+
For real workloads, deploy your own audit ledger and point the MCP server at it:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npm install -g audit-ledger-mcp
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Configure with **all three** env vars (any of them being set switches off sandbox mode):
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
export AUDIT_API_URL="https://<api-id>.execute-api.<region>.amazonaws.com/prod"
|
|
92
|
+
export AUDIT_WRITE_KEY="<your-tenant-write-key>"
|
|
93
|
+
export AUDIT_READ_KEY="<your-tenant-read-key>"
|
|
94
|
+
|
|
95
|
+
# Strongly recommended. Tenant-held secret used to HMAC PII and prompts
|
|
96
|
+
# locally before sending. Generate once, store next to AUDIT_WRITE_KEY:
|
|
97
|
+
# node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
|
98
|
+
# If unset, the MCP falls back to plain SHA-256 and warns once (back-compat).
|
|
99
|
+
export AUDIT_HMAC_KEY="<your-tenant-hmac-secret>"
|
|
100
|
+
|
|
101
|
+
# Optional
|
|
102
|
+
export AUDIT_TIMEOUT_MS=5000 # default 5000
|
|
103
|
+
export AUDIT_RETRY_ATTEMPTS=3 # default 3
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
The full template lives in [`.env.example`](./.env.example).
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Wire it into an agent
|
|
111
|
+
|
|
112
|
+
### Claude Desktop
|
|
113
|
+
|
|
114
|
+
Edit your `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`, Windows: `%APPDATA%\Claude\claude_desktop_config.json`):
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"mcpServers": {
|
|
119
|
+
"audit-ledger": {
|
|
120
|
+
"command": "npx",
|
|
121
|
+
"args": ["-y", "audit-ledger-mcp"],
|
|
122
|
+
"env": {
|
|
123
|
+
"AUDIT_API_URL": "https://<api-id>.execute-api.<region>.amazonaws.com/prod",
|
|
124
|
+
"AUDIT_WRITE_KEY": "<your-tenant-write-key>",
|
|
125
|
+
"AUDIT_READ_KEY": "<your-tenant-read-key>"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Restart Claude Desktop. You'll see "audit-ledger" in the MCP tools menu. Ask Claude something like *"Record this decision: I declined the application because…"* and watch it call `record_decision` automatically.
|
|
133
|
+
|
|
134
|
+
### Cursor
|
|
135
|
+
|
|
136
|
+
In Cursor settings → MCP → add server:
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"audit-ledger": {
|
|
142
|
+
"command": "npx",
|
|
143
|
+
"args": ["-y", "audit-ledger-mcp"],
|
|
144
|
+
"env": {
|
|
145
|
+
"AUDIT_API_URL": "https://<api-id>.execute-api.<region>.amazonaws.com/prod",
|
|
146
|
+
"AUDIT_WRITE_KEY": "<your-tenant-write-key>",
|
|
147
|
+
"AUDIT_READ_KEY": "<your-tenant-read-key>"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### LangGraph (Python)
|
|
155
|
+
|
|
156
|
+
Using [`langchain-mcp-adapters`](https://github.com/langchain-ai/langchain-mcp-adapters):
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
from langchain_mcp_adapters.client import MultiServerMCPClient
|
|
160
|
+
from langgraph.prebuilt import create_react_agent
|
|
161
|
+
from langchain_anthropic import ChatAnthropic
|
|
162
|
+
import os
|
|
163
|
+
|
|
164
|
+
client = MultiServerMCPClient({
|
|
165
|
+
"audit-ledger": {
|
|
166
|
+
"command": "npx",
|
|
167
|
+
"args": ["-y", "audit-ledger-mcp"],
|
|
168
|
+
"transport": "stdio",
|
|
169
|
+
"env": {
|
|
170
|
+
"AUDIT_API_URL": os.environ["AUDIT_API_URL"],
|
|
171
|
+
"AUDIT_WRITE_KEY": os.environ["AUDIT_WRITE_KEY"],
|
|
172
|
+
"AUDIT_READ_KEY": os.environ["AUDIT_READ_KEY"],
|
|
173
|
+
},
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
tools = await client.get_tools()
|
|
178
|
+
agent = create_react_agent(
|
|
179
|
+
ChatAnthropic(model="claude-sonnet-4-7-20251022"),
|
|
180
|
+
tools,
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
# The agent can now call record_decision, verify_decision, list_decisions
|
|
184
|
+
result = await agent.ainvoke({
|
|
185
|
+
"messages": [{"role": "user", "content": "Triage this loan application…"}]
|
|
186
|
+
})
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Custom client (raw MCP)
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
AUDIT_API_URL=... AUDIT_WRITE_KEY=... npx -y audit-ledger-mcp
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The server speaks MCP over stdio. Send `initialize`, `tools/list`, and `tools/call` requests per the [MCP specification](https://modelcontextprotocol.io/specification).
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## How a `record_decision` call flows
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
Agent audit-ledger-mcp AWS (your ledger)
|
|
203
|
+
| | |
|
|
204
|
+
|--- record_decision ----->| |
|
|
205
|
+
| raw_user_input | (hash locally — no PII over |
|
|
206
|
+
| raw_system_prompt | the wire from this point) |
|
|
207
|
+
| decision_output | |
|
|
208
|
+
| human_in_loop | |
|
|
209
|
+
| |--- HTTPS POST /audit/events --->|
|
|
210
|
+
| | {hashes + decision + |
|
|
211
|
+
| | x-api-key} |
|
|
212
|
+
| | |
|
|
213
|
+
| |<--- 202 Accepted ---------------|
|
|
214
|
+
| | { event_id, ... } |
|
|
215
|
+
|<--- event_id ------------| |
|
|
216
|
+
| recorded_at | |
|
|
217
|
+
| note | |
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Storage on the AWS side happens asynchronously through SQS → Processor Lambda → DynamoDB + S3 Object Lock. See the [main repo's ARCHITECTURE.md](https://github.com/shahidh68/audit-ledger/blob/main/ARCHITECTURE.md) for the full path.
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Tool reference
|
|
225
|
+
|
|
226
|
+
### `record_decision`
|
|
227
|
+
|
|
228
|
+
Record an AI decision to the ledger.
|
|
229
|
+
|
|
230
|
+
| Parameter | Type | Required | Notes |
|
|
231
|
+
|---|---|---|---|
|
|
232
|
+
| `model_version` | string | Yes | e.g. `"claude-sonnet-4-7-20251022"` |
|
|
233
|
+
| `raw_system_prompt` | string | Yes | Hashed locally |
|
|
234
|
+
| `raw_user_input` | string | Yes | Hashed locally |
|
|
235
|
+
| `ai_decision_output` | object | Yes | Stored verbatim — must not contain raw PII |
|
|
236
|
+
| `human_in_loop` | boolean | Yes | Critical for EU AI Act Article 14 |
|
|
237
|
+
| `event_id` | uuid v4 | No | Auto-generated if omitted |
|
|
238
|
+
| `timestamp` | ISO 8601 | No | Defaults to now |
|
|
239
|
+
|
|
240
|
+
### `verify_decision`
|
|
241
|
+
|
|
242
|
+
Tamper-check a stored record.
|
|
243
|
+
|
|
244
|
+
| Parameter | Type | Required | Notes |
|
|
245
|
+
|---|---|---|---|
|
|
246
|
+
| `event_id` | uuid v4 | Yes | The ID of the record to verify |
|
|
247
|
+
|
|
248
|
+
Returns the DynamoDB record, the S3 record, and `integrity_verified: true/false`.
|
|
249
|
+
|
|
250
|
+
### `verify_completeness`
|
|
251
|
+
|
|
252
|
+
Detect missing records. Sister tool to `verify_decision`: that one proves a record that exists has not been altered; this one proves no records have been deleted.
|
|
253
|
+
|
|
254
|
+
| Parameter | Type | Required | Notes |
|
|
255
|
+
|---|---|---|---|
|
|
256
|
+
| `from` | integer | No | Inclusive lower bound on sequence_no. Defaults to 1. |
|
|
257
|
+
| `to` | integer | No | Inclusive upper bound on sequence_no. Defaults to the tenant's current counter. |
|
|
258
|
+
| `tenant_id` | string | No | Required only with the admin read key; ignored otherwise. |
|
|
259
|
+
|
|
260
|
+
Returns the requested range, the expected vs found count, the list of missing sequence numbers, and a human-readable note.
|
|
261
|
+
|
|
262
|
+
```json
|
|
263
|
+
{
|
|
264
|
+
"tenant_id": "acme-prod",
|
|
265
|
+
"range": { "from": 1, "to": 142 },
|
|
266
|
+
"expected_count": 142,
|
|
267
|
+
"found_count": 140,
|
|
268
|
+
"missing": [47, 91],
|
|
269
|
+
"note": "Found 2 missing sequence number(s) in range. Each gap represents a deleted, lost, or never-written record. Cross-check against burned_sequence log entries before treating as a deletion."
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `list_decisions`
|
|
274
|
+
|
|
275
|
+
List recent decisions for the calling tenant.
|
|
276
|
+
|
|
277
|
+
| Parameter | Type | Required | Notes |
|
|
278
|
+
|---|---|---|---|
|
|
279
|
+
| `from` | ISO 8601 | No | Defaults to 7 days ago |
|
|
280
|
+
| `to` | ISO 8601 | No | Defaults to now |
|
|
281
|
+
| `limit` | integer 1–500 | No | Defaults to 100 |
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Security
|
|
286
|
+
|
|
287
|
+
- **PII hashing happens in this process, not in the ledger.** HMAC-SHA256 over UTF-8, keyed off the `AUDIT_HMAC_KEY` you set in your environment. The key never leaves your process; only the 64-char hex digest is sent. Plain SHA-256 of low-entropy values (names, emails) is brute-forceable in seconds and under ICO/EDPB guidance still counts as personal data, which is why the keyed version is the default for new installs. For backwards compatibility, if `AUDIT_HMAC_KEY` is unset the MCP falls back to plain SHA-256 and logs a one-time deprecation warning on stderr; existing setups keep working unchanged.
|
|
288
|
+
- **API keys are never logged.** They come from environment variables, are passed in the `x-api-key` header, and are never echoed back to the agent or written to disk.
|
|
289
|
+
- **Two key namespaces.** Write keys cannot read; read keys cannot write. A leaked write key cannot exfiltrate data; a leaked read key cannot plant fake records.
|
|
290
|
+
- **Errors are propagated with HTTP status passthrough.** Rate limit, invalid key, and validation errors surface to the agent so it can react appropriately rather than retry blindly.
|
|
291
|
+
|
|
292
|
+
---
|
|
293
|
+
|
|
294
|
+
## What this is not
|
|
295
|
+
|
|
296
|
+
- **Not legal advice.** This is infrastructure that produces audit evidence. Whether that evidence satisfies any specific regulatory obligation is a question for your legal team.
|
|
297
|
+
- **Not a substitute for a model risk audit.** It records what the AI did, not whether it was right.
|
|
298
|
+
- **Not a bias or fairness testing tool.** It is the audit layer underneath whatever testing you already do.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Development
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
git clone https://github.com/shahidh68/audit-ledger-mcp.git
|
|
306
|
+
cd audit-ledger-mcp
|
|
307
|
+
npm install
|
|
308
|
+
npm run build
|
|
309
|
+
npm test
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
The server is TypeScript on Node 20+, ESM, stdio transport, using `@modelcontextprotocol/sdk`.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Related
|
|
317
|
+
|
|
318
|
+
- **[shahidh68/audit-ledger](https://github.com/shahidh68/audit-ledger)** — the AWS infrastructure this server talks to. CDK stack, Python and Node SDKs, compliance dashboard, full architecture documentation.
|
|
319
|
+
|
|
320
|
+
---
|
|
321
|
+
|
|
322
|
+
## License
|
|
323
|
+
|
|
324
|
+
Apache License 2.0 — see [LICENSE](./LICENSE).
|
|
325
|
+
|
|
326
|
+
The patent grant is intentional. Compliance infrastructure sits adjacent to enterprise legal review and the explicit grant matters there.
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## Author
|
|
331
|
+
|
|
332
|
+
Built by [Shahid](https://github.com/shahidh68). Available for Principal AI Engineering and Head of AI Engineering roles, and fractional advisory engagements, in UK regulated fintech.
|
package/dist/client.d.ts
CHANGED
|
@@ -34,6 +34,19 @@ export interface TamperCheckResult {
|
|
|
34
34
|
dynamodb_record: DecisionRecord;
|
|
35
35
|
s3_record: DecisionRecord;
|
|
36
36
|
}
|
|
37
|
+
export interface CompletenessResult {
|
|
38
|
+
tenant_id: string;
|
|
39
|
+
range: {
|
|
40
|
+
from: number;
|
|
41
|
+
to: number;
|
|
42
|
+
};
|
|
43
|
+
expected_count: number;
|
|
44
|
+
found_count: number;
|
|
45
|
+
/** Sequence numbers issued by the ledger that are no longer present. */
|
|
46
|
+
missing: number[];
|
|
47
|
+
/** Human-readable summary. Distinguishes empty tenant, all-present, gaps. */
|
|
48
|
+
note: string;
|
|
49
|
+
}
|
|
37
50
|
export declare class AuditLedgerClient {
|
|
38
51
|
private readonly apiUrl;
|
|
39
52
|
private readonly writeKey?;
|
|
@@ -45,6 +58,12 @@ export declare class AuditLedgerClient {
|
|
|
45
58
|
event_id: string;
|
|
46
59
|
}>;
|
|
47
60
|
verifyDecision(eventId: string): Promise<TamperCheckResult>;
|
|
61
|
+
verifyCompleteness(opts?: {
|
|
62
|
+
from?: number;
|
|
63
|
+
to?: number;
|
|
64
|
+
/** Required only when caller holds the admin read key; ignored otherwise. */
|
|
65
|
+
tenantId?: string;
|
|
66
|
+
}): Promise<CompletenessResult>;
|
|
48
67
|
listDecisions(opts: {
|
|
49
68
|
from?: string;
|
|
50
69
|
to?: string;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAA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|
|
66
|
+
if (!this.readKey) {
|
|
67
|
+
throw new AuditLedgerError("AUDIT_READ_KEY is not set — verify_completeness unavailable");
|
|
68
|
+
}
|
|
69
|
+
const params = new URLSearchParams();
|
|
70
|
+
if (typeof opts.from === "number")
|
|
71
|
+
params.set("from", String(opts.from));
|
|
72
|
+
if (typeof opts.to === "number")
|
|
73
|
+
params.set("to", String(opts.to));
|
|
74
|
+
if (opts.tenantId)
|
|
75
|
+
params.set("tenant_id", opts.tenantId);
|
|
76
|
+
const url = `${this.apiUrl}/audit/verify-completeness${params.toString() ? `?${params}` : ""}`;
|
|
77
|
+
const res = await this.fetchWithRetry(url, {
|
|
78
|
+
method: "GET",
|
|
79
|
+
headers: { "Accept": "application/json", "x-api-key": this.readKey },
|
|
80
|
+
});
|
|
81
|
+
if (res.status !== 200) {
|
|
82
|
+
throw new AuditLedgerError(`verify_completeness failed: HTTP ${res.status}`, res.status, await safeText(res));
|
|
83
|
+
}
|
|
84
|
+
return (await res.json());
|
|
85
|
+
}
|
|
65
86
|
async listDecisions(opts) {
|
|
66
87
|
if (!this.readKey) {
|
|
67
88
|
throw new AuditLedgerError("AUDIT_READ_KEY is not set — list_decisions unavailable");
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAGvB;IACA;IAHlB,YACE,OAAe,EACC,MAAe,EACf,IAAa;QAE7B,KAAK,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;QAHnB,WAAM,GAAN,MAAM,CAAS;QACf,SAAI,GAAJ,IAAI,CAAS;QAG7B,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAUH,M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CAAC;QAC5C,MAAM,IAAI,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;CACF;AAED,KAAK,UAAU,QAAQ,CAAC,GAAa;IACnC,IAAI,CAAC;QAAC,OAAO,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC;IAAC,CAAC;AACvD,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,GAAa;IACnC,IAAI,CAAC;QAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAA4B,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC;QAAC,OAAO,IAAI,CAAC;IAAC,CAAC;AACtF,CAAC"}
|
package/dist/hashing.d.ts
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Local hashing — raw PII never leaves the MCP server's process.
|
|
3
|
+
*
|
|
4
|
+
* By default this module uses HMAC-SHA256 keyed off the AUDIT_HMAC_KEY
|
|
5
|
+
* environment variable. Keyed hashing makes the output non-reversible by
|
|
6
|
+
* anyone who does not hold the key, which is what regulators (ICO / EDPB)
|
|
7
|
+
* expect when you describe a value as pseudonymised rather than identifiable.
|
|
8
|
+
*
|
|
9
|
+
* Backwards-compatible fallback:
|
|
10
|
+
* If AUDIT_HMAC_KEY is not set, the functions fall back to plain SHA-256
|
|
11
|
+
* so existing MCP installs do not break. A one-time stderr warning is
|
|
12
|
+
* emitted on first use to nudge operators to upgrade. The default will
|
|
13
|
+
* flip in a future major version.
|
|
14
|
+
*
|
|
15
|
+
* The key is your tenant's secret. Generate once and store it where you
|
|
16
|
+
* already store AUDIT_WRITE_KEY (env var, .env file, secrets manager):
|
|
17
|
+
* node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
|
18
|
+
* The key never leaves your environment and never reaches the ledger API.
|
|
6
19
|
*/
|
|
7
20
|
/** SHA-256 hex digest of a UTF-8 string. Lowercased, 64 chars. */
|
|
8
21
|
export declare function sha256(input: string): string;
|
|
@@ -11,6 +24,8 @@ export declare function sha256(input: string): string;
|
|
|
11
24
|
* formatting-only changes do not produce a different hash — this matches
|
|
12
25
|
* the behaviour of the SDKs in the main repo and keeps prompt-version
|
|
13
26
|
* tracking stable across minor edits.
|
|
27
|
+
*
|
|
28
|
+
* Uses HMAC-SHA256 when AUDIT_HMAC_KEY is set, plain SHA-256 otherwise.
|
|
14
29
|
*/
|
|
15
30
|
export declare function hashPrompt(rawPrompt: string): string;
|
|
16
31
|
/**
|
|
@@ -18,6 +33,14 @@ export declare function hashPrompt(rawPrompt: string): string;
|
|
|
18
33
|
* before sending. No normalisation — the input is hashed verbatim so any
|
|
19
34
|
* change in the input produces a different hash, which is the right
|
|
20
35
|
* behaviour for an audit trail of model inputs.
|
|
36
|
+
*
|
|
37
|
+
* Uses HMAC-SHA256 when AUDIT_HMAC_KEY is set, plain SHA-256 otherwise.
|
|
21
38
|
*/
|
|
22
39
|
export declare function hashPii(rawInput: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Test-only hook. Resets the one-time warned flag so unit tests can assert
|
|
42
|
+
* the warning fires exactly once per process. Not part of the public API.
|
|
43
|
+
* @internal
|
|
44
|
+
*/
|
|
45
|
+
export declare function _resetFallbackWarnedForTests(): void;
|
|
23
46
|
//# sourceMappingURL=hashing.d.ts.map
|
package/dist/hashing.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashing.d.ts","sourceRoot":"","sources":["../src/hashing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hashing.d.ts","sourceRoot":"","sources":["../src/hashing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0BH,kEAAkE;AAClE,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOhD;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
|
package/dist/hashing.js
CHANGED
|
@@ -1,10 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Local hashing — raw PII never leaves the MCP server's process.
|
|
3
|
+
*
|
|
4
|
+
* By default this module uses HMAC-SHA256 keyed off the AUDIT_HMAC_KEY
|
|
5
|
+
* environment variable. Keyed hashing makes the output non-reversible by
|
|
6
|
+
* anyone who does not hold the key, which is what regulators (ICO / EDPB)
|
|
7
|
+
* expect when you describe a value as pseudonymised rather than identifiable.
|
|
8
|
+
*
|
|
9
|
+
* Backwards-compatible fallback:
|
|
10
|
+
* If AUDIT_HMAC_KEY is not set, the functions fall back to plain SHA-256
|
|
11
|
+
* so existing MCP installs do not break. A one-time stderr warning is
|
|
12
|
+
* emitted on first use to nudge operators to upgrade. The default will
|
|
13
|
+
* flip in a future major version.
|
|
14
|
+
*
|
|
15
|
+
* The key is your tenant's secret. Generate once and store it where you
|
|
16
|
+
* already store AUDIT_WRITE_KEY (env var, .env file, secrets manager):
|
|
17
|
+
* node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"
|
|
18
|
+
* The key never leaves your environment and never reaches the ledger API.
|
|
6
19
|
*/
|
|
7
|
-
import { createHash } from "node:crypto";
|
|
20
|
+
import { createHash, createHmac } from "node:crypto";
|
|
21
|
+
let _fallbackWarned = false;
|
|
22
|
+
function getKey() {
|
|
23
|
+
const raw = (process.env.AUDIT_HMAC_KEY ?? "").trim();
|
|
24
|
+
return raw.length > 0 ? raw : null;
|
|
25
|
+
}
|
|
26
|
+
function warnFallbackOnce() {
|
|
27
|
+
if (_fallbackWarned)
|
|
28
|
+
return;
|
|
29
|
+
_fallbackWarned = true;
|
|
30
|
+
// stderr, not stdout — stdout is the MCP protocol channel and any extra
|
|
31
|
+
// bytes there will break the client. console.warn goes to stderr in Node.
|
|
32
|
+
console.warn("[audit-ledger-mcp] AUDIT_HMAC_KEY is not set; falling back to plain " +
|
|
33
|
+
"SHA-256 for PII hashing. Plain SHA-256 of low-entropy values (names, " +
|
|
34
|
+
"emails) is brute-forceable and should not be treated as anonymisation " +
|
|
35
|
+
"under ICO/EDPB guidance. Set AUDIT_HMAC_KEY to a 32+ byte secret to " +
|
|
36
|
+
"switch to keyed HMAC-SHA256. This fallback will be removed in a " +
|
|
37
|
+
"future major version.");
|
|
38
|
+
}
|
|
8
39
|
/** SHA-256 hex digest of a UTF-8 string. Lowercased, 64 chars. */
|
|
9
40
|
export function sha256(input) {
|
|
10
41
|
return createHash("sha256").update(input, "utf8").digest("hex");
|
|
@@ -14,18 +45,40 @@ export function sha256(input) {
|
|
|
14
45
|
* formatting-only changes do not produce a different hash — this matches
|
|
15
46
|
* the behaviour of the SDKs in the main repo and keeps prompt-version
|
|
16
47
|
* tracking stable across minor edits.
|
|
48
|
+
*
|
|
49
|
+
* Uses HMAC-SHA256 when AUDIT_HMAC_KEY is set, plain SHA-256 otherwise.
|
|
17
50
|
*/
|
|
18
51
|
export function hashPrompt(rawPrompt) {
|
|
19
52
|
const normalised = rawPrompt.replace(/\s+/g, " ").trim();
|
|
20
|
-
|
|
53
|
+
const key = getKey();
|
|
54
|
+
if (key === null) {
|
|
55
|
+
warnFallbackOnce();
|
|
56
|
+
return createHash("sha256").update(normalised, "utf8").digest("hex");
|
|
57
|
+
}
|
|
58
|
+
return createHmac("sha256", key).update(normalised, "utf8").digest("hex");
|
|
21
59
|
}
|
|
22
60
|
/**
|
|
23
61
|
* Hash raw user input (e.g. a CV, a transaction payload, a customer record)
|
|
24
62
|
* before sending. No normalisation — the input is hashed verbatim so any
|
|
25
63
|
* change in the input produces a different hash, which is the right
|
|
26
64
|
* behaviour for an audit trail of model inputs.
|
|
65
|
+
*
|
|
66
|
+
* Uses HMAC-SHA256 when AUDIT_HMAC_KEY is set, plain SHA-256 otherwise.
|
|
27
67
|
*/
|
|
28
68
|
export function hashPii(rawInput) {
|
|
29
|
-
|
|
69
|
+
const key = getKey();
|
|
70
|
+
if (key === null) {
|
|
71
|
+
warnFallbackOnce();
|
|
72
|
+
return createHash("sha256").update(rawInput, "utf8").digest("hex");
|
|
73
|
+
}
|
|
74
|
+
return createHmac("sha256", key).update(rawInput, "utf8").digest("hex");
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Test-only hook. Resets the one-time warned flag so unit tests can assert
|
|
78
|
+
* the warning fires exactly once per process. Not part of the public API.
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
81
|
+
export function _resetFallbackWarnedForTests() {
|
|
82
|
+
_fallbackWarned = false;
|
|
30
83
|
}
|
|
31
84
|
//# sourceMappingURL=hashing.js.map
|
package/dist/hashing.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hashing.js","sourceRoot":"","sources":["../src/hashing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hashing.js","sourceRoot":"","sources":["../src/hashing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAErD,IAAI,eAAe,GAAG,KAAK,CAAC;AAE5B,SAAS,MAAM;IACb,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACtD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AACrC,CAAC;AAED,SAAS,gBAAgB;IACvB,IAAI,eAAe;QAAE,OAAO;IAC5B,eAA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,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B;IAC1C,eAAe,GAAG,KAAK,CAAC;AAC1B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ import { AuditLedgerClient, AuditLedgerError } from "./client.js";
|
|
|
20
20
|
import { SANDBOX_CONFIG, isSandboxMode, sandboxBanner } from "./sandbox.js";
|
|
21
21
|
import { executeRecordDecision, recordDecisionToolDefinition, } from "./tools/record_decision.js";
|
|
22
22
|
import { executeVerifyDecision, verifyDecisionToolDefinition, } from "./tools/verify_decision.js";
|
|
23
|
+
import { executeVerifyCompleteness, verifyCompletenessToolDefinition, } from "./tools/verify_completeness.js";
|
|
23
24
|
import { executeListDecisions, listDecisionsToolDefinition, } from "./tools/list_decisions.js";
|
|
24
25
|
// Read package.json at startup so PKG_NAME and PKG_VERSION cannot drift from
|
|
25
26
|
// the published package version. dist/index.js lives one level below the
|
|
@@ -66,6 +67,7 @@ async function main() {
|
|
|
66
67
|
tools: [
|
|
67
68
|
recordDecisionToolDefinition,
|
|
68
69
|
verifyDecisionToolDefinition,
|
|
70
|
+
verifyCompletenessToolDefinition,
|
|
69
71
|
listDecisionsToolDefinition,
|
|
70
72
|
],
|
|
71
73
|
}));
|
|
@@ -80,6 +82,9 @@ async function main() {
|
|
|
80
82
|
case "verify_decision":
|
|
81
83
|
result = await executeVerifyDecision(client, args);
|
|
82
84
|
break;
|
|
85
|
+
case "verify_completeness":
|
|
86
|
+
result = await executeVerifyCompleteness(client, args);
|
|
87
|
+
break;
|
|
83
88
|
case "list_decisions":
|
|
84
89
|
result = await executeListDecisions(client, args);
|
|
85
90
|
break;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;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AG,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;gBAChG,CAAC,CAAC,GAAG,YAAY,KAAK;oBACpB,CAAC,CAAC,GAAG,CAAC,OAAO;oBACb,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACpB,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,OAAO,EAAE,EAAE,CAAC;gBACtD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,QAAQ,KAAK,WAAW,uBAAuB,CAAC,CAAC;AAC5E,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,QAAQ,YAAY,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verify_completeness tool — detect missing audit records.
|
|
3
|
+
*
|
|
4
|
+
* Sister tool to verify_decision. verify_decision proves a record that exists
|
|
5
|
+
* matches its S3 copy (tampering check). verify_completeness proves no
|
|
6
|
+
* records have been deleted by comparing the tenant's monotonic sequence
|
|
7
|
+
* counter against the rows actually present in DynamoDB. A gap in the
|
|
8
|
+
* returned `missing` array represents a record that was deleted, lost during
|
|
9
|
+
* SQS redelivery, or otherwise never stored — combine with the processor's
|
|
10
|
+
* burned_sequence log entries to tell those apart.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import type { AuditLedgerClient, CompletenessResult } from "../client.js";
|
|
14
|
+
export declare const verifyCompletenessInputSchema: z.ZodObject<{
|
|
15
|
+
from: z.ZodOptional<z.ZodNumber>;
|
|
16
|
+
to: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
tenant_id: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
tenant_id?: string | undefined;
|
|
20
|
+
from?: number | undefined;
|
|
21
|
+
to?: number | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
tenant_id?: string | undefined;
|
|
24
|
+
from?: number | undefined;
|
|
25
|
+
to?: number | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type VerifyCompletenessInput = z.infer<typeof verifyCompletenessInputSchema>;
|
|
28
|
+
export declare const verifyCompletenessToolDefinition: {
|
|
29
|
+
readonly name: "verify_completeness";
|
|
30
|
+
readonly description: "Detect whether any audit records have been deleted or omitted for the caller's tenant. Each successfully stored decision receives a per-tenant monotonic sequence number. This tool compares the ledger's counter against the rows actually present in DynamoDB and returns any sequence numbers that are missing. Use this when a regulator or compliance team asks 'can you prove the log is complete?' — verify_decision only proves an existing record was not altered; this proves no record has disappeared.";
|
|
31
|
+
readonly inputSchema: {
|
|
32
|
+
readonly type: "object";
|
|
33
|
+
readonly properties: {
|
|
34
|
+
readonly from: {
|
|
35
|
+
readonly type: "integer";
|
|
36
|
+
readonly minimum: 1;
|
|
37
|
+
readonly description: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
readonly to: {
|
|
40
|
+
readonly type: "integer";
|
|
41
|
+
readonly minimum: 1;
|
|
42
|
+
readonly description: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
readonly tenant_id: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly description: string | undefined;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare function executeVerifyCompleteness(client: AuditLedgerClient, rawInput: unknown): Promise<CompletenessResult>;
|
|
52
|
+
//# sourceMappingURL=verify_completeness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify_completeness.d.ts","sourceRoot":"","sources":["../../src/tools/verify_completeness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE1E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAqBxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;CAuBnC,CAAC;AAEX,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,iBAAiB,EACzB,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAO7B"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verify_completeness tool — detect missing audit records.
|
|
3
|
+
*
|
|
4
|
+
* Sister tool to verify_decision. verify_decision proves a record that exists
|
|
5
|
+
* matches its S3 copy (tampering check). verify_completeness proves no
|
|
6
|
+
* records have been deleted by comparing the tenant's monotonic sequence
|
|
7
|
+
* counter against the rows actually present in DynamoDB. A gap in the
|
|
8
|
+
* returned `missing` array represents a record that was deleted, lost during
|
|
9
|
+
* SQS redelivery, or otherwise never stored — combine with the processor's
|
|
10
|
+
* burned_sequence log entries to tell those apart.
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
export const verifyCompletenessInputSchema = z.object({
|
|
14
|
+
from: z
|
|
15
|
+
.number()
|
|
16
|
+
.int()
|
|
17
|
+
.min(1)
|
|
18
|
+
.optional()
|
|
19
|
+
.describe("Inclusive lower bound on sequence_no. Defaults to 1."),
|
|
20
|
+
to: z
|
|
21
|
+
.number()
|
|
22
|
+
.int()
|
|
23
|
+
.min(1)
|
|
24
|
+
.optional()
|
|
25
|
+
.describe("Inclusive upper bound on sequence_no. Defaults to the tenant's current counter value."),
|
|
26
|
+
tenant_id: z
|
|
27
|
+
.string()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe("Required only when calling with the admin read key. Ignored when called with a regular tenant read key — the tenant is inferred from the key."),
|
|
30
|
+
});
|
|
31
|
+
export const verifyCompletenessToolDefinition = {
|
|
32
|
+
name: "verify_completeness",
|
|
33
|
+
description: "Detect whether any audit records have been deleted or omitted for the caller's tenant. Each successfully stored decision receives a per-tenant monotonic sequence number. This tool compares the ledger's counter against the rows actually present in DynamoDB and returns any sequence numbers that are missing. Use this when a regulator or compliance team asks 'can you prove the log is complete?' — verify_decision only proves an existing record was not altered; this proves no record has disappeared.",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
from: {
|
|
38
|
+
type: "integer",
|
|
39
|
+
minimum: 1,
|
|
40
|
+
description: verifyCompletenessInputSchema.shape.from.description,
|
|
41
|
+
},
|
|
42
|
+
to: {
|
|
43
|
+
type: "integer",
|
|
44
|
+
minimum: 1,
|
|
45
|
+
description: verifyCompletenessInputSchema.shape.to.description,
|
|
46
|
+
},
|
|
47
|
+
tenant_id: {
|
|
48
|
+
type: "string",
|
|
49
|
+
description: verifyCompletenessInputSchema.shape.tenant_id.description,
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export async function executeVerifyCompleteness(client, rawInput) {
|
|
55
|
+
const input = verifyCompletenessInputSchema.parse(rawInput ?? {});
|
|
56
|
+
return client.verifyCompleteness({
|
|
57
|
+
from: input.from,
|
|
58
|
+
to: input.to,
|
|
59
|
+
tenantId: input.tenant_id,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=verify_completeness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify_completeness.js","sourceRoot":"","sources":["../../src/tools/verify_completeness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,CAAC;SACJ,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CAAC,sDAAsD,CAAC;IACnE,EAAE,EAAE,CAAC;SACF,MAAM,EAAE;SACR,GAAG,EAAE;SACL,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,uFAAuF,CACxF;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,+IAA+I,CAChJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,ofAAof;IACtf,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,6BAA6B,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW;aAClE;YACD,EAAE,EAAE;gBACF,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,CAAC;gBACV,WAAW,EAAE,6BAA6B,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW;aAChE;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC,WAAW;aACvE;SACF;KACF;CACO,CAAC;AAEX,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAyB,EACzB,QAAiB;IAEjB,MAAM,KAAK,GAAG,6BAA6B,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAClE,OAAO,MAAM,CAAC,kBAAkB,CAAC;QAC/B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,QAAQ,EAAE,KAAK,CAAC,SAAS;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "audit-ledger-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "MCP server for AI Audit Ledger — record AI decisions to a tamper-evident ledger from any agent (Claude, Cursor, LangGraph, custom).",
|
|
5
5
|
"mcpName": "io.github.shahidh68/audit-ledger-mcp",
|
|
6
6
|
"type": "module",
|