@samimcodes/ai-shield 0.1.2 → 0.2.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 CHANGED
@@ -38,8 +38,10 @@ import { aiShield } from '@samimcodes/ai-shield';
38
38
 
39
39
  const app = express();
40
40
 
41
- // 🛡️ 3-Line Drop-in AI Defense
41
+ // 🛡️ 3-Line Drop-in AI Defense + Live Admin Security Dashboard
42
42
  app.use(aiShield({
43
+ enableDashboard: true, // 📊 Mounts Live Security Dashboard
44
+ dashboardPath: '/admin/ai-shield', // 👈 Visit in browser for live alerts!
43
45
  poisonContentType: 'HTML', // 'HTML' | 'JSON' | 'SITEMAP'
44
46
  injectHoneypotLinks: true, // Automatically injects invisible trap routes
45
47
  excludePaths: ['/health', '/metrics'], // Exclude DevOps endpoints
@@ -52,12 +54,23 @@ app.get('/api/products', (req, res) => {
52
54
  });
53
55
 
54
56
  app.listen(3000, () => {
55
- console.log('Server protected with ai-shield on port 3000');
57
+ console.log('Server protected on port 3000');
58
+ console.log('Live Security Dashboard: http://localhost:3000/admin/ai-shield');
56
59
  });
57
60
  ```
58
61
 
59
62
  ---
60
63
 
64
+ ## 📊 Built-in Live Security Dashboard & Real-Time Alerts
65
+
66
+ No external analytics or complex cloud setup required. Just set `enableDashboard: true`, and visit `/admin/ai-shield` on your running server to see:
67
+ - 🚨 **Real-Time Attack Alerts**: Instant pop-up banners and audio chimes whenever an AI crawler attempts to scrape your endpoints.
68
+ - ⚡ **Server-Sent Events (SSE)**: Live streaming table of intercepted bots without manual page refresh.
69
+ - 🧪 **One-Click Attack Simulator**: Test and verify your bot defense instantly right from the browser.
70
+ - 📈 **Key Security Metrics**: Bots intercepted, honeypot traps sprung, and fake tokens fed to scrapers.
71
+
72
+ ---
73
+
61
74
  ## 🎯 Next.js Edge Middleware
62
75
 
63
76
  ```typescript
@@ -107,6 +120,9 @@ export const config = {
107
120
 
108
121
  | Option | Type | Default | Description |
109
122
  | :--- | :--- | :--- | :--- |
123
+ | `enableDashboard` | `boolean` | `false` | Mounts built-in live real-time security dashboard with SSE |
124
+ | `dashboardPath` | `string` | `'/admin/ai-shield'` | Path prefix where the live security dashboard is served |
125
+ | `dashboardAuth` | `DashboardAuthConfig` | `undefined` | Optional credentials (token / Basic Auth) for dashboard |
110
126
  | `poisonContentType` | `'HTML' \| 'JSON' \| 'SITEMAP'` | `'HTML'` | Format of poisoned payload returned to AI bots |
111
127
  | `injectHoneypotLinks` | `boolean` | `true` | Automatically inject hidden CSS-invisible trap links |
112
128
  | `excludePaths` | `string[]` | `[]` | Array of path prefixes exempt from inspection |