nexus-agents 8.33.0 → 8.33.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.
@@ -23,10 +23,10 @@ import {
23
23
  toolSuccessStructured,
24
24
  withProgressHeartbeat,
25
25
  wrapToolWithTimeout
26
- } from "./chunk-LPY73UIV.js";
26
+ } from "./chunk-KIDVXKGL.js";
27
27
  import {
28
28
  VERSION
29
- } from "./chunk-GEUOGSCS.js";
29
+ } from "./chunk-HMQO7NAF.js";
30
30
  import {
31
31
  assessPanelIndependence,
32
32
  countDistinctModels,
@@ -7806,4 +7806,4 @@ export {
7806
7806
  CONSENSUS_VOTE_TOOL_SCHEMA,
7807
7807
  registerConsensusVoteTool
7808
7808
  };
7809
- //# sourceMappingURL=chunk-5DW7CTDJ.js.map
7809
+ //# sourceMappingURL=chunk-BWYCK74C.js.map
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  import semver from "semver";
3
- var VERSION = true ? "8.33.0" : "dev";
3
+ var VERSION = true ? "8.33.1" : "dev";
4
4
  var NODE_ENGINE_RANGE = ">=22.5.0";
5
5
  function isNodeVersionSupported(version) {
6
6
  return semver.satisfies(version, NODE_ENGINE_RANGE);
@@ -11,4 +11,4 @@ export {
11
11
  NODE_ENGINE_RANGE,
12
12
  isNodeVersionSupported
13
13
  };
14
- //# sourceMappingURL=chunk-GEUOGSCS.js.map
14
+ //# sourceMappingURL=chunk-HMQO7NAF.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-GEUOGSCS.js";
3
+ } from "./chunk-HMQO7NAF.js";
4
4
  import {
5
5
  emitClawGuardViolation
6
6
  } from "./chunk-W5UCRZN4.js";
@@ -682,6 +682,53 @@ function emitRateLimitAudit(auditLogger, toolName, ctx, state) {
682
682
  });
683
683
  }
684
684
 
685
+ // src/mcp/middleware/secure-handler-tier.ts
686
+ function checkSecurityTier(tier, sanitizeResult, logger) {
687
+ if (sanitizeResult.sanitizationIncomplete) {
688
+ logger.warn("Input rejected: sanitizer did not reach a fixed point", { tier });
689
+ return {
690
+ error: toolStructuredError({
691
+ errorCategory: "permission",
692
+ message: "Input validation failed: the input could not be fully sanitized within the pass budget, so it still contains markup the sanitizer removes. Simplify the input and retry."
693
+ }),
694
+ eventType: "sanitization_incomplete",
695
+ patterns: [],
696
+ tier
697
+ };
698
+ }
699
+ if (tier === "standard" || sanitizeResult.detectedPatterns.length === 0) {
700
+ return null;
701
+ }
702
+ logger.warn("Input rejected by security tier validation", {
703
+ tier,
704
+ patterns: sanitizeResult.detectedPatterns
705
+ });
706
+ return {
707
+ // Security-tier rejection of suspected injection patterns — an
708
+ // access-control denial, categorized `permission` (#2649).
709
+ error: toolStructuredError({
710
+ errorCategory: "permission",
711
+ message: `Input validation failed: detected patterns [${sanitizeResult.detectedPatterns.join(", ")}]. Remove prompt injection patterns and retry.`
712
+ }),
713
+ eventType: "injection_pattern_blocked",
714
+ patterns: sanitizeResult.detectedPatterns,
715
+ tier
716
+ };
717
+ }
718
+ function emitSecurityTierAudit(auditLogger, toolName, ctx, refusal) {
719
+ auditLogger.logSecurityEvent({
720
+ eventType: refusal.eventType,
721
+ // `critical` is this enum's security-violation level ('info' / 'warning' /
722
+ // 'critical'); a refused injection attempt is not routine noise, and the
723
+ // level is what a downstream consumer filters on.
724
+ severity: "critical",
725
+ actor: actorFromContext(ctx),
726
+ description: refusal.eventType === "sanitization_incomplete" ? `Tool '${toolName}' refused input the sanitizer could not reduce to a fixed point.` : `Tool '${toolName}' refused input carrying injection patterns [${refusal.patterns.join(", ")}].`,
727
+ requestId: ctx.requestId,
728
+ metadata: { toolName, tier: refusal.tier, patterns: [...refusal.patterns] }
729
+ });
730
+ }
731
+
685
732
  // src/mcp/middleware/tool-input-sanitizer.ts
686
733
  var XML_INJECTION_PATTERN = /<\/?(system|human|assistant|instructions|user|prompt|context|tool_use|tool_result)\b[^>]*>/gi;
687
734
  var INJECTION_DETECTORS = [
@@ -1033,27 +1080,6 @@ function emitToolAudit({
1033
1080
  ...nearMiss ? { policyDecision: "would_deny" } : {}
1034
1081
  });
1035
1082
  }
1036
- function checkSecurityTier(config, sanitizeResult, logger) {
1037
- const tier = config.securityTier ?? "standard";
1038
- if (sanitizeResult.sanitizationIncomplete) {
1039
- logger.warn("Input rejected: sanitizer did not reach a fixed point", { tier });
1040
- return toolStructuredError({
1041
- errorCategory: "permission",
1042
- message: "Input validation failed: the input could not be fully sanitized within the pass budget, so it still contains markup the sanitizer removes. Simplify the input and retry."
1043
- });
1044
- }
1045
- if (tier === "standard" || sanitizeResult.detectedPatterns.length === 0) {
1046
- return null;
1047
- }
1048
- logger.warn("Input rejected by security tier validation", {
1049
- tier,
1050
- patterns: sanitizeResult.detectedPatterns
1051
- });
1052
- return toolStructuredError({
1053
- errorCategory: "permission",
1054
- message: `Input validation failed: detected patterns [${sanitizeResult.detectedPatterns.join(", ")}]. Remove prompt injection patterns and retry.`
1055
- });
1056
- }
1057
1083
  function runPreChecks(config, args, mode, requestContext, logger) {
1058
1084
  const noSanitization = { wasModified: false, commentsRemoved: 0 };
1059
1085
  const sizeResult = checkInputSize(args, logger, requestContext.requestId);
@@ -1072,8 +1098,12 @@ function runPreChecks(config, args, mode, requestContext, logger) {
1072
1098
  wasModified: sanitizeResult.wasModified,
1073
1099
  commentsRemoved: sanitizeResult.commentsRemoved
1074
1100
  };
1075
- const tierError = checkSecurityTier(config, sanitizeResult, logger);
1076
- if (tierError !== null) return { error: tierError, sanitizedArgs, nearMiss: false, sanitization };
1101
+ const refusal = checkSecurityTier(config.securityTier ?? "standard", sanitizeResult, logger);
1102
+ if (refusal !== null) {
1103
+ if (config.auditLogger)
1104
+ emitSecurityTierAudit(config.auditLogger, config.toolName, requestContext, refusal);
1105
+ return { error: refusal.error, sanitizedArgs, nearMiss: false, sanitization };
1106
+ }
1077
1107
  if (config.rateLimiter) {
1078
1108
  const denial = checkRateLimit(config.rateLimiter, logger);
1079
1109
  if (denial) {
@@ -2276,4 +2306,4 @@ export {
2276
2306
  VOTING_THRESHOLDS,
2277
2307
  ConsensusMetricsSchema
2278
2308
  };
2279
- //# sourceMappingURL=chunk-LPY73UIV.js.map
2309
+ //# sourceMappingURL=chunk-KIDVXKGL.js.map