Skip to main content

flightline discover

The discover command scans your repository to find AI operations. It builds a map of where your application interacts with LLMs, helping you understand the surface area of your AI features.

Usage

flightline discover [PATH]
By default, it scans the current directory.

How it Works

Discovery uses static analysis and heuristics to identify:
  • SDK Verifications: Direct usage of supported LLM SDKs (OpenAI, Anthropic, etc.).
  • Prompt Sources: Where prompts are defined (inline, files, or external APIs).
  • Data Sinks: Where AI outputs are sent (database, user UI, external APIs).
  • Risk Tiers: Assigns a risk level (Critical, High, Medium, Low) based on the sensitivity of inputs and the impact of the output sink.

Key Options

OptionDescription
--output, -oPath to save the discovery results (default: flightline.discovery.json).
--languages, -lComma-separated list of languages to scan (e.g., python,typescript).
--baselinePath to a previous discovery file to compare against and show changes.
--syncUpload results to Flightline Mission Control (requires FLIGHTLINE_API_KEY).

Output

The command generates a flightline.discovery.json file. This file includes:
  • A list of all detected AI call sites.
  • Inferred project context and domain.
  • A “Scenario Space” mapping out the dimensions of variance in your inputs.

Example

$ flightline discover

FOUND 12 AI OPERATIONS:
 OPENAI: 8
 ANTHROPIC: 3
 CUSTOM: 1

TOP RISK ANALYSIS:
┌──────────────────────────────────────────────────────────────────────────┐
  [CRITICAL] app/api/v1/payments.py:42                                    │
   └─ Sinks: DATABASE | EXTERNAL_API
└──────────────────────────────────────────────────────────────────────────┘

 Discovery saved to flightline.discovery.json

Next Steps

Once discovery is complete, you can use the output to scaffold your project configuration or jump straight to learning from your data.

Scaffold Config

Generate a flightline.yaml from your discovery results.