@guardbee/mcp-prompt-leak-scanner 0.1.27 → 1.0.1

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/CHANGELOG.md ADDED
@@ -0,0 +1,223 @@
1
+ # @guardbee/mcp-prompt-leak-scanner
2
+
3
+ ## 1.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#178](https://github.com/GuardBee/guardbee-mcp/pull/178) [`c89dc93`](https://github.com/GuardBee/guardbee-mcp/commit/c89dc93bd04e53bc8b72806f279531676b8defcc) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - MCP tools are registered with `server.registerTool(name, { description, inputSchema, annotations }, handler)` instead of the deprecated `server.tool(...)` (132 registrations, no change to tool names, descriptions or parameters). `@modelcontextprotocol/sdk` is now required at `^1.30.0` instead of `^1.0.0` / `>=1.0.0`, so an install cannot resolve an old SDK the code was never tested with. `@guardbee/mcp-telemetry`'s `instrumentServer` wraps `registerTool` as well as `tool`.
8
+
9
+ - [#175](https://github.com/GuardBee/guardbee-mcp/pull/175) [`341a283`](https://github.com/GuardBee/guardbee-mcp/commit/341a2839d56a312f1cb1998a523eb7ea985345db) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - Smaller npm packages (55% less unpacked in total; the proxy 944 → 513 kB): source maps and compiled tests are no longer published (the sources they point at never were), and the translated READMEs stay on GitHub, linked from the English one. Package descriptions now start with what people search for ("MCP gateway and LLM firewall", "Secret scanner for code, git history and AI agent transcripts") and carry more search keywords.
10
+ - Updated dependencies [[`12487ab`](https://github.com/GuardBee/guardbee-mcp/commit/12487abec2f0a8bc00b04fee1f8b62e64329c98b), [`c89dc93`](https://github.com/GuardBee/guardbee-mcp/commit/c89dc93bd04e53bc8b72806f279531676b8defcc), [`341a283`](https://github.com/GuardBee/guardbee-mcp/commit/341a2839d56a312f1cb1998a523eb7ea985345db)]:
11
+ - @guardbee/mcp-telemetry@0.3.0
12
+ - @guardbee/guard-core@1.0.1
13
+
14
+ ## 1.0.0
15
+
16
+ ### Major Changes
17
+
18
+ - [#171](https://github.com/GuardBee/guardbee-mcp/pull/171) [`c3b71f8`](https://github.com/GuardBee/guardbee-mcp/commit/c3b71f8e1305cbabe0fa733b13f6eb9a95d08513) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - 1.0: no API change, a stability promise. From this release the package follows semantic versioning: a breaking change to its CLI, MCP tool names and parameters, config format or exported API comes only with a new major version and is listed here. New rules and detectors arrive in minor versions and can report findings an earlier version did not.
19
+
20
+ ### Minor Changes
21
+
22
+ - [#172](https://github.com/GuardBee/guardbee-mcp/pull/172) [`9ae575f`](https://github.com/GuardBee/guardbee-mcp/commit/9ae575f89aa40b13463460504f12b70011c14947) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - `security-suite` now covers every GuardBee scanner and auditor (29 packages, 124 MCP tools). `guardbee serve` serves the recommended group by default (owasp-scan, secret-scanner, prompt-injection-scanner, toxic-flow-auditor, mcp-config-auditor, dependency-auditor: 31 tools); `--tools=` (or `GUARDBEE_SUITE_TOOLS`) takes groups (`code`, `supply-chain`, `network`, `platform`, `all`) and package ids. Tool names carry their package's prefix (`secrets_scan_text`, `injection_scan_text`) so packages do not collide. `guardbee <package-id> <args>` runs any package's CLI and `guardbee list` lists them; the old `secret-scan`, `dep-audit`, `ssl-inspect` and `dns-check` shortcuts still work. With no arguments and no terminal on stdin (an MCP client starting it), the suite now serves instead of printing help, and its MCP Registry entry passes `serve`.
23
+
24
+ **Breaking for `guardbee serve` users:** the five plain tool names (`scan_directory`, `scan_file`, `audit_dependencies`, `inspect_ssl`, `check_dns`) are now prefixed package tools; see "Upgrading from 0.2" in the README.
25
+
26
+ Every scanner and auditor package exports `registerTools(server)`, which registers its MCP tools on a given `McpServer`; `startServer()` uses it.
27
+
28
+ ### Patch Changes
29
+
30
+ - [#170](https://github.com/GuardBee/guardbee-mcp/pull/170) [`c71f728`](https://github.com/GuardBee/guardbee-mcp/commit/c71f7284c88f36435d0b2f951d5f167781f89395) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - Package hygiene: every package now ships its LICENSE and CHANGELOG.md, and has a homepage (its guardbee.ai page), a bugs link, `engines.node` and the `guardbee`, `mcp` and `security` keywords. READMEs gain npm badges and a feedback section pointing to GitHub Discussions; the owasp-scan README documents every mode, option, MCP tool and the OWASP coverage.
31
+
32
+ **Telemetry is now opt-in.** Nothing is sent unless `GUARDBEE_TELEMETRY=1` (or `true`/`on`/`yes`) is set; `GUARDBEE_TELEMETRY=0` is no longer needed. When it is on, the one-time stderr notice says what is sent and to which endpoint.
33
+ - Updated dependencies [[`c71f728`](https://github.com/GuardBee/guardbee-mcp/commit/c71f7284c88f36435d0b2f951d5f167781f89395), [`c3b71f8`](https://github.com/GuardBee/guardbee-mcp/commit/c3b71f8e1305cbabe0fa733b13f6eb9a95d08513)]:
34
+ - @guardbee/guard-core@1.0.0
35
+ - @guardbee/mcp-telemetry@0.2.0
36
+
37
+ ## 0.1.27
38
+
39
+ ### Patch Changes
40
+
41
+ - Updated dependencies [[`9599fb6`](https://github.com/GuardBee/guardbee-mcp/commit/9599fb64249dc38baba3fd4b2d1d7fb82dfd6de3)]:
42
+ - @guardbee/guard-core@0.22.0
43
+
44
+ ## 0.1.26
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [[`c1a16b9`](https://github.com/GuardBee/guardbee-mcp/commit/c1a16b9c9f588c4d3735fb45a1339b33119a8de0)]:
49
+ - @guardbee/guard-core@0.21.0
50
+
51
+ ## 0.1.25
52
+
53
+ ### Patch Changes
54
+
55
+ - Updated dependencies [[`e3355b2`](https://github.com/GuardBee/guardbee-mcp/commit/e3355b23654afcb2eb144da18e54fbfdb2817b16)]:
56
+ - @guardbee/guard-core@0.20.0
57
+
58
+ ## 0.1.24
59
+
60
+ ### Patch Changes
61
+
62
+ - Updated dependencies [[`5e6d872`](https://github.com/GuardBee/guardbee-mcp/commit/5e6d872cd6b9014da63743bc2198a0eb159c3b49)]:
63
+ - @guardbee/guard-core@0.19.0
64
+
65
+ ## 0.1.23
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [[`d4b24f4`](https://github.com/GuardBee/guardbee-mcp/commit/d4b24f4234e565f4660b3a356140516119ad4548)]:
70
+ - @guardbee/guard-core@0.18.0
71
+
72
+ ## 0.1.22
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies [[`0e96d18`](https://github.com/GuardBee/guardbee-mcp/commit/0e96d18c6d96a505a5cf5774af2a29d323d066e1)]:
77
+ - @guardbee/guard-core@0.17.0
78
+
79
+ ## 0.1.21
80
+
81
+ ### Patch Changes
82
+
83
+ - Updated dependencies [[`a489a7e`](https://github.com/GuardBee/guardbee-mcp/commit/a489a7e06e4dc8dfd208572efbb46e81e0bc3c69)]:
84
+ - @guardbee/guard-core@0.16.0
85
+
86
+ ## 0.1.20
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [[`945ed3c`](https://github.com/GuardBee/guardbee-mcp/commit/945ed3c817660b0cf479c2ce1777c1a4cc4ea5c1), [`b3ea8b8`](https://github.com/GuardBee/guardbee-mcp/commit/b3ea8b8cac409b80d9d8fdab5527871509c45232)]:
91
+ - @guardbee/guard-core@0.15.0
92
+
93
+ ## 0.1.19
94
+
95
+ ### Patch Changes
96
+
97
+ - Updated dependencies [[`08cc29e`](https://github.com/GuardBee/guardbee-mcp/commit/08cc29e4ca69af9aaf2bcbbde9f31824c9ada5c7)]:
98
+ - @guardbee/guard-core@0.14.0
99
+
100
+ ## 0.1.18
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [[`13c4c8f`](https://github.com/GuardBee/guardbee-mcp/commit/13c4c8f7afb29c7c373f83b1f64ae518edc08a46)]:
105
+ - @guardbee/guard-core@0.13.0
106
+
107
+ ## 0.1.17
108
+
109
+ ### Patch Changes
110
+
111
+ - [#75](https://github.com/GuardBee/guardbee-mcp/pull/75) [`f3b785f`](https://github.com/GuardBee/guardbee-mcp/commit/f3b785fe9454f80720ec36468fee9f5b2e9a70ed) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - docs: add Chinese (ZH) README translation and short summaries in Japanese, Korean, Brazilian Portuguese, Spanish and German (JA.md, KO.md, PT-BR.md, ES.md, DE.md), with an eight-language switcher
112
+ - Updated dependencies [[`f3b785f`](https://github.com/GuardBee/guardbee-mcp/commit/f3b785fe9454f80720ec36468fee9f5b2e9a70ed)]:
113
+ - @guardbee/guard-core@0.12.1
114
+ - @guardbee/mcp-telemetry@0.1.4
115
+
116
+ ## 0.1.16
117
+
118
+ ### Patch Changes
119
+
120
+ - Updated dependencies [[`a1435e0`](https://github.com/GuardBee/guardbee-mcp/commit/a1435e0710466ba1d2c978dca7bfaca3923ee1a7)]:
121
+ - @guardbee/guard-core@0.12.0
122
+
123
+ ## 0.1.15
124
+
125
+ ### Patch Changes
126
+
127
+ - Updated dependencies [[`64aeffa`](https://github.com/GuardBee/guardbee-mcp/commit/64aeffa43ce641738a9858818aa59d88154bf25a)]:
128
+ - @guardbee/guard-core@0.11.0
129
+
130
+ ## 0.1.14
131
+
132
+ ### Patch Changes
133
+
134
+ - Updated dependencies [[`20bbdc4`](https://github.com/GuardBee/guardbee-mcp/commit/20bbdc49affdebbbfce869d85176ab3b38aa23ce)]:
135
+ - @guardbee/guard-core@0.10.0
136
+
137
+ ## 0.1.13
138
+
139
+ ### Patch Changes
140
+
141
+ - Updated dependencies [[`659b893`](https://github.com/GuardBee/guardbee-mcp/commit/659b893a82c92f6c579ea50de50b942448c23bea)]:
142
+ - @guardbee/guard-core@0.9.0
143
+
144
+ ## 0.1.12
145
+
146
+ ### Patch Changes
147
+
148
+ - Updated dependencies [[`34ead6f`](https://github.com/GuardBee/guardbee-mcp/commit/34ead6fb45d6b093c441b28c83d73107ff20d0a3)]:
149
+ - @guardbee/guard-core@0.8.0
150
+
151
+ ## 0.1.11
152
+
153
+ ### Patch Changes
154
+
155
+ - Updated dependencies [[`aa299d3`](https://github.com/GuardBee/guardbee-mcp/commit/aa299d3d3343bfbf48bc36b78036d7d7cb1565ed)]:
156
+ - @guardbee/guard-core@0.7.0
157
+
158
+ ## 0.1.10
159
+
160
+ ### Patch Changes
161
+
162
+ - Updated dependencies [[`b8dee60`](https://github.com/GuardBee/guardbee-mcp/commit/b8dee60a6092f16ba1442cafafa60fa842cffd42)]:
163
+ - @guardbee/guard-core@0.6.0
164
+
165
+ ## 0.1.9
166
+
167
+ ### Patch Changes
168
+
169
+ - [#42](https://github.com/GuardBee/guardbee-mcp/pull/42) [`033dbda`](https://github.com/GuardBee/guardbee-mcp/commit/033dbda55671b1589fcd2afb0344314fa420ff00) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - MCP Registry name moves to `io.github.GuardBee/<server>` (`mcpName`), so the Release workflow can publish it to the registry with GitHub OIDC on every release. Earlier versions stay listed under `io.github.4hmetuyar/<server>`.
170
+
171
+ ## 0.1.8
172
+
173
+ ### Patch Changes
174
+
175
+ - Updated dependencies [[`b1de97f`](https://github.com/GuardBee/guardbee-mcp/commit/b1de97f5cbeaf1951798970a56917b8378b45848)]:
176
+ - @guardbee/guard-core@0.5.0
177
+
178
+ ## 0.1.7
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [[`75f4bad`](https://github.com/GuardBee/guardbee-mcp/commit/75f4baddd164e252be4f8004e2ec8e0054cbd218)]:
183
+ - @guardbee/guard-core@0.4.0
184
+
185
+ ## 0.1.6
186
+
187
+ ### Patch Changes
188
+
189
+ - Updated dependencies [[`0b02da8`](https://github.com/GuardBee/guardbee-mcp/commit/0b02da8ed7338c4f7dd1939d4e5be4ecd5f63a35)]:
190
+ - @guardbee/guard-core@0.3.0
191
+
192
+ ## 0.1.5
193
+
194
+ ### Patch Changes
195
+
196
+ - Docs: add a Simplified Chinese README (`ZH.md`) and link it from the English and Turkish ones. Correct stale counts (secret-scanner: 38 patterns and 39 tests; prompt-injection-scanner: 45 tests) and add a Turkish README for guard-core. No code changes.
197
+ - Updated dependencies [`243991e`]:
198
+ - @guardbee/guard-core@0.2.1
199
+
200
+ ## 0.1.4
201
+
202
+ ### Patch Changes
203
+
204
+ - Updated dependencies [`15fb399`]:
205
+ - @guardbee/guard-core@0.2.0
206
+
207
+ ## 0.1.3
208
+
209
+ ### Patch Changes
210
+
211
+ - Move shared detectors into the new `@guardbee/guard-core` library.
212
+
213
+ security-proxy now validates PII matches before masking them: a TC Kimlik No must pass the official checksum, an IBAN must pass mod-97, and a card number must pass Luhn. Order numbers and other 11- or 16-digit values are no longer masked by mistake.
214
+
215
+ toxic-flow-auditor and prompt-leak-scanner now import tool classification and checksum validators from guard-core. prompt-leak-scanner behaves as before; for toxic-flow-auditor see the snake_case classification fix.
216
+
217
+ ## 0.1.1
218
+
219
+ ### Patch Changes
220
+
221
+ - [#4](https://github.com/GuardBee/guardbee-mcp/pull/4) [`72a8129`](https://github.com/GuardBee/guardbee-mcp/commit/72a81293820c7d41047bca38ccc25ed6fa676297) Thanks [@4hmetuyar](https://github.com/4hmetuyar)! - Fix MCP contracts that disagreed with the implementation: dependency-auditor no longer claims Cargo manifest scanning and parses npm lockfile names, PEP 621 pyproject files, and CVSS vectors; rug-pull `--no-auto-baseline` does not report a baseline it did not save; the security proxy honors warn mode and `PROXY_*` settings; scanners reject a non-positive `maxFiles` and document exclude entries as path substrings. `@guardbee/mcp-telemetry` now has a CommonJS export so the CommonJS `db-gateway` and `security-proxy` binaries can load it.
222
+ - Updated dependencies [[`72a8129`](https://github.com/GuardBee/guardbee-mcp/commit/72a81293820c7d41047bca38ccc25ed6fa676297)]:
223
+ - @guardbee/mcp-telemetry@0.1.3
package/README.md CHANGED
@@ -1,12 +1,16 @@
1
1
  # @guardbee/mcp-prompt-leak-scanner
2
2
 
3
- **🇬🇧 English** | [🇹🇷 Türkçe](TR.md) | [🇨🇳 中文](ZH.md) | [🇯🇵 日本語](JA.md) | [🇰🇷 한국어](KO.md) | [🇧🇷 Português](PT-BR.md) | [🇪🇸 Español](ES.md) | [🇩🇪 Deutsch](DE.md)
3
+ **🇬🇧 English** | [🇹🇷 Türkçe](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/TR.md) | [🇨🇳 中文](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/ZH.md) | [🇯🇵 日本語](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/JA.md) | [🇰🇷 한국어](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/KO.md) | [🇧🇷 Português](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/PT-BR.md) | [🇪🇸 Español](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/ES.md) | [🇩🇪 Deutsch](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/DE.md)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@guardbee/mcp-prompt-leak-scanner.svg)](https://www.npmjs.com/package/@guardbee/mcp-prompt-leak-scanner)
6
+ [![npm downloads](https://img.shields.io/npm/dm/@guardbee/mcp-prompt-leak-scanner.svg)](https://www.npmjs.com/package/@guardbee/mcp-prompt-leak-scanner)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/prompt-leak-scanner/LICENSE)
4
8
 
5
9
  An MCP (Model Context Protocol) server — and a standalone reverse proxy — that catches leaked credentials and PII in **outbound** LLM prompts, before they leave your application.
6
10
 
7
11
  `secret-scanner` finds secrets sitting in your codebase. This package finds secrets and PII that made it into a *runtime prompt* — a support agent that pastes a customer's ticket (email, card number) straight into a system prompt, a debugging session where someone pastes an API key into a chat, an internal tool that forwards raw user input to an LLM without ever checking what's in it. That's a different moment in the pipeline, and a different failure mode than a leaked `.env` file.
8
12
 
9
- > This package sends usage telemetry by default (tool name + short parameters, prompt content and audit findings are never included — see [`@guardbee/mcp-telemetry`](../telemetry/README.md)). Disable with `GUARDBEE_TELEMETRY=0`.
13
+ > Telemetry is **off** by default. With `GUARDBEE_TELEMETRY=1` it sends the server, tool, success, duration and short parameter values such as a file path; longer strings and fields like `content`, `token` or `password` are replaced with a placeholder. See [`@guardbee/mcp-telemetry`](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/telemetry/README.md).
10
14
 
11
15
  ```
12
16
  Your app ──► prompt-leak-scanner (proxy) ──► Real LLM API (OpenAI/Anthropic/...)
@@ -39,7 +43,7 @@ A bare regex for "11 digits" or "16 digits" would flag order numbers, phone exte
39
43
  - **Credit card numbers** — Luhn checksum
40
44
  - **IBAN** — ISO 7064 MOD97-10 checksum
41
45
 
42
- A random 11-digit number has roughly a 1-in-10 chance of passing the TC Kimlik checksum by coincidence — regex alone would be far noisier. Credential patterns (API keys, JWTs, private keys) are matched against real provider-specific prefixes/structure (`sk-`, `AKIA`, `ghp_`, `-----BEGIN...PRIVATE KEY-----`, JWT's three-segment base64url shape), the same low-false-positive approach `secret-scanner` uses. The checksum validators come from [`@guardbee/guard-core`](../guard-core/README.md), shared with `@guardbee/mcp-security-proxy`.
46
+ A random 11-digit number has roughly a 1-in-10 chance of passing the TC Kimlik checksum by coincidence — regex alone would be far noisier. Credential patterns (API keys, JWTs, private keys) are matched against real provider-specific prefixes/structure (`sk-`, `AKIA`, `ghp_`, `-----BEGIN...PRIVATE KEY-----`, JWT's three-segment base64url shape), the same low-false-positive approach `secret-scanner` uses. The checksum validators come from [`@guardbee/guard-core`](https://github.com/GuardBee/guardbee-mcp/blob/main/packages/guard-core/README.md), shared with `@guardbee/mcp-security-proxy`.
43
47
 
44
48
  **Findings never echo the real value.** A finding's `maskedMatch` shows only the first 3 and last 2 characters (`sk-…wx`) — logging or displaying the very thing you just caught would defeat the point. The proxy's audit events go further: they record which pattern fired and where, never the matched text itself.
45
49
 
@@ -144,3 +148,7 @@ npm test # 29 unit tests
144
148
  ## License
145
149
 
146
150
  MIT — [GuardBee](https://guardbee.ai)
151
+
152
+ ## Feedback
153
+
154
+ Questions, ideas, or a false positive? Start a thread in [GitHub Discussions](https://github.com/GuardBee/guardbee-mcp/discussions) or [open an issue](https://github.com/GuardBee/guardbee-mcp/issues). If GuardBee is useful to you, a ⭐ on [the repository](https://github.com/GuardBee/guardbee-mcp) helps others find it.
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export { LEAK_PATTERNS } from "./patterns.js";
4
4
  export type { LeakPattern, LeakCategory } from "./patterns.js";
5
5
  export { startProxy } from "./proxy.js";
6
6
  export type { ProxyOptions, ProxyMode, AuditEvent } from "./proxy.js";
7
+ export { registerTools } from "./server.js";
7
8
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { scanText, scanAndRedactText, scanBody, redactBody, scanFile, scanDirectory } from "./scanner.js";
2
2
  export { LEAK_PATTERNS } from "./patterns.js";
3
3
  export { startProxy } from "./proxy.js";
4
+ export { registerTools } from "./server.js";
4
5
  //# sourceMappingURL=index.js.map
package/dist/server.d.ts CHANGED
@@ -1,2 +1,5 @@
1
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
2
  export declare function startServer(): Promise<void>;
3
+ /** This package's MCP tools on `server`; @guardbee/security-suite serves several packages' tools from one process this way. */
4
+ export declare function registerTools(server: McpServer): void;
2
5
  //# sourceMappingURL=server.d.ts.map
package/dist/server.js CHANGED
@@ -31,21 +31,36 @@ export async function startServer() {
31
31
  version: "0.1.0",
32
32
  });
33
33
  instrumentServer(server, "prompt-leak-scanner");
34
- server.tool("scan_text", "Scan a raw text string (e.g. a prompt you're about to send to an LLM) for leaked credentials (API keys, private keys, JWTs) and PII (TC Kimlik No, credit card, IBAN, email, phone) — checksum-validated where applicable to keep false positives low.", {
35
- content: z.string().describe("The text to scan"),
36
- label: z.string().optional().describe("Optional label shown in findings"),
34
+ registerTools(server);
35
+ const transport = new StdioServerTransport();
36
+ await server.connect(transport);
37
+ }
38
+ /** This package's MCP tools on `server`; @guardbee/security-suite serves several packages' tools from one process this way. */
39
+ export function registerTools(server) {
40
+ server.registerTool("scan_text", {
41
+ description: "Scan a raw text string (e.g. a prompt you're about to send to an LLM) for leaked credentials (API keys, private keys, JWTs) and PII (TC Kimlik No, credit card, IBAN, email, phone) — checksum-validated where applicable to keep false positives low.",
42
+ inputSchema: {
43
+ content: z.string().describe("The text to scan"),
44
+ label: z.string().optional().describe("Optional label shown in findings"),
45
+ },
37
46
  }, async ({ content, label }) => {
38
47
  const findings = scanText(content, label);
39
48
  return { content: [{ type: "text", text: formatFindings(findings, 1, 0) }] };
40
49
  });
41
- server.tool("scan_messages", "Scan an OpenAI/Anthropic-style chat request body (a JSON object with a `messages` array and/or a `system` field) for leaked credentials and PII in every message's text content, before it would be sent to the model.", {
42
- body: z.record(z.string(), z.unknown()).describe("The chat request body object, e.g. { model, system, messages: [{ role, content }] }"),
50
+ server.registerTool("scan_messages", {
51
+ description: "Scan an OpenAI/Anthropic-style chat request body (a JSON object with a `messages` array and/or a `system` field) for leaked credentials and PII in every message's text content, before it would be sent to the model.",
52
+ inputSchema: {
53
+ body: z.record(z.string(), z.unknown()).describe("The chat request body object, e.g. { model, system, messages: [{ role, content }] }"),
54
+ },
43
55
  }, async ({ body }) => {
44
56
  const { findings } = scanBody(body);
45
57
  return { content: [{ type: "text", text: formatFindings(findings, 1, 0) }] };
46
58
  });
47
- server.tool("scan_file", "Scan a single file — plain text, or a JSON chat-request-body fixture (auto-detected) — for leaked credentials and PII", {
48
- path: z.string().describe("Absolute or relative path to the file to scan"),
59
+ server.registerTool("scan_file", {
60
+ description: "Scan a single file — plain text, or a JSON chat-request-body fixture (auto-detected) — for leaked credentials and PII",
61
+ inputSchema: {
62
+ path: z.string().describe("Absolute or relative path to the file to scan"),
63
+ },
49
64
  }, async ({ path: filePath }) => {
50
65
  const { findings, skipped } = scanFile(filePath);
51
66
  if (skipped) {
@@ -53,16 +68,22 @@ export async function startServer() {
53
68
  }
54
69
  return { content: [{ type: "text", text: formatFindings(findings, 1, 0) }] };
55
70
  });
56
- server.tool("scan_directory", "Recursively scan a directory of prompt logs or request-body fixtures for leaked credentials and PII", {
57
- path: z.string().describe("Absolute or relative path to the directory to scan"),
58
- maxFiles: z.number().int().positive().optional().describe("Maximum number of files to scan (default: 5000)"),
59
- include: z.array(z.string()).optional().describe("Only scan files whose path contains one of these strings"),
60
- exclude: z.array(z.string()).optional().describe("Skip files/dirs whose path contains one of these strings"),
71
+ server.registerTool("scan_directory", {
72
+ description: "Recursively scan a directory of prompt logs or request-body fixtures for leaked credentials and PII",
73
+ inputSchema: {
74
+ path: z.string().describe("Absolute or relative path to the directory to scan"),
75
+ maxFiles: z.number().int().positive().optional().describe("Maximum number of files to scan (default: 5000)"),
76
+ include: z.array(z.string()).optional().describe("Only scan files whose path contains one of these strings"),
77
+ exclude: z.array(z.string()).optional().describe("Skip files/dirs whose path contains one of these strings"),
78
+ },
61
79
  }, async ({ path: dirPath, maxFiles, include, exclude }) => {
62
80
  const result = scanDirectory(dirPath, { maxFiles, include, exclude });
63
81
  return { content: [{ type: "text", text: formatFindings(result.findings, result.scannedFiles, result.durationMs) }] };
64
82
  });
65
- server.tool("list_patterns", "List every credential/PII pattern this scanner detects, grouped by category", {}, async () => {
83
+ server.registerTool("list_patterns", {
84
+ description: "List every credential/PII pattern this scanner detects, grouped by category",
85
+ inputSchema: {},
86
+ }, async () => {
66
87
  const lines = ["Detected patterns:\n"];
67
88
  const byCategory = new Map();
68
89
  for (const p of LEAK_PATTERNS) {
@@ -79,7 +100,5 @@ export async function startServer() {
79
100
  lines.push("Use the `proxy` CLI command to run this as a live reverse proxy in front of a real LLM API (monitor/redact/block modes).");
80
101
  return { content: [{ type: "text", text: lines.join("\n") }] };
81
102
  });
82
- const transport = new StdioServerTransport();
83
- await server.connect(transport);
84
103
  }
85
104
  //# sourceMappingURL=server.js.map
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@guardbee/mcp-prompt-leak-scanner",
3
- "version": "0.1.27",
3
+ "version": "1.0.1",
4
4
  "mcpName": "io.github.GuardBee/prompt-leak-scanner",
5
- "description": "MCP server and reverse proxy that catches leaked credentials and PII (API keys, TC Kimlik No, credit cards, IBANs) in outbound LLM prompts before they leave your application",
5
+ "description": "PII and secret leak scanner for LLM prompts: catches API keys, TC Kimlik No, cards and IBANs in outbound prompts before they leave your app; MCP server and reverse proxy",
6
6
  "type": "module",
7
7
  "bin": {
8
8
  "guardbee-prompt-leak-scanner": "./dist/cli.js"
@@ -18,19 +18,16 @@
18
18
  "files": [
19
19
  "dist",
20
20
  "README.md",
21
- "TR.md",
22
- "ZH.md",
23
- "JA.md",
24
- "KO.md",
25
- "PT-BR.md",
26
- "ES.md",
27
- "DE.md"
21
+ "LICENSE",
22
+ "CHANGELOG.md",
23
+ "!dist/**/*.map",
24
+ "!dist/**/__tests__"
28
25
  ],
29
26
  "dependencies": {
30
- "@modelcontextprotocol/sdk": "^1.0.0",
31
- "zod": "^4.5.4",
32
- "@guardbee/guard-core": "^0.22.0",
33
- "@guardbee/mcp-telemetry": "^0.1.4"
27
+ "@modelcontextprotocol/sdk": "^1.32.1",
28
+ "zod": "^4.6.7",
29
+ "@guardbee/guard-core": "^1.0.1",
30
+ "@guardbee/mcp-telemetry": "^0.3.0"
34
31
  },
35
32
  "keywords": [
36
33
  "mcp",
@@ -41,7 +38,11 @@
41
38
  "kvkk",
42
39
  "gdpr",
43
40
  "guardbee",
44
- "devtools"
41
+ "devtools",
42
+ "pii",
43
+ "dlp",
44
+ "secret-scanner",
45
+ "guardrails"
45
46
  ],
46
47
  "license": "MIT",
47
48
  "repository": {
@@ -49,6 +50,13 @@
49
50
  "url": "https://github.com/GuardBee/guardbee-mcp.git",
50
51
  "directory": "packages/prompt-leak-scanner"
51
52
  },
53
+ "homepage": "https://guardbee.ai/en/what-is-mcp-prompt-leak-scanner/",
54
+ "bugs": {
55
+ "url": "https://github.com/GuardBee/guardbee-mcp/issues"
56
+ },
57
+ "engines": {
58
+ "node": ">=18"
59
+ },
52
60
  "scripts": {
53
61
  "build": "tsc",
54
62
  "dev": "tsc --watch",
package/DE.md DELETED
@@ -1,47 +0,0 @@
1
- # @guardbee/mcp-prompt-leak-scanner
2
-
3
- [🇬🇧 English](README.md) | [🇹🇷 Türkçe](TR.md) | [🇨🇳 中文](ZH.md) | [🇯🇵 日本語](JA.md) | [🇰🇷 한국어](KO.md) | [🇧🇷 Português](PT-BR.md) | [🇪🇸 Español](ES.md) | **🇩🇪 Deutsch**
4
-
5
- > Dies ist eine kurze Zusammenfassung. Die vollständige Dokumentation (Englisch) steht in [README.md](README.md).
6
-
7
- MCP-Server und Reverse Proxy, der Zugangsdaten und personenbezogene Daten (API-Keys, TC-Kimlik-Nr., Kreditkarten, IBANs) in ausgehenden LLM-Prompts abfängt, bevor sie Ihre Anwendung verlassen.
8
-
9
- ## Installation
10
-
11
- ```bash
12
- npx -y @guardbee/mcp-prompt-leak-scanner
13
- ```
14
-
15
- Claude Desktop:
16
-
17
- ```json
18
- {
19
- "mcpServers": {
20
- "prompt-leak-scanner": {
21
- "command": "npx",
22
- "args": [
23
- "-y",
24
- "@guardbee/mcp-prompt-leak-scanner"
25
- ]
26
- }
27
- }
28
- }
29
- ```
30
-
31
- ## MCP-Tools
32
-
33
- `scan_text`, `scan_messages`, `scan_file`, `scan_directory`, `list_patterns`
34
-
35
- Details zu jedem Tool stehen in [README.md](README.md).
36
-
37
- ## CLI
38
-
39
- ```bash
40
- npx @guardbee/mcp-prompt-leak-scanner --help
41
- ```
42
-
43
- > Dieses Paket sendet standardmäßig anonyme Nutzungstelemetrie (nur Tool-Name und kurze Parameter). Abschalten mit `GUARDBEE_TELEMETRY=0`.
44
-
45
- ## Lizenz
46
-
47
- MIT — [GuardBee](https://guardbee.ai)
package/ES.md DELETED
@@ -1,47 +0,0 @@
1
- # @guardbee/mcp-prompt-leak-scanner
2
-
3
- [🇬🇧 English](README.md) | [🇹🇷 Türkçe](TR.md) | [🇨🇳 中文](ZH.md) | [🇯🇵 日本語](JA.md) | [🇰🇷 한국어](KO.md) | [🇧🇷 Português](PT-BR.md) | **🇪🇸 Español** | [🇩🇪 Deutsch](DE.md)
4
-
5
- > Este es un resumen breve. La documentación completa (en inglés) está en [README.md](README.md).
6
-
7
- Servidor MCP y proxy inverso que detecta credenciales y datos personales (claves de API, TC Kimlik No, tarjetas de crédito, IBAN) en los prompts que van a un LLM antes de que salgan de tu aplicación.
8
-
9
- ## Instalación
10
-
11
- ```bash
12
- npx -y @guardbee/mcp-prompt-leak-scanner
13
- ```
14
-
15
- Claude Desktop:
16
-
17
- ```json
18
- {
19
- "mcpServers": {
20
- "prompt-leak-scanner": {
21
- "command": "npx",
22
- "args": [
23
- "-y",
24
- "@guardbee/mcp-prompt-leak-scanner"
25
- ]
26
- }
27
- }
28
- }
29
- ```
30
-
31
- ## Herramientas MCP
32
-
33
- `scan_text`, `scan_messages`, `scan_file`, `scan_directory`, `list_patterns`
34
-
35
- Los detalles de cada herramienta están en [README.md](README.md).
36
-
37
- ## CLI
38
-
39
- ```bash
40
- npx @guardbee/mcp-prompt-leak-scanner --help
41
- ```
42
-
43
- > Este paquete envía telemetría de uso anónima por defecto (solo el nombre de la herramienta y parámetros cortos). Desactívala con `GUARDBEE_TELEMETRY=0`.
44
-
45
- ## Licencia
46
-
47
- MIT — [GuardBee](https://guardbee.ai)
package/JA.md DELETED
@@ -1,47 +0,0 @@
1
- # @guardbee/mcp-prompt-leak-scanner
2
-
3
- [🇬🇧 English](README.md) | [🇹🇷 Türkçe](TR.md) | [🇨🇳 中文](ZH.md) | **🇯🇵 日本語** | [🇰🇷 한국어](KO.md) | [🇧🇷 Português](PT-BR.md) | [🇪🇸 Español](ES.md) | [🇩🇪 Deutsch](DE.md)
4
-
5
- > これは短い概要です。完全なドキュメント(英語)は [README.md](README.md) をご覧ください。
6
-
7
- MCP サーバー兼リバースプロキシとして、LLM へ送られるプロンプトに含まれる認証情報や個人情報(API キー、TC Kimlik No、クレジットカード、IBAN)を、アプリケーションの外に出る前に捕捉します。
8
-
9
- ## インストール
10
-
11
- ```bash
12
- npx -y @guardbee/mcp-prompt-leak-scanner
13
- ```
14
-
15
- Claude Desktop:
16
-
17
- ```json
18
- {
19
- "mcpServers": {
20
- "prompt-leak-scanner": {
21
- "command": "npx",
22
- "args": [
23
- "-y",
24
- "@guardbee/mcp-prompt-leak-scanner"
25
- ]
26
- }
27
- }
28
- }
29
- ```
30
-
31
- ## MCP ツール
32
-
33
- `scan_text`, `scan_messages`, `scan_file`, `scan_directory`, `list_patterns`
34
-
35
- 各ツールの詳細は [README.md](README.md) を参照してください。
36
-
37
- ## CLI
38
-
39
- ```bash
40
- npx @guardbee/mcp-prompt-leak-scanner --help
41
- ```
42
-
43
- > このパッケージは既定で匿名の利用テレメトリ(ツール名と短いパラメータのみ)を送信します。`GUARDBEE_TELEMETRY=0` で無効にできます。
44
-
45
- ## ライセンス
46
-
47
- MIT — [GuardBee](https://guardbee.ai)
package/KO.md DELETED
@@ -1,47 +0,0 @@
1
- # @guardbee/mcp-prompt-leak-scanner
2
-
3
- [🇬🇧 English](README.md) | [🇹🇷 Türkçe](TR.md) | [🇨🇳 中文](ZH.md) | [🇯🇵 日本語](JA.md) | **🇰🇷 한국어** | [🇧🇷 Português](PT-BR.md) | [🇪🇸 Español](ES.md) | [🇩🇪 Deutsch](DE.md)
4
-
5
- > 이 문서는 짧은 요약입니다. 전체 문서(영어)는 [README.md](README.md)를 참고하세요.
6
-
7
- MCP 서버이자 리버스 프록시로서, LLM으로 나가는 프롬프트 속 자격 증명과 개인정보(API 키, TC Kimlik No, 신용카드, IBAN)를 애플리케이션을 떠나기 전에 잡아냅니다.
8
-
9
- ## 설치
10
-
11
- ```bash
12
- npx -y @guardbee/mcp-prompt-leak-scanner
13
- ```
14
-
15
- Claude Desktop:
16
-
17
- ```json
18
- {
19
- "mcpServers": {
20
- "prompt-leak-scanner": {
21
- "command": "npx",
22
- "args": [
23
- "-y",
24
- "@guardbee/mcp-prompt-leak-scanner"
25
- ]
26
- }
27
- }
28
- }
29
- ```
30
-
31
- ## MCP 도구
32
-
33
- `scan_text`, `scan_messages`, `scan_file`, `scan_directory`, `list_patterns`
34
-
35
- 각 도구의 자세한 설명은 [README.md](README.md)에 있습니다.
36
-
37
- ## CLI
38
-
39
- ```bash
40
- npx @guardbee/mcp-prompt-leak-scanner --help
41
- ```
42
-
43
- > 이 패키지는 기본적으로 익명 사용 원격 측정(도구 이름과 짧은 매개변수만)을 전송합니다. `GUARDBEE_TELEMETRY=0`으로 끌 수 있습니다.
44
-
45
- ## 라이선스
46
-
47
- MIT — [GuardBee](https://guardbee.ai)