LLM Route Detection

LLM route detection: find every route that calls a model.

Source intelligence marks the API routes whose handlers send a prompt to a language model, and the ones that also hand the model tools, so AI endpoint testing starts from a map instead of a guess.

LLM route detection finds the API routes whose handler code calls a language model. NightVision's source intelligence reads handlers written in Python, C#, Go, JavaScript, TypeScript, Ruby and PHP, and tags each route that reaches a model call with llm-query, adding llm-tool-call when that call hands the model tools it can invoke. The tags are written into the OpenAPI spec it generates, so you know which routes to put in front of NightVision's AI endpoint tests.

The Risk

Security cannot test what it cannot find.

AI features ship in every team now: a support chat here, a ticket summarizer there, a search box that answers in sentences. Most arrive as one more JSON route, and from the outside nothing marks it as model-backed. A model that reads untrusted input can be steered, and one that can fetch URLs or call functions can be steered into acting from inside your network. Before anyone can test that, someone has to know where the model calls are. The code already says.

Two Tags

A model call, and a model that can act

llm-query

The handler sends a prompt to a model

Chat, completion, response and message calls, agent runs, and their streaming and structured-output forms, whatever the SDK calls them. Classification, summarization and a model turning natural language into a query count too.

The model is recognised by the SDK type it resolves to, never by a bare method name, so a create or invoke on some other object is not mistaken for one.

llm-tool-callHigher risk

The same call hands the model tools

Functions the model may invoke, a provider's built-in tools such as web search or code interpreter, and MCP server tools all count. Tools bound to a model or agent at startup are carried to every call made with it.

A model with tools can do more than answer: it can fetch, query and call. That makes these routes the higher-risk surface. The tag is only ever set alongside llm-query.

In The Spec

Tagged where your team already looks

Each operation in the generated OpenAPI spec carries the tags under the x-nv-dast-sinks extension, beside the other things its handler does, such as SQL queries and outbound requests.

Coverage

Seven languages, the SDKs teams actually use

Each language lists the SDK families it models today, on the frameworks source intelligence extracts routes from.

Modelled in every language:AnthropicAzure OpenAIAmazon Bedrock runtimeBedrock agent runtime

Python

Django, Django REST Framework, Flask, FastAPI, Starlette, connexion

OpenAIGoogle Gen AILangChainLangGraphlitellmPostHog LLM wrappers

C#

ASP.NET Core, ASP.NET MVC and Web API 2

OpenAIAzure AI FoundryGoogle Gen AIMicrosoft.Extensions.AISemantic KernelMicrosoft Agent Framework

Go

net/http with chi, gorilla/mux and httprouter, gin, echo, Fiber v2

OpenAIGoogle Gen AIGoogle generative-aiVertex AIOllamalangchaingo

JavaScript and TypeScript

Express, Fastify, NestJS

OpenAIVercel AI SDKAzure AI InferenceGoogle Gen AIGoogle generative-aiVertex AILangChainLangGraphOpenAI Agents SDKClaude Agent SDKOllamaMistralCohereGroqPostHog LLM wrappers

PHP

Laravel

openai-phpPrismLaravel AI SDKorhanerday/open-aigoogle-gemini-php

Ruby

Rails, Grape

OpenAIRubyLLMLangchain.rb

Mistral and Cohere in JavaScript and TypeScript are read through the Vercel AI SDK and LangChain providers. A route that reaches a model only through an SDK not listed here carries no tag, and a missing tag means unknown, not model-free.

What The Tag Means

A reachability marker, not a verdict

What it says

A model call is reachable from this route

The tag says the route's handler reaches a call that sends a prompt to a model, and with llm-tool-call, that the call hands the model tools. It does not say that request input reaches the prompt, which parameter carries it, or what the model was told to do. That is what testing the running endpoint is for.

What is not tagged

Calls that send no prompt to answer

  • Embeddings and moderation
  • Image, audio and video generation and transcription
  • Management calls such as files, models, fine-tuning and token counting
  • Batches and queued jobs that run outside the request
  • Raw HTTP posts to a provider's API, tagged outbound-request instead
From Source To Proof

Marked from source, proven against the running app

The tags feed NightVision's AI endpoint tests, part of NightVision DAST. Source intelligence says where the model calls are. The scan proves what they can be made to do.

1

Mark

Source intelligence tags the model-backed routes in the generated spec.

2

Scan

The DAST scan tests the running app and flags the endpoints it recognizes as model-backed.

3

Steer

AI endpoint tests try to steer the model into a callback to an attacker or a read of the cloud metadata service.

4

Prove

A finding is reported only with proof: the out-of-band callback arrived, or the response came from the metadata service itself.

Where It Runs

Part of source intelligence in the NightVision CLI

LLM route detection runs as part of nightvision openapi extract, on a laptop or in your pipeline, and the tags land in the generated API spec. By default the spec is uploaded to NightVision; add --no-upload to send nothing. Your source code is never uploaded, and no LLM reads it. The same run maps every route your code serves, documented or not, through source intelligence.

FAQ

LLM route detection questions, answered.

What is LLM route detection?

Finding, from source code, the API routes whose handlers call a language model. NightVision tags each one with llm-query, and with llm-tool-call when that call also hands the model tools it can invoke.

Which languages and SDKs are covered?

Python, C#, Go, JavaScript, TypeScript, Ruby and PHP. The SDKs include OpenAI, Azure OpenAI, Anthropic, Google Gen AI, Amazon Bedrock, LangChain, LangGraph, litellm, the Vercel AI SDK, Microsoft.Extensions.AI, Semantic Kernel, RubyLLM, Prism, the Laravel AI SDK and openai-php, with the exact set depending on the language.

Does a tag mean the route is vulnerable?

No. A tag says a model call is reachable from the route's handler, not that request input reaches the prompt or that the model can be misused. NightVision's AI endpoint tests check the running app and report a finding only with proof.

Why does llm-tool-call matter?

A model handed tools can act, not only answer: fetch a URL, query data or call a function. If it can be steered, that action runs from your server with your server's access, so these are the routes to test first.

What is not tagged?

Calls that send no prompt for a model to answer: embeddings, moderation, image, audio and video, token counting, and management calls such as files, models and fine-tuning. Batches and other jobs that run outside the request are not tagged either.

Does a route without the tag make no model calls?

Not necessarily. A missing tag means no modelled call was found, for example when the handler uses an SDK that is not covered yet or hands the work to a background job. Treat it as unknown, not as model-free.

Map your AI endpoints, then prove what they can do.

Mark every model-backed route from source, then test them with NightVision's AI endpoint tests, reported only with proof.