Skip to main content

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.
from valiqor import ValiqorClient

client = ValiqorClient(api_key="your-api-key", project_name="my-app")
scanner = client.scanner
Or standalone:
from valiqor.scanner import ValiqorScanner

scanner = ValiqorScanner()
scanner.configure(api_key="your-api-key", project_name="my-app")

ValiqorScanner

Constructor

ValiqorScanner()
The scanner loads configuration from .valiqorrc on initialization. Use configure() to set credentials programmatically.

Properties

PropertyTypeDescription
is_configuredboolWhether the scanner has valid API credentials.
project_nameOptional[str]The active project name.
backend_urlstrThe backend URL.

configure()

Set scanner configuration programmatically. Returns self for method chaining.
def configure(
    self,
    api_key: str = None,
    project_name: str = None,
    backend_url: Optional[str] = None,
    local_output_dir: Optional[str] = None,
    valiqor_intelligence: bool = None,
    environment: str = None,
    debug: bool = None,
    verbose: bool = False,
) -> ValiqorScanner
ParameterTypeDefaultDescription
api_keystrNoneValiqor API key.
project_namestrNoneProject name.
backend_urlOptional[str]NoneBackend URL override.
local_output_dirOptional[str]NoneLocal directory for scan output files.
valiqor_intelligenceboolNoneWhether to upload results to Valiqor backend.
environmentstrNoneEnvironment label.
debugboolNoneEnable debug output.
verboseboolFalseEnable verbose logging.
scanner = ValiqorScanner().configure(
    api_key="your-api-key",
    project_name="my-app",
    verbose=True
)

scan()

Run a scan on a repository or directory.
def scan(self, repo_path: str, skip_upload: bool = False) -> ScanResult
ParameterTypeDefaultDescription
repo_pathstrPath to the repository or directory to scan.
skip_uploadboolFalseIf True, only scan locally without uploading results.
Returns: ScanResult
result = scanner.scan("./my-ai-app")
print(f"Status: {result.status}")
print(f"Files generated: {result.files_generated}")
print(f"Scan ID: {result.scan_id}")

ScanResult

Returned by scan(). Contains scan metadata and output file paths.
AttributeTypeDescription
statusstrScan status ("success" or "error").
project_namestrProject name used for the scan.
scan_idstrUnique identifier for this scan.
local_output_dirstrDirectory where output files were written.
files_generatedList[str]List of generated output file paths.
files_uploadedList[str]List of files uploaded to the backend.
upload_responseOptional[Dict]Backend response from upload (if applicable).
errorOptional[str]Error message if scan failed.
timestampstrISO timestamp of the scan.
result_dict = result.to_dict()

quick_scan() — Convenience Function

A one-call function that creates a scanner, configures it, and runs a scan:
from valiqor.scanner import quick_scan

result = quick_scan(
    api_key="your-api-key",
    project_name="my-app",
    repo_path="./my-ai-app",
    verbose=True
)
ParameterTypeDefaultDescription
api_keystrValiqor API key.
project_namestrProject name.
repo_pathstrPath to scan.
backend_urlstrNoneBackend URL override.
verboseboolFalseEnable verbose logging.