Kereva LLM Code Scanner is a static analysis tool built to inspect Python applications that use Large Language Models (LLMs). It helps developers identify potential security weaknesses, problematic prompt patterns, and implementation issues without executing the application.
LLM-powered applications introduce risks that traditional code analysis may not fully address. Prompt construction, user input handling, model output processing, and framework-specific integrations can all create security and reliability challenges. Kereva Scanner provides specialized checks for these areas, making it useful during development, code reviews, and pre-deployment assessments.
Start by cloning the project repository and installing its Python dependencies. Make sure Git and a compatible Python environment are available before proceeding.
git clone https://github.com/rbitr/kereva-scanner.git cd kereva-scanner pip install -r requirements.txt
After installation, you can run the scanner against individual files or directories. The following examples demonstrate the basic commands:
Scan a Python file:
python main.py path/to/file.py
Scan an entire directory:
python main.py path/to/directory
Export findings as JSON:
python main.py --json --json-dir reports
JSON output is useful for preserving scan results, processing findings with other scripts, and connecting security checks to automated development pipelines.
Kereva Scanner organizes its analysis into specialized modules that examine different parts of an LLM application:
Developers can inspect the available checks before running a scan:
python main.py --list_scans
To execute a specific scanner, use the --scans option with its scanner identifier:
python main.py --scans prompt.subjective_terms
For more detailed diagnostics, enable comprehensive scanning and configure a directory for log files:
python main.py --comprehensive --log-dir logs
Kereva Scanner can support several stages of the software development lifecycle. Security teams can use it during source-code reviews to identify suspicious prompt and input-handling patterns. Developers can also use its findings to improve prompt engineering practices and review how model-generated output is processed.
Its command-line interface and JSON reporting make it a potential addition to CI/CD workflows. Automated scans can help teams identify issues before changes reach production, although static analysis should be combined with runtime testing, manual reviews, and dedicated LLM security assessments.
Kereva LLM Code Scanner provides Python developers with a focused way to inspect LLM application code for security and implementation concerns. Its specialized scanners, notebook support, selective execution, and structured reporting make it a useful addition to development security workflows.
Explore the source code, installation instructions, and available scanner options in the official Kereva Scanner GitHub repository.
For additional security testing, explore our guide to DefectDojo for managing security findings.