Skip to main content
The Scanner module performs AST-based static analysis of your AI codebase — detecting features, extracting prompts, and mapping workflows. Scan results can be uploaded to the Valiqor backend for deeper analysis and attached to Failure Analysis runs.

Quick start

Convenience function

For one-liner scans:

What the scanner does

The scanner runs a local pipeline:
1

AST analysis

Parses your Python codebase using abstract syntax trees to understand code structure.
2

Feature detection

Identifies AI features: LLM calls, retrieval functions, tool definitions, agent patterns.
3

Prompt extraction

Extracts prompt templates, system messages, and few-shot examples from your code.
4

Workflow mapping

Maps execution flow: which functions call which, how data flows through your pipeline.
5

Upload (optional)

If valiqor_intelligence is enabled, uploads results to the backend for deeper Stage 2+ analysis.

Scanner configuration

The scanner uses the same .valiqorrc config file:

scan() method

ScanResult fields


Local-only scanning

For environments without backend access:

Integration with Failure Analysis

When run_scan=True (default) in FA, scan data is automatically attached:
This gives FA additional context about your codebase structure for more accurate failure classification.

CLI


Failure Analysis →

Use scan data for deeper failure analysis.

Tracing →

Combine scanning with runtime tracing.