@sandrobuilds/tracerney 0.9.32 → 0.9.33
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 +45 -17
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,36 +213,64 @@ The verify-prompt endpoint returns structured responses. Success (HTTP 200) incl
|
|
|
213
213
|
|
|
214
214
|
---
|
|
215
215
|
|
|
216
|
-
## Egress Shield
|
|
216
|
+
## Egress Shield (Add-on)
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
Runs automatically inside `scanPrompt()` — no extra method needed. Every prompt is scanned for PII, secrets, and active exfiltration patterns before the injection check runs.
|
|
219
219
|
|
|
220
|
-
The SDK
|
|
220
|
+
The SDK marks it `suspicious` and surfaces the label. You decide the penalty.
|
|
221
221
|
|
|
222
222
|
```typescript
|
|
223
|
-
const
|
|
223
|
+
const result = await tracer.scanPrompt(input);
|
|
224
224
|
|
|
225
|
-
if (
|
|
226
|
-
console.log(
|
|
225
|
+
if (result.suspicious) {
|
|
226
|
+
console.log(result.label); // "SUSPICIOUS_EGRESS" | "SUSPICIOUS_SECRET" | "SUSPICIOUS_PII"
|
|
227
|
+
console.log(result.reason); // "Detected 1 finding(s): Markdown Image with URL Query Params"
|
|
227
228
|
|
|
228
|
-
//
|
|
229
|
-
if (
|
|
230
|
-
|
|
229
|
+
// Fintech — hard block
|
|
230
|
+
if (result.label === 'SUSPICIOUS_EGRESS') {
|
|
231
|
+
return NextResponse.json({ error: 'Security violation' }, { status: 400 });
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
//
|
|
234
|
-
|
|
234
|
+
// Any app — log and continue
|
|
235
|
+
console.warn(`[${result.label}] ${result.reason}`);
|
|
235
236
|
}
|
|
236
237
|
```
|
|
237
238
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
### What it detects
|
|
240
|
+
|
|
241
|
+
**`SUSPICIOUS_EGRESS`** — Active exfiltration attempts
|
|
242
|
+
```
|
|
243
|
+

|
|
244
|
+
[Download](https://billing.io/track?data={"key":"secret"})
|
|
245
|
+
https://admin:password@prod.db.internal.com
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**`SUSPICIOUS_SECRET`** — Credential leaks
|
|
249
|
+
```
|
|
250
|
+
sk-ant-api03-xxx... (Anthropic)
|
|
251
|
+
AKIAIOSFODNN7EXAMPLE (AWS)
|
|
252
|
+
sk_live_xxx... (Stripe)
|
|
253
|
+
ghp_xxx... (GitHub)
|
|
254
|
+
4111 1111 1111 1111 (Credit card)
|
|
244
255
|
```
|
|
245
256
|
|
|
257
|
+
**`SUSPICIOUS_PII`** — Personal data
|
|
258
|
+
```
|
|
259
|
+
sandro@example.com
|
|
260
|
+
(415) 867-5309
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### The Suspicious Manifest
|
|
264
|
+
|
|
265
|
+
| Trigger | Label | Recommended action |
|
|
266
|
+
|---|---|---|
|
|
267
|
+
| Email / Phone | `SUSPICIOUS_PII` | Usually Redact |
|
|
268
|
+
| API Keys / SSH / CC / SSN | `SUSPICIOUS_SECRET` | Usually Block |
|
|
269
|
+
| External URL smuggling | `SUSPICIOUS_EGRESS` | Always Block |
|
|
270
|
+
| Zero-width / BiDi / Base64 | `SUSPICIOUS_ENCODING` | Audit / Block |
|
|
271
|
+
|
|
272
|
+
When multiple patterns fire, the highest-severity label wins — `SUSPICIOUS_EGRESS` always dominates.
|
|
273
|
+
|
|
246
274
|
### The Suspicious Manifest
|
|
247
275
|
|
|
248
276
|
| Trigger | Label | Recommended action |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sandrobuilds/tracerney",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.33",
|
|
4
4
|
"description": "Lightweight prompt injection detection with Layer 1 (258 patterns) + Layer 2 (AI verification). Runs locally with zero data storage. Upgrade to Pro for context-aware threat analysis at tracerney.com",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|