A blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
This report summarizes scanner evidence for Portkey-AI/gateway, a TypeScript project with 13,459 GitHub stars. SynthScan examined 127,603 lines of code across 669 source files, recording 72 pattern matches distributed across 10 syntactic categories. The legacy adjusted pattern signal is 0.9 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-11-27.
Can maintainers explain intent, assumptions, and trade-offs? 59 finding(s).
Are imports declared and package/API names verified? 13 finding(s).
Are wrappers, guards, and repeated structures necessary? 23 finding(s).
Which changes need focused human review? 72 finding(s).
Run additional scans to build a history of the legacy pattern signal. Score changes are not a measure of AI adoption or code quality.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 72 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | README.md | 151 | <img src="https://portkey.ai/blog/content/images/size/w1600/2024/11/image-15.png" width=600 title="Request flow through | CODE |
| MEDIUM | README.md | 201 | - <a href="https://portkey.wiki/gh-88">**Guardrails**</a>: Verify your LLM inputs and outputs to adhere to your specifie | CODE |
| MEDIUM | plugins/README.md | 11 | - [Guardrails](#guardrails) | CODE |
| MEDIUM | plugins/portkey/globals.ts | 5 | export const BASE_URL = 'https://api.portkey.ai/v1/execute-guardrails'; | CODE |
| MEDIUM | plugins/javelin/guardrails.ts | 45 | const apiUrl = `https://${domain}/v1/guardrails/apply`; | CODE |
| MEDIUM | plugins/javelin/guardrails.ts | 243 | // All guardrails passed | COMMENT |
| MEDIUM | cookbook/integrations/vercel/readme.md | 257 | Read more about Guardrails [here](https://docs.portkey.ai/features/guardrails). | CODE |
| MEDIUM | …grations/vercel/app/examples/generate-text/fallback.ts | 33 | //Portkey's config allows you to use- loadbalance, fallback, retires, timeouts, semantic caching, conditional routin | COMMENT |
| MEDIUM | …rcel/app/examples/generate-text/conditional-routing.ts | 46 | //Portkey's config allows you to use- loadbalance, fallback, retires, timeouts, semantic caching, conditional routin | COMMENT |
| MEDIUM | …ations/vercel/app/examples/generate-text/guardrails.ts | 30 | //Portkey's config allows you to use- loadbalance, fallback, retires, timeouts, semantic caching, conditional routin | COMMENT |
| MEDIUM | …ions/vercel/app/examples/generate-text/load-balance.ts | 35 | //Portkey's config allows you to use- loadbalance, fallback, retires, timeouts, semantic caching, conditional routin | COMMENT |
| MEDIUM | …tegrations/vercel/app/examples/generate-text/action.ts | 11 | //Portkey's config allows you to use- loadbalance, fallback, retires, timeouts, semantic caching, conditional routin | COMMENT |
| MEDIUM | .github/README.jp.md | 224 | <strong><a href="https://docs.portkey.ai/docs/product/guardrails">ガードレール</a></strong></br><br/> | CODE |
| MEDIUM | src/public/index.html | 1063 | <a class="feature-item" href="https://portkey.ai/docs/product/guardrails"> | CODE |
| MEDIUM | src/handlers/handlerUtils.ts | 244 | // if the deny key is present (true or false), add it to hooksObject and remove it from guardrails | COMMENT |
| MEDIUM | src/handlers/handlerUtils.ts | 509 | // To avoid redundant conversion of guardrails to hooks, we do this check. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | plugins/azure/utils.ts | 5 | export async function getAccessTokenFromEntraId( | CODE |
| LOW | plugins/azure/utils.ts | 59 | export async function getAzureManagedIdentityToken( | CODE |
| LOW | plugins/bedrock/util.ts | 144 | export async function getAssumedRoleCredentials( | CODE |
| LOW | plugins/acuvity/scan.test.ts | 7 | export function getPromptInjectionParameters(): PluginParameters { | CODE |
| LOW | plugins/acuvity/scan.test.ts | 91 | export function getSecretsRedactedParameters(): PluginParameters { | CODE |
| LOW | …roviders/google-vertex-ai/transformGenerationConfig.ts | 11 | export function transformGenerationConfig(params: PortkeyGeminiParams) { | CODE |
| LOW | …roviders/google-vertex-ai/transformGenerationConfig.ts | 86 | export function transformEmbeddingsParameters(params: GoogleEmbedParams) { | CODE |
| LOW | src/providers/bedrock/messages.ts | 516 | function createContentBlockStartEvent( | CODE |
| LOW | src/providers/bedrock/utils.ts | 229 | export async function getAssumedRoleCredentials( | CODE |
| LOW | src/providers/bedrock/utils.ts | 388 | export async function providerAssumedRoleCredentials( | CODE |
| LOW | src/providers/azure-openai/utils.ts | 6 | export async function getAccessTokenFromEntraId( | CODE |
| LOW | src/providers/azure-openai/utils.ts | 43 | export async function getAzureManagedIdentityToken( | CODE |
| LOW | src/providers/azure-openai/utils.ts | 71 | export async function getAzureWorkloadIdentityToken( | CODE |
| LOW | src/middlewares/requestValidator/index.ts | 433 | function isAlternativeIPRepresentation(host: string, parts: string[]): boolean { | CODE |
| LOW | src/shared/services/cache/index.ts | 303 | export function getTokenIntrospectionCache(): CacheService { | CODE |
| LOW | src/shared/services/cache/backends/cloudflareKV.ts | 223 | export function createCloudflareKVBackend( | CODE |
| LOW | src/public/index.html | 1663 | function getRoutingConfigCodeBlock(language, type) { | CODE |
| LOW | src/handlers/handlerUtils.ts | 836 | export function constructConfigFromRequestHeaders( | CODE |
| LOW | src/handlers/handlerUtils.ts | 1182 | export async function recursiveAfterRequestHookHandler( | CODE |
| LOW | src/handlers/streamHandler.ts | 292 | export function handleOctetStreamResponse(response: Response) { | CODE |
| LOW | src/handlers/streamHandler.ts | 414 | export async function handleJSONToStreamResponse( | CODE |
| LOW | src/handlers/createTranscriptionHandler.ts | 15 | export async function createTranscriptionHandler( | CODE |
| LOW | src/handlers/messagesCountTokensHandler.ts | 16 | export async function messagesCountTokensHandler( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | plugins/README.md | 169 | "apiKey": "your-api-key-here" | CODE |
| HIGH | …-cases/use-openai-sdk-with-portkey-prompt-templates.md | 41 | We will use `axios` to make a `POST` call to `/prompts/${PROMPT_ID}/render` endpoint along with headers (includes [Portk | CODE |
| HIGH | …ent-loadbalancing-with-failure-mitigating-fallbacks.md | 11 | You should have the [Portkey API Key](https://portkey.ai/docs/api-reference/authentication#obtaining-your-api-key). Plea | CODE |
| HIGH | …k/getting-started/writing-your-first-gateway-config.md | 34 | Along with Portkey API Key ([get one](https://portkey.ai/docs/api-reference/authentication#obtaining-your-api-key)), you | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | plugins/default/default.test.ts | 331 | "name": "John Doe", | CODE |
| LOW | plugins/default/default.test.ts | 336 | "number": "555-0123" | CODE |
| LOW | plugins/default/default.test.ts | 397 | name: 'John Doe', | CODE |
| LOW | plugins/default/default.test.ts | 402 | number: '555-0123', | CODE |
| LOW | plugins/default/default.test.ts | 421 | "name": "John Doe", | CODE |
| LOW | plugins/panw-prisma-airs/panw.airs.test.ts | 19 | credentials: { AIRS_API_KEY: 'dummy-key' }, | CODE |
| LOW | plugins/panw-prisma-airs/panw.airs.test.ts | 46 | credentials: { AIRS_API_KEY: 'dummy-key' }, | CODE |
| LOW | plugins/panw-prisma-airs/panw.airs.test.ts | 64 | credentials: { AIRS_API_KEY: 'dummy-key' }, | CODE |
| LOW | plugins/panw-prisma-airs/panw.airs.test.ts | 83 | credentials: { AIRS_API_KEY: 'dummy-key' }, | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cookbook/use-cases/supabase-pgvector-and-portkey.md | 84 | ### Step 1: Importing and authenticating Portkey and Supabase | COMMENT |
| LOW | cookbook/use-cases/supabase-pgvector-and-portkey.md | 105 | ### Step 2: Create a Table | COMMENT |
| LOW | cookbook/use-cases/supabase-pgvector-and-portkey.md | 126 | ## Step 3: Read, Generate and Store embeddings | COMMENT |
| LOW | cookbook/use-cases/supabase-pgvector-and-portkey.md | 190 | ### Step 4: Create a database function to query similar match | COMMENT |
| LOW | cookbook/use-cases/supabase-pgvector-and-portkey.md | 226 | ### Step 5: Query for the similarity match | COMMENT |
| LOW | src/providers/bedrock/uploadFile.ts | 56 | // Step 5: Send Request | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | plugins/pillar/scanPrompt.ts | 41 | // result is an object with the following structure: | COMMENT |
| LOW | plugins/sydelabs/sydeguard.ts | 41 | { | COMMENT |
| LOW | plugins/sydelabs/sydeguard.ts | 61 | // "category": "PROMPT_INJECT", | COMMENT |
| LOW | plugins/aporia/validateProject.ts | 81 | // "revised_response": "Modified response based on policy", | COMMENT |
| LOW | cookbook/integrations/vercel/next-env.d.ts | 1 | /// <reference types="next" /> | COMMENT |
| LOW | src/providers/google-vertex-ai/chatComplete.ts | 261 | top_logprobs: { | COMMENT |
| LOW | src/public/index.html | 1441 | </script> | COMMENT |
| LOW | src/public/index.html | 1461 | // -H <span class="hljs-string">"x-portkey-aws-secret-access-key: <span class="highlighted-value ${vars.providerDe | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | plugins/qualifire/qualifire.test.ts | 1226 | text: 'I cannot provide personal email addresses as that would be a privacy concern.', | CODE |
| MEDIUM | plugins/qualifire/qualifire.test.ts | 1300 | 'I cannot provide personal email addresses as that would be a privacy concern.', | CODE |
| MEDIUM | plugins/qualifire/qualifire.test.ts | 1322 | 'I cannot provide personal email addresses as that would be a privacy concern.', | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | plugins/default/addPrefix.ts | 81 | // If this is the last message, leverage utils to ensure messages route compatibility | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | plugins/acuvity/scan.test.ts | 125 | // Example usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/providers/bedrock/uploadFile.ts | 56 | // Step 5: Send Request | COMMENT |