Overview
ValiqorScanner performs static analysis on your codebase to detect AI-related patterns — LLM calls, tool definitions, retrieval pipelines, and prompt templates. Scan results can be uploaded to the Valiqor backend for use in failure analysis and project setup.
ValiqorScanner
Constructor
.valiqorrc on initialization. Use configure() to set credentials programmatically.
Properties
| Property | Type | Description |
|---|---|---|
is_configured | bool | Whether the scanner has valid API credentials. |
project_name | Optional[str] | The active project name. |
backend_url | str | The backend URL. |
configure()
Set scanner configuration programmatically. Returns self for method chaining.
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | None | Valiqor API key. |
project_name | str | None | Project name. |
backend_url | Optional[str] | None | Backend URL override. |
local_output_dir | Optional[str] | None | Local directory for scan output files. |
valiqor_intelligence | bool | None | Whether to upload results to Valiqor backend. |
environment | str | None | Environment label. |
debug | bool | None | Enable debug output. |
verbose | bool | False | Enable verbose logging. |
scan()
Run a scan on a repository or directory.
| Parameter | Type | Default | Description |
|---|---|---|---|
repo_path | str | — | Path to the repository or directory to scan. |
skip_upload | bool | False | If True, only scan locally without uploading results. |
ScanResult
ScanResult
Returned by scan(). Contains scan metadata and output file paths.
| Attribute | Type | Description |
|---|---|---|
status | str | Scan status ("success" or "error"). |
project_name | str | Project name used for the scan. |
scan_id | str | Unique identifier for this scan. |
local_output_dir | str | Directory where output files were written. |
files_generated | List[str] | List of generated output file paths. |
files_uploaded | List[str] | List of files uploaded to the backend. |
upload_response | Optional[Dict] | Backend response from upload (if applicable). |
error | Optional[str] | Error message if scan failed. |
timestamp | str | ISO timestamp of the scan. |
quick_scan() — Convenience Function
A one-call function that creates a scanner, configures it, and runs a scan:
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key | str | — | Valiqor API key. |
project_name | str | — | Project name. |
repo_path | str | — | Path to scan. |
backend_url | str | None | Backend URL override. |
verbose | bool | False | Enable verbose logging. |
Related
- Code Scanning Workflow — Step-by-step scanning guide
- Configuration —
.valiqorrcand env var reference