diegosouzapw/OmniRoute · error

[PII] Blocked response due to sanitization failure

Error message

[PII] Blocked response due to sanitization failure

What it means

Error "[PII] Blocked response due to sanitization failure" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/piiSanitizer.ts:341

      }
      return obj;
    };

    return deepSanitize(response);
  } catch (err: any) {
    if (err?.message?.startsWith("[PII] Blocked response")) {
      throw err;
    }
    // Fail secure — try raw string sanitization instead of failing open
    try {
      const serialized = JSON.stringify(response);
      const { text: sanitized } = sanitizePII(serialized);
      return JSON.parse(sanitized);
    } catch (fallbackErr) {
      // Suppress err.message — never surface upstream error detail to the client
      // (Hard Rule #12). The underlying error is available in server logs.
      console.warn("[PII] Sanitization fallback failed:", err?.message);
      throw new Error("[PII] Blocked response due to sanitization failure");
    }
  }
}

// ── Checksum Validation Helpers ──

function isValidLuhn(digits: string): boolean {
  let sum = 0;
  let shouldDouble = false;
  for (let i = digits.length - 1; i >= 0; i--) {
    let digit = parseInt(digits[i], 10);
    if (shouldDouble) {
      digit *= 2;
      if (digit > 9) digit -= 9;
    }
    sum += digit;
    shouldDouble = !shouldDouble;
  }

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/piiSanitizer.ts:341 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/21a48b6a1787b2ba. Report an issue: GitHub.