diegosouzapw/OmniRoute · error

SECURITY_001

SECURITY_001

Error message

Request blocked: potential prompt injection detected

What it means

Error "Request blocked: potential prompt injection detected" thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/app/api/v1/images/edits/route.ts:340

    return errorResponse(
      HTTP_STATUS.BAD_REQUEST,
      "Invalid request body. Send multipart/form-data or JSON with a data-URL image."
    );
  }

  const { prompt, model, size, responseFormat, imageBytes, imageMime, images, imageInputCount } =
    input;
  if (!prompt) {
    return errorResponse(HTTP_STATUS.BAD_REQUEST, "Missing required field: prompt");
  }
  const injectionDecision = createInjectionGuard()({ prompt });
  if (injectionDecision.blocked) {
    return jsonResponse(
      {
        error: {
          message: "Request blocked: potential prompt injection detected",
          type: "injection_detected",
          code: "SECURITY_001",
          detections: injectionDecision.result.detections.length,
        },
      },
      HTTP_STATUS.BAD_REQUEST
    );
  }
  if (imageInputCount !== images.length) {
    return errorResponse(HTTP_STATUS.BAD_REQUEST, "Invalid reference image");
  }
  if (!imageBytes || imageBytes.length === 0) {
    return errorResponse(HTTP_STATUS.BAD_REQUEST, "Missing required field: image");
  }

  const fullModel = model || "cgpt-web/gpt-5.5";

  const policy = await enforceApiKeyPolicy(request, fullModel);
  if (policy.rejection) return policy.rejection;

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/app/api/v1/images/edits/route.ts:340 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/27890b7aa0a500c0. Report an issue: GitHub.