@sandrobuilds/tracerney 0.9.30 → 0.9.31

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.
Files changed (2) hide show
  1. package/README.md +18 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -73,6 +73,24 @@ if (result.suspicious) {
73
73
  - Local processing only
74
74
  - Detects: instruction overrides, role-play jailbreaks, context confusion, code execution risks, data extraction attempts, and more
75
75
 
76
+ Layer 1 also runs a deterministic egress and PII scan on every prompt **before** the injection patterns fire. If a match is found, it returns `suspicious: true` with a `label` and `reason` — the SDK never decides the penalty, the developer does.
77
+
78
+ ```typescript
79
+ const result = await tracer.scanPrompt(input);
80
+
81
+ if (result.suspicious) {
82
+ console.log(result.label); // "SUSPICIOUS_EGRESS" | "SUSPICIOUS_SECRET" | "SUSPICIOUS_PII"
83
+ console.log(result.reason); // "Detected 1 finding(s): Markdown Image with URL Query Params"
84
+
85
+ // Your policy, your call:
86
+ if (result.label === 'SUSPICIOUS_EGRESS') {
87
+ return NextResponse.json({ error: 'Security violation' }, { status: 400 });
88
+ }
89
+ }
90
+ ```
91
+
92
+ Egress findings **never reach Layer 2** — they are binary and deterministic. A markdown image tag smuggling data in query params either exists or it doesn't. Layer 2 is reserved for probabilistic threats where a regex alone cannot make a confident call.
93
+
76
94
  **Layer 2:** LLM Sentinel (Pro - $9/month)
77
95
  - **AI-powered response verification** — LLM-based analysis for novel attack patterns
78
96
  - **Context-aware scanning** — understands your application's specific security policies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sandrobuilds/tracerney",
3
- "version": "0.9.30",
3
+ "version": "0.9.31",
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",