Skip to content
Open dashboard (opens in a new tab)

AI and LLM testing

Test AI and LLM features

If your application has a chat assistant, a summarizer, a search box that calls a model, or any other feature backed by a large language model (LLM), NightVision finds those endpoints and tests them with checks written for models. You do not need a separate product or a separate scan type. LLM testing is part of every full scan.

NightVision does two things for the AI features in an application:

  • It finds the endpoints that call a model. They are listed on the application’s LLM endpoints tab, where you can review, add and switch them off.
  • It attacks those endpoints with LLM checks. The checks try to override the model’s instructions, extract its system prompt, and steer it into making requests from your server. Each finding comes with proof that an echo or a fixed page cannot produce. See LLM security checks for the full list.

It also keeps the rest of the scan honest. Ordinary checks, such as SQL injection or code injection, are kept off the endpoints in the list. Those checks would run the model on every test request, which costs you money, and a model that repeats a test payload in its reply looks like a vulnerability when it is not.

Endpoints reach the list in four ways. The list shows the source under each path.

Source shown How it was found
from spec Your API specification marks the operation as calling a model. Specifications produced by source intelligence carry this mark, so NightVision fills the list as soon as the specification is uploaded, before any scan runs.
found in traffic During the crawl of any scan, a response carried the fingerprint of a model, such as a model provider’s reply format or token-usage fields.
found by scan A scan asked the endpoint a question only a model can answer: a small sum, plus a random code to repeat. The endpoint answered the sum, which was not in the request, and repeated the code.
manual You added the path yourself.

Each endpoint a scan confirms also raises an LLM-backed Endpoint Detected finding with severity Info, so your AI attack surface shows up in the results.

Most endpoints are added switched on. Two kinds are added switched off, for you to decide:

  • A path that serves many operations, such as /graphql, a JSON-RPC endpoint or a server action. Its label ends with many operations. Switch it on only if every operation behind it calls a model, because ordinary checks are then skipped for all of them.
  • A path the scan is not sure of. Its label ends with unsure. For example, a scan saw the path stream a reply but saw no sign of a model. Hover over the label to read why.
  1. Select Applications in the rail and open an application.
  2. Select the LLM endpoints tab. The number beside the tab name is the number of endpoints in the list. The same count appears as a chip under the application name.
The LLM endpoints tab of an API application, with four endpoints in use and one not in use.
The LLM endpoints tab lists each path with its source and a switch.

The tab has two groups:

  • In use: endpoints that are switched on. Scans treat them as AI-backed and skip ordinary active checks on them.
  • Not in use: endpoints that are switched off. Scans treat these as ordinary endpoints.

The note at the top of the tab tells you how paths are read for this application:

  • For an API application, paths are relative to the application URL. On an application at https://api.example.com/v1, /chat means https://api.example.com/v1/chat.
  • For a web application, paths start at the host root, whatever page the application URL names. /api/chat means https://www.example.com/api/chat.

A path covers every HTTP method. Upper and lower case and a trailing slash make no difference, so /Chat/ and /chat are the same endpoint.

An application can have at most 100 LLM-backed endpoints, including the ones that are switched off.

A full scan finds AI endpoints as it goes. To fill the list first, without waiting for a full scan, run the quick scan from the tab.

  1. On the LLM endpoints tab, select Scan.
  2. In the Scan for AI endpoints dialog, choose an authentication under Authentication (optional). With an authentication, the scan logs in and also reaches the endpoints behind the login. With None, it reaches only the pages that need no login.
  3. Select Start scan.
The Scan for AI endpoints dialog with an optional Authentication field and a Start scan button.
Pick an authentication so the scan can reach endpoints behind the login.

The scan crawls the application and checks each page for an AI model. It runs no other checks. The button reads Scanning while it runs, and you can follow the run on the Scans page, where its type shows as AI endpoints. When it ends, the endpoints it confirmed appear in the list, switched on.

An AI endpoint scan does not count as the application’s latest scan and does not change which findings are new or fixed.

Add a path yourself when you know an endpoint calls a model and a scan has not reached it yet.

  1. On the LLM endpoints tab, select the Add LLM endpoint button (the plus sign beside the search box).
  2. Enter the path in Endpoint path, for example /api/chat. Write a path parameter as {name}, for example /users/{id}/chat. A parameter matches any one path segment.
  3. Select Add.
The Add LLM endpoint dialog with an Endpoint path field and an Add button.
The dialog repeats how paths are read for this application.

Add each endpoint on its own. To change a path later, select the pencil icon on its row. If you rename an endpoint that a scan or the specification found, it counts as added by hand from then on.

Use the switch on a row to turn an endpoint off or back on.

  • Switch an endpoint off when it does not call a model. Scans then run every ordinary check on it again. The choice is kept: later scans do not switch it back on.
  • Only endpoints added by hand can be deleted. Select the trash icon on the row, or tick several rows and select Delete selected. A later scan or specification upload can add a deleted path back if it finds it. To stop using an endpoint and keep that choice, switch it off instead.

You need permission to change the application to edit the list, and permission to start scans to run Scan for AI endpoints. See Members and roles.

There is nothing extra to turn on. Start a scan the usual way, from the dashboard, the CLI, a pipeline or a schedule. See Start a scan.

During the scan:

  • The crawl reaches your pages and API operations, and notes any response that looks like a model’s reply.
  • The LLM checks run. The scan also confirms new AI endpoints and adds them to the list.
  • Ordinary active checks run on everything except the endpoints that are In use on the LLM endpoints tab.

To get the most from the LLM checks:

  • Scan with an authentication. Most assistants sit behind a login. See Authentication.
  • Keep the LLM checks selected. Every check runs by default. See choose which checks run.
  • Review the list after the first scan. Switch off anything that does not call a model, and decide on the paths that were added switched off.

LLM findings appear with the rest of the scan’s findings. Each one shows the request that was sent, the reply that proves it, and a command to reproduce it. See Findings.

On the first scan of an application, the list of LLM endpoints can still be empty when ordinary checks start. A model that repeats a test payload in its reply can then trip a check written for ordinary servers. A summarizer that echoes a code injection probe is one example.

NightVision dismisses these for you. When an ordinary active check raises a finding on an endpoint that is In use in the list, the finding is set aside as a false positive automatically and hidden from the scan’s findings. This happens during the scan and again when it ends. The first scan then reads like every later one.

What is never dismissed this way:

  • Findings from the LLM checks themselves.
  • Findings from passive checks and from Nuclei templates.
  • Out-of-band findings, where your server called an address NightVision controls. A received callback is a real interaction, not an echo.
  • Findings on any path that is not an LLM endpoint.

Each automatic dismissal is stored as a False positive disposition on the application, so later scans treat the same finding the same way. To review them, open the application’s Setup tab and select Dispositions. You have two ways to undo one:

  • Remove one. Open the row menu and select Remove. New scans stop hiding matching findings.
  • Bring back a whole endpoint. Switch the endpoint off on the LLM endpoints tab. Automatic dismissals for that path stop applying, and the next scan reports its ordinary findings again.
The Dispositions panel for payments-api. Three false positive rows for Server Side Code Injection, Remote OS Command Injection and Server Side Template Injection read No reason given and name no person under Set by. A fourth row, SQL Injection, was set by a person with a reason and a review date.
Automatic dismissals have no person under Set by.

A decision a person made is never changed by automatic dismissal. If someone already marked the same finding, that decision stays as it is.

Automatic dismissal is on for every organization. To turn it off for yours, contact support@nightviz.ai. For how dispositions work in general, see Triage.

Bring source intelligence for stronger proof

Section titled “Bring source intelligence for stronger proof”

A scan can find and test AI endpoints with no access to your code. Adding source intelligence makes the results stronger in three ways:

  • The list is right before the first scan. nightvision openapi extract reads your code, marks each operation that sends a prompt to a model, and uploads the specification to the application. Those operations appear on the LLM endpoints tab as from spec, including endpoints a crawl would not reach.
  • System prompt leakage is proven against the real prompt. Source intelligence records the system prompt each endpoint sends to its model. The LLM System Prompt Leakage check compares the model’s replies with that prompt, so a finding means the actual instructions came back, not something that only looks like a prompt. This check runs on the endpoints whose prompt is in the specification.
  • Findings point at code. As with every finding on a specification from source intelligence, an LLM finding links to the file and line of the handler. See Code traceback.

When the specification changes, the list follows it. An endpoint the specification no longer marks is removed, unless you have switched or edited it. Your own choices are never overwritten by an upload.

For the specification fields that carry this information and the languages and model libraries that are covered, see Extract an OpenAPI specification and Framework support.