@webdecoy/node 0.29.0 → 0.31.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/dist/index.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  resolveGateEnv,
12
12
  ruleBlockResponse,
13
13
  shouldSkipPath
14
- } from "./chunk-VPPTUL5K.mjs";
14
+ } from "./chunk-BBRVE4RC.mjs";
15
15
  import {
16
16
  ATTACK_SIGNATURE_IDS,
17
17
  AgentVerifier,
@@ -69,7 +69,7 @@ import {
69
69
  tripwire,
70
70
  upstashRateLimitStore,
71
71
  webBotAuth
72
- } from "./chunk-32TEUD5K.mjs";
72
+ } from "./chunk-IGSPJVI6.mjs";
73
73
 
74
74
  // src/client-signals.ts
75
75
  var MemoryClientSignalStore = class {
@@ -201,6 +201,56 @@ function clientSignals(config) {
201
201
  return new ClientSignalRule(config);
202
202
  }
203
203
 
204
+ // src/node-http-guard.ts
205
+ function createNodeHttpGuard(options = {}) {
206
+ const sdk = new WebDecoy(options);
207
+ const mode = options.mode ?? "monitor";
208
+ const protectOptions = {
209
+ threshold: options.threshold,
210
+ skipLocalAnalysis: options.skipLocalAnalysis,
211
+ metadata: options.metadata
212
+ };
213
+ return {
214
+ sdk,
215
+ async check(request) {
216
+ const target = (request.url ?? "/").replace(/^https?:\/\/[^/?#]+/i, "");
217
+ const queryStart = target.indexOf("?");
218
+ const path = (queryStart === -1 ? target : target.slice(0, queryStart)) || "/";
219
+ const query = queryStart === -1 ? void 0 : target.slice(queryStart + 1);
220
+ if (shouldSkipPath(path, options.skipPaths)) return void 0;
221
+ const headers = /* @__PURE__ */ Object.create(null);
222
+ for (const [name, value] of Object.entries(request.headers)) {
223
+ if (value !== void 0) headers[name] = Array.isArray(value) ? value.join(", ") : value;
224
+ }
225
+ const peer = request.socket.remoteAddress;
226
+ const metadata = {
227
+ method: request.method ?? "GET",
228
+ path,
229
+ query,
230
+ headers,
231
+ user_agent: headers["user-agent"],
232
+ ip: resolveClientIp({ headers, peer, trustProxy: options.trustProxy }) ?? normalizeIp(peer) ?? "127.0.0.1",
233
+ timestamp: Date.now()
234
+ };
235
+ const decision = await sdk.protect(metadata, protectOptions);
236
+ if (decision.allowed || mode !== "enforce") return { decision };
237
+ const block = ruleBlockResponse(decision) ?? {
238
+ status: 403,
239
+ headers: {},
240
+ body: { error: "Forbidden", message: "Access denied by WebDecoy protection" }
241
+ };
242
+ return {
243
+ decision,
244
+ response: {
245
+ status: block.status,
246
+ headers: { "content-type": "application/json", ...block.headers },
247
+ body: { ...block.body, detection_id: decision.id }
248
+ }
249
+ };
250
+ }
251
+ };
252
+ }
253
+
204
254
  // src/detection/weights.ts
205
255
  var DEFAULT_WEIGHTS = {
206
256
  vision_ai: 0.15,
@@ -368,7 +418,67 @@ var InMemoryRateLimiter = class {
368
418
  }
369
419
  };
370
420
 
421
+ // src/detection/detectors/cdp.ts
422
+ var HIGH_CONFIDENCE_SIGNALS = ["chromedriver_cdc", "puppeteer_eval", "cdp_script_injection"];
423
+ var CORROBORATING_DRIVER_SIGNALS = /* @__PURE__ */ new Set([
424
+ ...HIGH_CONFIDENCE_SIGNALS,
425
+ "selenium_evaluate",
426
+ "selenium_driver_evaluate",
427
+ "selenium_unwrapped",
428
+ "selenium_driver_unwrapped",
429
+ "selenium_direct",
430
+ "firefox_driver",
431
+ "firefox_driver_unwrapped"
432
+ ]);
433
+ function hasDriverInjection(signals) {
434
+ return signals.some((signal) => HIGH_CONFIDENCE_SIGNALS.includes(signal));
435
+ }
436
+ function detectCDP(signals, corroborating) {
437
+ const detections = [];
438
+ const cdp = signals.environmental?.cdp ?? {};
439
+ if (!cdp.detected) return detections;
440
+ const signalList = cdp.signals ?? [];
441
+ const signalCount = signalList.length;
442
+ if (hasDriverInjection(signalList)) {
443
+ detections.push({
444
+ category: "cdp",
445
+ score: 0.9,
446
+ confidence: 0.95,
447
+ reason: `CDP automation detected: ${signalList.join(", ")}`
448
+ });
449
+ } else if (signalCount >= 2) {
450
+ detections.push({
451
+ category: "cdp",
452
+ score: 0.8,
453
+ confidence: 0.85,
454
+ reason: `Multiple CDP indicators: ${signalList.join(", ")}`
455
+ });
456
+ } else if (signalCount === 1) {
457
+ detections.push({
458
+ category: "cdp",
459
+ score: 0.6,
460
+ confidence: 0.7,
461
+ reason: `CDP indicator: ${signalList.join(", ")}`
462
+ });
463
+ }
464
+ if (corroborating && signalList.every((signal) => CORROBORATING_DRIVER_SIGNALS.has(signal))) {
465
+ corroborating.push(...detections);
466
+ }
467
+ return detections;
468
+ }
469
+
371
470
  // src/detection/scoring.ts
471
+ function applyDecisiveScoreFloor(score, env, weights) {
472
+ const declaresWebDriver = (weights.headless ?? 0) > 0 && env?.webdriver === true && env.automationFlags?.webdriver === true;
473
+ const hasInjectedDriver = (weights.cdp ?? 0) > 0 && env?.cdp?.detected === true && hasDriverInjection(env.cdp.signals ?? []);
474
+ return declaresWebDriver || hasInjectedDriver ? Math.max(0.9, score) : score;
475
+ }
476
+ function applyCorroborationScoreFloor(score, detections, weights) {
477
+ if (score >= 0.6 || detections.length < 2) return score;
478
+ const support = calculateNoisyOrCategoryScores(detections, weights);
479
+ const agrees = (category) => (weights[category] ?? 0) > 0 && (support[category] ?? 0) >= 0.4 - 1e-9;
480
+ return agrees("cdp") && (agrees("vision_ai") || agrees("behavioral")) ? 0.6 : score;
481
+ }
372
482
  function calculateCategoryScores(detections, weights) {
373
483
  var _a;
374
484
  const categoryData = {};
@@ -390,6 +500,19 @@ function calculateCategoryScores(detections, weights) {
390
500
  }
391
501
  return result;
392
502
  }
503
+ function calculateNoisyOrCategoryScores(detections, weights) {
504
+ const remaining = /* @__PURE__ */ new Map();
505
+ for (const { category, score, confidence } of detections) {
506
+ if (!Number.isFinite(score) || !Number.isFinite(confidence) || score <= 0 || confidence <= 0) {
507
+ continue;
508
+ }
509
+ const evidence = Math.min(1, score * confidence);
510
+ remaining.set(category, (remaining.get(category) ?? 1) * (1 - evidence));
511
+ }
512
+ return Object.fromEntries(
513
+ Object.keys(weights).map((category) => [category, 1 - (remaining.get(category) ?? 1)])
514
+ );
515
+ }
393
516
  function calculateFinalScore(categoryScores, weights) {
394
517
  let total = 0;
395
518
  for (const [cat, weight] of Object.entries(weights)) {
@@ -403,6 +526,12 @@ function recommend(finalScore) {
403
526
  return "block";
404
527
  }
405
528
 
529
+ // src/detection/detectors/corroborating-detection.ts
530
+ function addCorroboratingDetection(detections, corroborating, detection) {
531
+ detections.push(detection);
532
+ corroborating?.push(detection);
533
+ }
534
+
406
535
  // src/detection/detectors/keyboard-input.ts
407
536
  var MIN_KEY_HOLD_SAMPLES = 3;
408
537
  var MAX_KEY_HOLD_SAMPLES = 200;
@@ -437,14 +566,14 @@ function isTouchModality(behavioral) {
437
566
  return touchEvents >= 3 || hasTouchSample && behavioral.pointerHasNonMouseType === true;
438
567
  }
439
568
  function hasHumanMovementMarkers(behavioral) {
440
- const tremor = behavioral.microTremorScore ?? 0;
569
+ const tremor = behavioral.microTremorScore ?? 0.5;
441
570
  const corrections = behavioral.overshootCorrections ?? 0;
442
571
  const changes = behavioral.directionChanges ?? 0;
443
572
  return tremor >= 0.5 && (corrections >= 1 || changes >= 10);
444
573
  }
445
574
 
446
575
  // src/detection/detectors/vision-ai.ts
447
- function detectVisionAI(signals, widgetInteraction = true) {
576
+ function detectVisionAI(signals, widgetInteraction = true, corroborating) {
448
577
  const detections = [];
449
578
  const b = signals.behavioral ?? {};
450
579
  const t = signals.temporal ?? {};
@@ -492,7 +621,7 @@ function detectVisionAI(signals, widgetInteraction = true) {
492
621
  }
493
622
  const microTremor = b.microTremorScore ?? 0.5;
494
623
  if (usesMouse && totalPoints >= 5 && microTremor < 0.15) {
495
- detections.push({
624
+ addCorroboratingDetection(detections, corroborating, {
496
625
  category: "vision_ai",
497
626
  score: 0.7,
498
627
  confidence: 0.6,
@@ -500,7 +629,7 @@ function detectVisionAI(signals, widgetInteraction = true) {
500
629
  });
501
630
  }
502
631
  if (widgetInteraction && usesMouse && approachPts >= 5 && (b.approachDirectness ?? 0) > 0.95 && !hasHumanMovementMarkers(b)) {
503
- detections.push({
632
+ addCorroboratingDetection(detections, corroborating, {
504
633
  category: "vision_ai",
505
634
  score: 0.5,
506
635
  confidence: 0.5,
@@ -509,7 +638,7 @@ function detectVisionAI(signals, widgetInteraction = true) {
509
638
  }
510
639
  const exploration = b.explorationRatio ?? 0.3;
511
640
  if (widgetInteraction && exploration < 0.05 && trajectory > 50) {
512
- detections.push({
641
+ addCorroboratingDetection(detections, corroborating, {
513
642
  category: "vision_ai",
514
643
  score: 0.4,
515
644
  confidence: 0.4,
@@ -657,42 +786,8 @@ function detectAutomation(signals) {
657
786
  return detections;
658
787
  }
659
788
 
660
- // src/detection/detectors/cdp.ts
661
- var HIGH_CONFIDENCE_SIGNALS = ["chromedriver_cdc", "puppeteer_eval", "cdp_script_injection"];
662
- function detectCDP(signals) {
663
- const detections = [];
664
- const cdp = signals.environmental?.cdp ?? {};
665
- if (!cdp.detected) return detections;
666
- const signalList = cdp.signals ?? [];
667
- const signalCount = signalList.length;
668
- const hasHighConf = signalList.some((s) => HIGH_CONFIDENCE_SIGNALS.includes(s));
669
- if (hasHighConf) {
670
- detections.push({
671
- category: "cdp",
672
- score: 0.9,
673
- confidence: 0.95,
674
- reason: `CDP automation detected: ${signalList.join(", ")}`
675
- });
676
- } else if (signalCount >= 2) {
677
- detections.push({
678
- category: "cdp",
679
- score: 0.8,
680
- confidence: 0.85,
681
- reason: `Multiple CDP indicators: ${signalList.join(", ")}`
682
- });
683
- } else if (signalCount === 1) {
684
- detections.push({
685
- category: "cdp",
686
- score: 0.6,
687
- confidence: 0.7,
688
- reason: `CDP indicator: ${signalList.join(", ")}`
689
- });
690
- }
691
- return detections;
692
- }
693
-
694
789
  // src/detection/detectors/behavioral.ts
695
- function detectBehavioral(signals, widgetInteraction = true) {
790
+ function detectBehavioral(signals, widgetInteraction = true, corroborating) {
696
791
  const detections = [];
697
792
  const b = signals.behavioral ?? {};
698
793
  const t = signals.temporal ?? {};
@@ -702,7 +797,7 @@ function detectBehavioral(signals, widgetInteraction = true) {
702
797
  const keyboard = classifyKeyboardInput(signals);
703
798
  const humanMovement = hasHumanMovementMarkers(b);
704
799
  if (keyboard === "short-key-holds" && !isTouchUser) {
705
- detections.push({
800
+ addCorroboratingDetection(detections, corroborating, {
706
801
  category: "behavioral",
707
802
  score: 0.8,
708
803
  confidence: 0.9,
@@ -725,7 +820,7 @@ function detectBehavioral(signals, widgetInteraction = true) {
725
820
  }
726
821
  const velVar = b.velocityVariance ?? 1;
727
822
  if (velVar < 0.02 && trajectory > 50 && !humanMovement) {
728
- detections.push({
823
+ addCorroboratingDetection(detections, corroborating, {
729
824
  category: "behavioral",
730
825
  score: 0.6,
731
826
  confidence: 0.6,
@@ -784,7 +879,7 @@ function detectBehavioral(signals, widgetInteraction = true) {
784
879
  }
785
880
  const straight = b.straightLineRatio ?? 0;
786
881
  if (straight > 0.8 && trajectory > 100) {
787
- detections.push({
882
+ addCorroboratingDetection(detections, corroborating, {
788
883
  category: "behavioral",
789
884
  score: 0.5,
790
885
  confidence: 0.5,
@@ -793,7 +888,7 @@ function detectBehavioral(signals, widgetInteraction = true) {
793
888
  }
794
889
  const dirChanges = b.directionChanges ?? 10;
795
890
  if (totalPoints > 50 && dirChanges < 3) {
796
- detections.push({
891
+ addCorroboratingDetection(detections, corroborating, {
797
892
  category: "behavioral",
798
893
  score: 0.4,
799
894
  confidence: 0.4,
@@ -1755,16 +1850,24 @@ function analyzeAdvancedSignals(signals) {
1755
1850
  // src/detection/engine.ts
1756
1851
  var DetectionEngine = class {
1757
1852
  constructor(options = {}) {
1853
+ if (options.scoringPolicy !== void 0 && options.scoringPolicy !== "weighted-mean-v1" && options.scoringPolicy !== "noisy-or-floors-v1") {
1854
+ throw new TypeError("Unknown detection scoring policy: " + String(options.scoringPolicy));
1855
+ }
1758
1856
  this.weights = options.weights ?? DEFAULT_WEIGHTS;
1857
+ this.scoringPolicy = options.scoringPolicy ?? "weighted-mean-v1";
1759
1858
  this.requirePoW = options.requirePoW ?? true;
1760
1859
  this.fingerprintStore = options.fingerprintStore ?? new InMemoryFingerprintStore();
1761
1860
  this.rateLimiter = options.rateLimiter ?? new InMemoryRateLimiter();
1861
+ this.onScoringComparison = options.onScoringComparison;
1762
1862
  }
1763
1863
  /** Score `signals` for the given request context and return a verdict. */
1764
1864
  score(signals, context) {
1765
1865
  const { ip, siteKey, userAgent } = context;
1766
1866
  const headers = context.headers ?? {};
1767
1867
  const detections = [];
1868
+ const onScoringComparison = this.onScoringComparison;
1869
+ const useCandidate = this.scoringPolicy === "noisy-or-floors-v1";
1870
+ const corroborating = onScoringComparison || useCandidate ? [] : void 0;
1768
1871
  if (context.extraDetections) detections.push(...context.extraDetections);
1769
1872
  const pow = context.pow;
1770
1873
  if (pow && pow.provided) {
@@ -1805,11 +1908,11 @@ var DetectionEngine = class {
1805
1908
  }
1806
1909
  const widgetInteraction = context.widgetInteraction !== false;
1807
1910
  detections.push(
1808
- ...detectVisionAI(signals, widgetInteraction),
1911
+ ...detectVisionAI(signals, widgetInteraction, corroborating),
1809
1912
  ...detectHeadless(signals, userAgent),
1810
1913
  ...detectAutomation(signals),
1811
- ...detectCDP(signals),
1812
- ...detectBehavioral(signals, widgetInteraction),
1914
+ ...detectCDP(signals, corroborating),
1915
+ ...detectBehavioral(signals, widgetInteraction, corroborating),
1813
1916
  ...detectTouchAuthenticity(signals, userAgent),
1814
1917
  ...detectSensorEntropy(signals, userAgent),
1815
1918
  ...detectTouchKinematics(signals),
@@ -1837,13 +1940,42 @@ var DetectionEngine = class {
1837
1940
  detections.push(...analyzeFormInteraction(signals.formAnalysis, signals.behavioral));
1838
1941
  }
1839
1942
  detections.push(...analyzeAdvancedSignals(signals));
1840
- const categoryScores = calculateCategoryScores(detections, this.weights);
1841
- const score = calculateFinalScore(categoryScores, this.weights);
1943
+ const currentCategoryScores = calculateCategoryScores(detections, this.weights);
1944
+ const currentScore = calculateFinalScore(currentCategoryScores, this.weights);
1945
+ const currentRecommendation = recommend(currentScore);
1842
1946
  const scrollObservation = observeScrollJump(signals.behavioral);
1947
+ let candidateCategoryScores;
1948
+ let candidateScore;
1949
+ let candidateRecommendation;
1950
+ if (corroborating) {
1951
+ candidateCategoryScores = calculateNoisyOrCategoryScores(detections, this.weights);
1952
+ const decisiveScore = applyDecisiveScoreFloor(
1953
+ calculateFinalScore(candidateCategoryScores, this.weights),
1954
+ signals.environmental,
1955
+ this.weights
1956
+ );
1957
+ candidateScore = applyCorroborationScoreFloor(decisiveScore, corroborating, this.weights);
1958
+ candidateRecommendation = recommend(candidateScore);
1959
+ }
1960
+ if (onScoringComparison && candidateScore !== void 0 && candidateRecommendation !== void 0) {
1961
+ try {
1962
+ const pending = onScoringComparison({
1963
+ policy: "noisy-or-floors-v1",
1964
+ current: { score: currentScore, recommendation: currentRecommendation },
1965
+ candidate: { score: candidateScore, recommendation: candidateRecommendation }
1966
+ });
1967
+ void pending?.catch(() => {
1968
+ });
1969
+ } catch {
1970
+ }
1971
+ }
1972
+ const categoryScores = useCandidate ? candidateCategoryScores : currentCategoryScores;
1973
+ const score = useCandidate ? candidateScore : currentScore;
1974
+ const recommendation = useCandidate ? candidateRecommendation : currentRecommendation;
1843
1975
  return {
1844
1976
  success: score < 0.5,
1845
1977
  score,
1846
- recommendation: recommend(score),
1978
+ recommendation,
1847
1979
  categoryScores,
1848
1980
  detections,
1849
1981
  ...scrollObservation ? { observations: [scrollObservation] } : {},
@@ -2054,9 +2186,11 @@ var Captcha = class {
2054
2186
  const fingerprintStore = options.fingerprintStore ?? new InMemoryFingerprintStore();
2055
2187
  this.engine = new DetectionEngine({
2056
2188
  weights: options.weights,
2189
+ scoringPolicy: options.scoringPolicy,
2057
2190
  requirePoW: true,
2058
2191
  fingerprintStore,
2059
- rateLimiter
2192
+ rateLimiter,
2193
+ onScoringComparison: options.onScoringComparison
2060
2194
  });
2061
2195
  this.pow = new PoWManager({ secret, store: options.challengeStore, rateLimiter });
2062
2196
  this.tokens = new TokenManager({ secret, store: options.tokenStore });
@@ -2301,6 +2435,7 @@ export {
2301
2435
  createClearanceGate,
2302
2436
  createDetectAndGate,
2303
2437
  createFetchGuard,
2438
+ createNodeHttpGuard,
2304
2439
  createOffensiveToolchainEvidence,
2305
2440
  deriveAndArm,
2306
2441
  deriveKey,
@@ -310,7 +310,7 @@ declare function readEdgeVerdict(headers: Record<string, string> | undefined): E
310
310
  * agents share User-Agent substrings, so sorting this array changes how real
311
311
  * traffic is classified.
312
312
  *
313
- * 251 agents across 15 categories.
313
+ * 277 agents across 15 categories.
314
314
  */
315
315
  /**
316
316
  * Classification categories, mirroring `agents.Category` in Go.
@@ -1675,4 +1675,4 @@ declare class WebDecoy {
1675
1675
  destroy(): Promise<void>;
1676
1676
  }
1677
1677
 
1678
- export { type RequestMetadata as $, type AgentCategory as A, type BotRuleConfig as B, type Characteristic as C, DEFAULT_CHARACTERISTICS as D, EDGE_CLASS_HEADER as E, type FilterConfig as F, type FrameworkEvidenceObservation as G, type HoneyCredentialHandle as H, type HoneyCredentialOptions as I, type HoneyCredentialPresentationResult as J, type HoneyCredentialReceipt as K, type IPEnrichmentData as L, type LocalAnalysis as M, type LogFields as N, type Logger as O, type ProtectResult as P, MemoryRateLimitStore as Q, type Rule as R, type SignedAgentDirectory as S, type TripwireConfig as T, type OffensiveToolFamily as U, type OffensiveToolInvocation as V, WebDecoy as W, type OffensiveToolchainEvidence as X, type OffensiveToolchainEvidenceInput as Y, type OffensiveToolchainObservation as Z, type ProtectOptions as _, type RuleContext as a, type RuleOutcome as a0, type RuleState as a1, type SDKDetectionRequest as a2, type SDKDetectionResponse as a3, type SSRFCanary as a4, type SSRFCanaryOptions as a5, type SSRFInitiationReceipt as a6, type Span as a7, type SyncRateLimitStore as a8, type TLSInfo as a9, type Tracer as aa, type ViolationDeliveryStats as ab, type ViolationEvent as ac, type WebDecoyConfig as ad, classifyUserAgent as ae, consoleLogger as af, createOffensiveToolchainEvidence as ag, deriveKey as ah, fromPino as ai, matchUserAgent as aj, newDecisionId as ak, readEdgeVerdict as al, silentLogger as am, type RuleResult as b, type RuleEngineResult as c, type RateLimitConfig as d, type BotAgent as e, type BotCategory as f, type RateLimitStore as g, type RateLimitConsume as h, type RateLimitOutcome as i, type AgentVerifierOptions as j, type AgentRequestInput as k, type AgentVerdict as l, type AgentStatus as m, BOT_CATEGORIES as n, BOT_REGISTRY as o, type BotVerdict as p, type Conclusion as q, type CreatedHoneyCredential as r, Decision as s, DecisionCache as t, type DecisionCacheOptions as u, type DecisionInit as v, type DecisionMode as w, EDGE_CLEARANCE_HEADER as x, type EdgeClass as y, type EdgeVerdict as z };
1678
+ export { type OffensiveToolchainObservation as $, type AgentCategory as A, type BotRuleConfig as B, type Characteristic as C, Decision as D, EDGE_CLASS_HEADER as E, type FilterConfig as F, type EdgeClass as G, type EdgeVerdict as H, type FrameworkEvidenceObservation as I, type HoneyCredentialHandle as J, type HoneyCredentialOptions as K, type HoneyCredentialPresentationResult as L, type HoneyCredentialReceipt as M, type IPEnrichmentData as N, type LocalAnalysis as O, type ProtectResult as P, type LogFields as Q, type Rule as R, type SignedAgentDirectory as S, type TripwireConfig as T, type Logger as U, MemoryRateLimitStore as V, WebDecoy as W, type OffensiveToolFamily as X, type OffensiveToolInvocation as Y, type OffensiveToolchainEvidence as Z, type OffensiveToolchainEvidenceInput as _, type RuleContext as a, type RequestMetadata as a0, type RuleOutcome as a1, type RuleState as a2, type SDKDetectionRequest as a3, type SDKDetectionResponse as a4, type SSRFCanary as a5, type SSRFCanaryOptions as a6, type SSRFInitiationReceipt as a7, type Span as a8, type SyncRateLimitStore as a9, type TLSInfo as aa, type Tracer as ab, type ViolationDeliveryStats as ac, type ViolationEvent as ad, classifyUserAgent as ae, consoleLogger as af, createOffensiveToolchainEvidence as ag, deriveKey as ah, fromPino as ai, matchUserAgent as aj, newDecisionId as ak, readEdgeVerdict as al, silentLogger as am, type RuleResult as b, type RuleEngineResult as c, type RateLimitConfig as d, type BotAgent as e, type BotCategory as f, type RateLimitStore as g, type RateLimitConsume as h, type RateLimitOutcome as i, type WebDecoyConfig as j, type ProtectOptions as k, type AgentVerifierOptions as l, type AgentRequestInput as m, type AgentVerdict as n, type AgentStatus as o, BOT_CATEGORIES as p, BOT_REGISTRY as q, type BotVerdict as r, type Conclusion as s, type CreatedHoneyCredential as t, DEFAULT_CHARACTERISTICS as u, DecisionCache as v, type DecisionCacheOptions as w, type DecisionInit as x, type DecisionMode as y, EDGE_CLEARANCE_HEADER as z };
@@ -310,7 +310,7 @@ declare function readEdgeVerdict(headers: Record<string, string> | undefined): E
310
310
  * agents share User-Agent substrings, so sorting this array changes how real
311
311
  * traffic is classified.
312
312
  *
313
- * 251 agents across 15 categories.
313
+ * 277 agents across 15 categories.
314
314
  */
315
315
  /**
316
316
  * Classification categories, mirroring `agents.Category` in Go.
@@ -1675,4 +1675,4 @@ declare class WebDecoy {
1675
1675
  destroy(): Promise<void>;
1676
1676
  }
1677
1677
 
1678
- export { type RequestMetadata as $, type AgentCategory as A, type BotRuleConfig as B, type Characteristic as C, DEFAULT_CHARACTERISTICS as D, EDGE_CLASS_HEADER as E, type FilterConfig as F, type FrameworkEvidenceObservation as G, type HoneyCredentialHandle as H, type HoneyCredentialOptions as I, type HoneyCredentialPresentationResult as J, type HoneyCredentialReceipt as K, type IPEnrichmentData as L, type LocalAnalysis as M, type LogFields as N, type Logger as O, type ProtectResult as P, MemoryRateLimitStore as Q, type Rule as R, type SignedAgentDirectory as S, type TripwireConfig as T, type OffensiveToolFamily as U, type OffensiveToolInvocation as V, WebDecoy as W, type OffensiveToolchainEvidence as X, type OffensiveToolchainEvidenceInput as Y, type OffensiveToolchainObservation as Z, type ProtectOptions as _, type RuleContext as a, type RuleOutcome as a0, type RuleState as a1, type SDKDetectionRequest as a2, type SDKDetectionResponse as a3, type SSRFCanary as a4, type SSRFCanaryOptions as a5, type SSRFInitiationReceipt as a6, type Span as a7, type SyncRateLimitStore as a8, type TLSInfo as a9, type Tracer as aa, type ViolationDeliveryStats as ab, type ViolationEvent as ac, type WebDecoyConfig as ad, classifyUserAgent as ae, consoleLogger as af, createOffensiveToolchainEvidence as ag, deriveKey as ah, fromPino as ai, matchUserAgent as aj, newDecisionId as ak, readEdgeVerdict as al, silentLogger as am, type RuleResult as b, type RuleEngineResult as c, type RateLimitConfig as d, type BotAgent as e, type BotCategory as f, type RateLimitStore as g, type RateLimitConsume as h, type RateLimitOutcome as i, type AgentVerifierOptions as j, type AgentRequestInput as k, type AgentVerdict as l, type AgentStatus as m, BOT_CATEGORIES as n, BOT_REGISTRY as o, type BotVerdict as p, type Conclusion as q, type CreatedHoneyCredential as r, Decision as s, DecisionCache as t, type DecisionCacheOptions as u, type DecisionInit as v, type DecisionMode as w, EDGE_CLEARANCE_HEADER as x, type EdgeClass as y, type EdgeVerdict as z };
1678
+ export { type OffensiveToolchainObservation as $, type AgentCategory as A, type BotRuleConfig as B, type Characteristic as C, Decision as D, EDGE_CLASS_HEADER as E, type FilterConfig as F, type EdgeClass as G, type EdgeVerdict as H, type FrameworkEvidenceObservation as I, type HoneyCredentialHandle as J, type HoneyCredentialOptions as K, type HoneyCredentialPresentationResult as L, type HoneyCredentialReceipt as M, type IPEnrichmentData as N, type LocalAnalysis as O, type ProtectResult as P, type LogFields as Q, type Rule as R, type SignedAgentDirectory as S, type TripwireConfig as T, type Logger as U, MemoryRateLimitStore as V, WebDecoy as W, type OffensiveToolFamily as X, type OffensiveToolInvocation as Y, type OffensiveToolchainEvidence as Z, type OffensiveToolchainEvidenceInput as _, type RuleContext as a, type RequestMetadata as a0, type RuleOutcome as a1, type RuleState as a2, type SDKDetectionRequest as a3, type SDKDetectionResponse as a4, type SSRFCanary as a5, type SSRFCanaryOptions as a6, type SSRFInitiationReceipt as a7, type Span as a8, type SyncRateLimitStore as a9, type TLSInfo as aa, type Tracer as ab, type ViolationDeliveryStats as ac, type ViolationEvent as ad, classifyUserAgent as ae, consoleLogger as af, createOffensiveToolchainEvidence as ag, deriveKey as ah, fromPino as ai, matchUserAgent as aj, newDecisionId as ak, readEdgeVerdict as al, silentLogger as am, type RuleResult as b, type RuleEngineResult as c, type RateLimitConfig as d, type BotAgent as e, type BotCategory as f, type RateLimitStore as g, type RateLimitConsume as h, type RateLimitOutcome as i, type WebDecoyConfig as j, type ProtectOptions as k, type AgentVerifierOptions as l, type AgentRequestInput as m, type AgentVerdict as n, type AgentStatus as o, BOT_CATEGORIES as p, BOT_REGISTRY as q, type BotVerdict as r, type Conclusion as s, type CreatedHoneyCredential as t, DEFAULT_CHARACTERISTICS as u, DecisionCache as v, type DecisionCacheOptions as w, type DecisionInit as x, type DecisionMode as y, EDGE_CLEARANCE_HEADER as z };
@@ -1,4 +1,4 @@
1
- import { ad as WebDecoyConfig, $ as RequestMetadata, W as WebDecoy, P as ProtectResult, a1 as RuleState } from './sdk-CJ6pmQGy.mjs';
1
+ import { j as WebDecoyConfig, a0 as RequestMetadata, W as WebDecoy, P as ProtectResult, a2 as RuleState } from './sdk-DveMEqxl.mjs';
2
2
 
3
3
  /**
4
4
  * Testing utilities, for the application's test suite rather than ours.
package/dist/testing.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ad as WebDecoyConfig, $ as RequestMetadata, W as WebDecoy, P as ProtectResult, a1 as RuleState } from './sdk-CJ6pmQGy.js';
1
+ import { j as WebDecoyConfig, a0 as RequestMetadata, W as WebDecoy, P as ProtectResult, a2 as RuleState } from './sdk-DveMEqxl.js';
2
2
 
3
3
  /**
4
4
  * Testing utilities, for the application's test suite rather than ours.
package/dist/testing.js CHANGED
@@ -407,6 +407,8 @@ var BOT_REGISTRY = [
407
407
  { id: "kimibot", name: "KimiBot", category: "training_crawler", organization: "Moonshot AI", baseScore: 80, respectsRobots: true, uaPatterns: ["kimibot"] },
408
408
  { id: "moonshotbot", name: "MoonshotBot", category: "training_crawler", organization: "Moonshot AI", baseScore: 80, respectsRobots: false, uaPatterns: ["moonshotbot"] },
409
409
  { id: "chatglm-spider", name: "ChatGLM-Spider", category: "training_crawler", organization: "Zhipu AI", baseScore: 80, respectsRobots: false, uaPatterns: ["chatglm-spider"] },
410
+ { id: "generalretrievalbot", name: "GeneralRetrievalBot", category: "ai_search_crawler", organization: "General Retrieval", baseScore: 60, respectsRobots: true, uaPatterns: ["generalretrievalbot"] },
411
+ { id: "andi-searchbot", name: "Andi-SearchBot", category: "ai_search_crawler", organization: "Andi", baseScore: 55, respectsRobots: true, uaPatterns: ["andi-searchbot"] },
410
412
  { id: "talarionsearchbot", name: "TalarionSearchBot", category: "ai_search_crawler", organization: "Talarion", baseScore: 65, respectsRobots: false, uaPatterns: ["talarionsearchbot"] },
411
413
  { id: "unfragilebot", name: "UnfragileBot", category: "ai_search_crawler", organization: "Unfragile", baseScore: 65, respectsRobots: true, uaPatterns: ["unfragilebot"] },
412
414
  { id: "aranet-searchbot", name: "Aranet-SearchBot", category: "ai_search_crawler", organization: "Aranet", baseScore: 65, respectsRobots: false, uaPatterns: ["aranet-searchbot"] },
@@ -442,6 +444,9 @@ var BOT_REGISTRY = [
442
444
  { id: "manus-user", name: "Manus-User", category: "ai_agent", organization: "Manus", baseScore: 70, respectsRobots: false, uaPatterns: ["manus-user"] },
443
445
  { id: "multion", name: "MultiOn", category: "ai_agent", organization: "MultiOn", baseScore: 70, respectsRobots: false, uaPatterns: ["multion"] },
444
446
  { id: "opencode-user", name: "OpenCode-User", category: "ai_agent", organization: "OpenCode", baseScore: 75, respectsRobots: false, uaPatterns: ["opencode-user"] },
447
+ { id: "jambot", name: "Jambot", category: "search_crawler", organization: "Jambot", baseScore: 40, respectsRobots: true, uaPatterns: ["jambot"] },
448
+ { id: "fyndbot", name: "fyndbot", category: "search_crawler", organization: "Fynd", baseScore: 40, respectsRobots: true, uaPatterns: ["fyndbot"] },
449
+ { id: "pexelsbot", name: "PexelsBot", category: "search_crawler", organization: "pexels.de", baseScore: 40, respectsRobots: true, uaPatterns: ["pexelsbot"] },
445
450
  { id: "360spider", name: "360Spider", category: "search_crawler", organization: "Qihoo 360", baseScore: 40, respectsRobots: true, uaPatterns: ["360spider"] },
446
451
  { id: "cgmsearchbot", name: "CGMSearchBot", category: "search_crawler", organization: "CGMIMM", baseScore: 40, respectsRobots: true, uaPatterns: ["cgmsearchbot"] },
447
452
  { id: "iboubot", name: "IbouBot", category: "search_crawler", organization: "Ibou", baseScore: 30, respectsRobots: true, uaPatterns: ["iboubot", "ibou-search"] },
@@ -465,6 +470,10 @@ var BOT_REGISTRY = [
465
470
  { id: "coccocbot", name: "Coc Coc", category: "search_crawler", organization: "Coc Coc", baseScore: 35, respectsRobots: true, uaPatterns: ["coccocbot"] },
466
471
  { id: "yisouspider", name: "YisouSpider", category: "search_crawler", organization: "Alibaba", baseScore: 40, respectsRobots: true, uaPatterns: ["yisouspider"] },
467
472
  { id: "yepbot", name: "YepBot", category: "search_crawler", organization: "Ahrefs", baseScore: 30, respectsRobots: true, uaPatterns: ["yepbot"] },
473
+ { id: "agentreadyscan", name: "AgentReadyScan", category: "seo_crawler", organization: "Agent Ready", baseScore: 45, respectsRobots: true, uaPatterns: ["agentreadyscan"] },
474
+ { id: "crawlcheck", name: "CrawlCheck", category: "seo_crawler", organization: "CrawlCheck", baseScore: 45, respectsRobots: true, uaPatterns: ["crawlcheck/"] },
475
+ { id: "kostobot", name: "KostoBot", category: "seo_crawler", organization: "Kosto", baseScore: 50, respectsRobots: true, uaPatterns: ["kostobot"] },
476
+ { id: "keys-so-bot", name: "keys.so", category: "seo_crawler", organization: "Keys.so", baseScore: 50, respectsRobots: false, uaPatterns: ["keys-so-bot"] },
468
477
  { id: "crolbot", name: "CrolBot", category: "seo_crawler", organization: "cloro", baseScore: 50, respectsRobots: false, uaPatterns: ["crolbot"] },
469
478
  { id: "ahrefsbot", name: "AhrefsBot", category: "seo_crawler", organization: "Ahrefs", baseScore: 50, respectsRobots: true, uaPatterns: ["ahrefsbot", "ahrefs"] },
470
479
  { id: "semrushbot", name: "SemrushBot", category: "seo_crawler", organization: "Semrush", baseScore: 50, respectsRobots: true, uaPatterns: ["semrushbot", "semrush"] },
@@ -490,6 +499,10 @@ var BOT_REGISTRY = [
490
499
  { id: "seojuice-searchbot", name: "SEOJuice-SearchBot", category: "seo_crawler", organization: "SEOJuice", baseScore: 50, respectsRobots: true, uaPatterns: ["seojuice-searchbot"] },
491
500
  { id: "trendictionbot", name: "trendictionbot", category: "seo_crawler", organization: "Talkwalker", baseScore: 50, respectsRobots: true, uaPatterns: ["trendictionbot"] },
492
501
  { id: "hubspot-crawler", name: "HubSpot Crawler", category: "seo_crawler", organization: "HubSpot", baseScore: 45, respectsRobots: true, uaPatterns: ["hubspot crawler"] },
502
+ { id: "bitsightbot", name: "BitSightBot", category: "security_scanner", organization: "BitSight", baseScore: 70, respectsRobots: false, uaPatterns: ["bitsightbot"] },
503
+ { id: "leakix", name: "LeakIX", category: "security_scanner", organization: "LeakIX", baseScore: 75, respectsRobots: false, uaPatterns: ["l9scan"] },
504
+ { id: "modatscanner", name: "ModatScanner", category: "security_scanner", organization: "Modat", baseScore: 75, respectsRobots: false, uaPatterns: ["modatscanner"] },
505
+ { id: "umaibot", name: "UmaiBot", category: "security_scanner", organization: "UMAI", baseScore: 60, respectsRobots: true, uaPatterns: ["umaibot"] },
493
506
  { id: "artex", name: "ARTEX", category: "security_scanner", organization: "Open Source", baseScore: 90, respectsRobots: false, uaPatterns: ["artex-enrich/"] },
494
507
  { id: "nessus", name: "Nessus", category: "security_scanner", organization: "Tenable", baseScore: 70, respectsRobots: false, uaPatterns: ["nessus"] },
495
508
  { id: "qualys", name: "Qualys", category: "security_scanner", organization: "Qualys", baseScore: 70, respectsRobots: false, uaPatterns: ["qualys"] },
@@ -544,6 +557,8 @@ var BOT_REGISTRY = [
544
557
  { id: "wayback", name: "Wayback Machine", category: "archiver", organization: "Internet Archive", baseScore: 25, respectsRobots: true, uaPatterns: ["wayback"] },
545
558
  { id: "heritrix", name: "Heritrix", category: "archiver", organization: "Internet Archive", baseScore: 30, respectsRobots: true, uaPatterns: ["heritrix"] },
546
559
  { id: "brozzler", name: "Brozzler", category: "archiver", organization: "Internet Archive", baseScore: 30, respectsRobots: true, uaPatterns: ["brozzler"] },
560
+ { id: "findfiles-linkchecker", name: "FindFiles.net LinkChecker", category: "fetcher", organization: "FindFiles.net", baseScore: 30, respectsRobots: true, uaPatterns: ["findfiles.net-linkchecker"] },
561
+ { id: "hstspreload-bot", name: "hstspreload-bot", category: "fetcher", organization: "Chromium", baseScore: 20, respectsRobots: false, uaPatterns: ["hstspreload-bot"] },
547
562
  { id: "facebookexternalhit", name: "Facebook", category: "fetcher", organization: "Meta", baseScore: 25, respectsRobots: true, uaPatterns: ["facebookexternalhit"] },
548
563
  { id: "facebot", name: "Facebot", category: "fetcher", organization: "Meta", baseScore: 25, respectsRobots: true, uaPatterns: ["facebot"] },
549
564
  { id: "twitterbot", name: "Twitterbot", category: "fetcher", organization: "X Corp", baseScore: 25, respectsRobots: true, uaPatterns: ["twitterbot"] },
@@ -568,6 +583,7 @@ var BOT_REGISTRY = [
568
583
  { id: "libwww-perl", name: "libwww-perl", category: "fetcher", organization: "Perl", baseScore: 50, respectsRobots: false, uaPatterns: ["libwww-perl"] },
569
584
  { id: "lwp", name: "LWP", category: "fetcher", organization: "Perl", baseScore: 50, respectsRobots: false, uaPatterns: ["lwp-"] },
570
585
  { id: "httrack", name: "HTTrack", category: "fetcher", organization: "Open Source", baseScore: 60, respectsRobots: true, uaPatterns: ["httrack"] },
586
+ { id: "truetierbot", name: "TrueTierBot", category: "monitoring", organization: "TrueTier", baseScore: 25, respectsRobots: true, uaPatterns: ["truetierbot"] },
571
587
  { id: "webdecoybot", name: "WebDecoyBot", category: "monitoring", organization: "WebDecoy", baseScore: 5, respectsRobots: true, uaPatterns: ["webdecoybot"] },
572
588
  { id: "uptimerobot", name: "UptimeRobot", category: "monitoring", organization: "UptimeRobot", baseScore: 20, respectsRobots: true, uaPatterns: ["uptimerobot"] },
573
589
  { id: "pingdom", name: "Pingdom", category: "monitoring", organization: "SolarWinds", baseScore: 20, respectsRobots: true, uaPatterns: ["pingdom"] },
@@ -581,6 +597,9 @@ var BOT_REGISTRY = [
581
597
  { id: "nodeping", name: "NodePing", category: "monitoring", organization: "NodePing", baseScore: 20, respectsRobots: true, uaPatterns: ["nodeping"] },
582
598
  { id: "gtmetrix", name: "GTmetrix", category: "monitoring", organization: "GTmetrix", baseScore: 20, respectsRobots: true, uaPatterns: ["gtmetrix"] },
583
599
  { id: "chrome-lighthouse", name: "Lighthouse", category: "monitoring", organization: "Google", baseScore: 20, respectsRobots: true, uaPatterns: ["chrome-lighthouse", "google page speed"] },
600
+ { id: "andifeedbot", name: "AndiFeedBot", category: "feed_reader", organization: "Andi", baseScore: 30, respectsRobots: true, uaPatterns: ["andifeedbot"] },
601
+ { id: "librarianbot", name: "LibrarianBot", category: "feed_reader", organization: "GenioFab", baseScore: 30, respectsRobots: true, uaPatterns: ["librarianbot"] },
602
+ { id: "oursignal", name: "oursignal", category: "feed_reader", organization: "oursignal", baseScore: 25, respectsRobots: true, uaPatterns: ["oursignal/"] },
584
603
  { id: "feedly", name: "Feedly", category: "feed_reader", organization: "Feedly", baseScore: 25, respectsRobots: true, uaPatterns: ["feedly"] },
585
604
  { id: "livelapbot", name: "LivelapBot", category: "feed_reader", organization: "Livelap", baseScore: 30, respectsRobots: true, uaPatterns: ["livelapbot"] },
586
605
  { id: "feedfetcher-google", name: "Feedfetcher-Google", category: "feed_reader", organization: "Google", baseScore: 25, respectsRobots: true, uaPatterns: ["feedfetcher"] },
@@ -591,6 +610,12 @@ var BOT_REGISTRY = [
591
610
  { id: "miniflux", name: "Miniflux", category: "feed_reader", organization: "Open Source", baseScore: 25, respectsRobots: true, uaPatterns: ["miniflux"] },
592
611
  { id: "freshrss", name: "FreshRSS", category: "feed_reader", organization: "Open Source", baseScore: 25, respectsRobots: true, uaPatterns: ["freshrss"] },
593
612
  { id: "commafeed", name: "CommaFeed", category: "feed_reader", organization: "Open Source", baseScore: 25, respectsRobots: true, uaPatterns: ["commafeed"] },
613
+ { id: "tphotobot", name: "tphotobot", category: "commercial_scraper", organization: "Estidraft", baseScore: 50, respectsRobots: true, uaPatterns: ["tphotobot"] },
614
+ { id: "bangobot", name: "BangoBot", category: "commercial_scraper", organization: "Bango API", baseScore: 55, respectsRobots: false, uaPatterns: ["bangobot"] },
615
+ { id: "kamatabot", name: "KamataBot", category: "commercial_scraper", organization: "Kamata", baseScore: 55, respectsRobots: true, uaPatterns: ["kamatabot"] },
616
+ { id: "boehmbot", name: "BoehmBot", category: "commercial_scraper", organization: "b\xF6hm systems", baseScore: 50, respectsRobots: true, uaPatterns: ["boehmbot"] },
617
+ { id: "pipericbot", name: "PipericBot", category: "commercial_scraper", organization: "Piperic", baseScore: 55, respectsRobots: true, uaPatterns: ["pipericbot"] },
618
+ { id: "pandalytics", name: "Pandalytics", category: "commercial_scraper", organization: "Domainsbot", baseScore: 50, respectsRobots: true, uaPatterns: ["pandalytics"] },
594
619
  { id: "spiderling", name: "SpiderLing", category: "commercial_scraper", organization: "Lexical Computing", baseScore: 55, respectsRobots: true, uaPatterns: ["spiderling", "sketchengine"] },
595
620
  { id: "netapi", name: "NetAPI Bot", category: "commercial_scraper", organization: "NetAPI", baseScore: 50, respectsRobots: true, uaPatterns: ["netapi/"] },
596
621
  { id: "anticlonebot", name: "AntiCloneBot", category: "commercial_scraper", organization: "AntiClone", baseScore: 45, respectsRobots: true, uaPatterns: ["anticlonebot"] },
@@ -608,6 +633,7 @@ var BOT_REGISTRY = [
608
633
  { id: "apify", name: "Apify", category: "commercial_scraper", organization: "Apify", baseScore: 65, respectsRobots: true, uaPatterns: ["apify"] },
609
634
  { id: "crawlbase", name: "Crawlbase", category: "commercial_scraper", organization: "Crawlbase", baseScore: 65, respectsRobots: true, uaPatterns: ["crawlbase"] },
610
635
  { id: "webscrapingapi", name: "WebScrapingAPI", category: "commercial_scraper", organization: "WebScrapingAPI", baseScore: 65, respectsRobots: true, uaPatterns: ["webscrapingapi"] },
636
+ { id: "andi-user", name: "Andi-User", category: "ai_assistant", organization: "Andi", baseScore: 60, respectsRobots: false, uaPatterns: ["andi-user"] },
611
637
  { id: "chatgpt-user", name: "ChatGPT-User", category: "ai_assistant", organization: "OpenAI", baseScore: 85, respectsRobots: true, uaPatterns: ["chatgpt-user"] },
612
638
  { id: "perplexity-user", name: "Perplexity-User", category: "ai_assistant", organization: "Perplexity AI", baseScore: 75, respectsRobots: false, uaPatterns: ["perplexity-user"] },
613
639
  { id: "mistralai-user", name: "MistralAI-User", category: "ai_assistant", organization: "Mistral AI", baseScore: 75, respectsRobots: true, uaPatterns: ["mistralai-user"] },
package/dist/testing.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  WebDecoy,
3
3
  silentLogger
4
- } from "./chunk-32TEUD5K.mjs";
4
+ } from "./chunk-IGSPJVI6.mjs";
5
5
 
6
6
  // src/testing.ts
7
7
  function request(over = {}) {
package/dist/vercel.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ClearanceGateOptions, C as ClearanceContext, D as DetectAndGateOptions, d as GateOutcome } from './detect-and-gate-BNq26N9d.mjs';
2
- import './sdk-CJ6pmQGy.mjs';
1
+ import { a as ClearanceGateOptions, C as ClearanceContext, D as DetectAndGateOptions, d as GateOutcome } from './detect-and-gate-DWOUDUSY.mjs';
2
+ import './sdk-DveMEqxl.mjs';
3
3
 
4
4
  /**
5
5
  * WebDecoy for Vercel Routing Middleware, any framework.
package/dist/vercel.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as ClearanceGateOptions, C as ClearanceContext, D as DetectAndGateOptions, d as GateOutcome } from './detect-and-gate-Dnfo2t3B.js';
2
- import './sdk-CJ6pmQGy.js';
1
+ import { a as ClearanceGateOptions, C as ClearanceContext, D as DetectAndGateOptions, d as GateOutcome } from './detect-and-gate-BfL39HDb.js';
2
+ import './sdk-DveMEqxl.js';
3
3
 
4
4
  /**
5
5
  * WebDecoy for Vercel Routing Middleware, any framework.