SecAI is an intelligent, cross-platform security analysis CLI. It elevates standard security scanners (like Semgrep and Trivy) by enriching their raw findings with AI-generated explanations, concrete attack scenarios, precise remediation steps, and secure code examples.
Whether you're a developer trying to quickly patch a vulnerability or a security engineer triaging a repository, SecAI acts as your personal application security assistant.
SecAI is built entirely as an Open Source tool. We believe that robust security tooling should be accessible, transparent, and community-driven.
- Provider Agnostic: Bring your own AI. We support OpenAI, Gemini, OpenRouter, and local open-source models via Ollama out of the box!
- Interactive Dashboard: Running
secaiacts as a dynamic dashboard that checks your system dependencies and AI configuration. - Privacy First: Because it supports Ollama, you can run powerful 120B+ parameter models completely locally without ever sending proprietary code off your machine.
SecAI distributes pre-compiled native binaries using GraalVM. You do not need Java installed to run it!
Linux & macOS:
curl -sSL https://raw.githubusercontent.com/SecAI-Cam/SecAI/main/install.sh | bashWindows (PowerShell):
irm https://raw.githubusercontent.com/SecAI-Cam/SecAI/main/install.ps1 | iexIf you want to run it from source, ensure you have Java 21+ installed.
git clone https://github.com/SecAI-Cam/SecAI.git
cd SecAI
./mvnw clean package -DskipTests
java -jar target/secai-0.0.1-SNAPSHOT.jarSecAI orchestrates underlying tools. Ensure the following are installed:
- Semgrep (
pip install semgreporbrew install semgrep) - Trivy (
apt-get install trivy,brew install trivy, orwinget install Aquasecurity.Trivy) - Docker (Required only for the
secai verifyPentest Sandbox)
Note: If you run secai directly, the interactive dashboard will automatically tell you if these are missing and provide exact copy-paste installation commands for your OS.
flowchart TD
User([User]) --> SecAiCommand[SecAI CLI]
subgraph "Orchestration & Data Flow"
SecAiCommand --> |Initiates Scan| ScannerEngine
ScannerEngine -- "Raw Findings" --> AIEngine
AIEngine -- "Enriched Context" --> ReportManager
SecAiCommand --> |Initiates Verify| VerifyEngine
VerifyEngine -- "Generates Plan" --> AIEngine
VerifyEngine -- "Executes Sandbox" --> Docker[Kali Docker Sandbox]
end
subgraph "Security Scanners"
ScannerEngine -.-> Semgrep
ScannerEngine -.-> Trivy
end
subgraph "AI Providers"
AIEngine -.-> Ollama
AIEngine -.-> OpenAI
AIEngine -.-> Gemini
end
Semgrep --> CodeBase[(Source Code)]
Trivy --> CodeBase
ReportManager -- "HTML / JSON" --> Output[(Reports)]
Before scanning, you must connect SecAI to an AI provider. You can use local models (Ollama) or cloud providers (OpenAI, Gemini, OpenRouter).
# Connect to OpenAI
secai config --provider openai --api-key "YOUR_KEY" --model "gpt-4o"
# Connect to Google Gemini
secai config --provider gemini --api-key "YOUR_KEY" --model "gemini-2.5-pro"
# Use local, private AI with Ollama
secai config --provider ollama --url http://127.0.0.1:11434 --model llama3Note: Your configuration is saved locally to your project in secai.yml.
Run a static analysis scan to discover code vulnerabilities and misconfigurations.
secai scan .This runs Semgrep and Trivy against your current directory, aggregating the results into a unified report.
List all vulnerabilities discovered during the most recent scan.
secai listEach finding is given a unique ID (e.g., 1, 2, 3) which you will use in subsequent commands.
Get an in-depth AI breakdown of a specific vulnerability.
secai explain 1The AI will read the vulnerable file, explain the attack vector, and discuss why it is dangerous in your specific context.
Automatically generate a patch for the vulnerability.
secai fix 1SecAI will use Claude Code-Style Auto-Fix logic to determine the exact lines of code that need changing, and will interactively ask you to apply the patch directly to your file.
Requires Docker. SecAI v2 introduces a Human-in-the-Loop Dynamic Application Security Testing (DAST) engine. Instead of just static analysis, SecAI can autonomously attack the running target to verify if the static findings are actually exploitable.
Step A: Setup the Sandbox Builds an isolated Kali Linux Docker container pre-loaded with security tools (Nmap, ffuf, SQLMap, Nuclei, Metasploit).
secai verify --setupStep B: Plan Verification (Optional) Generate an AI-driven attack plan based on your static findings without executing it.
secai verify http://localhost:8080 --plan-onlyStep C: Execute Pentest
Launch the Agentic Pentest Engine. The AI will dynamically analyze your findings, formulate a plan, and execute tools within the Sandbox. The AI iteratively analyzes the output of each tool (e.g., parsing open ports from nmap to feed into ffuf) until it proves or disproves the vulnerability.
secai verify http://localhost:8080Maintain a conversational session with the AI about your repository. The AI retains context of your scan results and codebase.
secai chatExport your findings into professional HTML or Markdown reports for stakeholders.
secai report --format htmlsecai doctor: Diagnose system health, check AI connectivity, and verify scanner installations.secai update: Update the internal vulnerability databases (e.g., Trivy definitions) to ensure you detect the latest CVEs.
We are constantly improving SecAI. Here is our high-level roadmap:
- Core Scanning: Integration with Semgrep and Trivy.
- AI Enrichment: Multi-provider support (Ollama, OpenAI, Gemini).
- Dashboard Experience: Interactive CLI entrypoint.
- Agentic Verification: Autonomous AI Pentest Engine utilizing isolated Kali Linux Sandboxes.
- Context Optimization: Summarizer Sub-Agents and RAG-based context slicing for handling massive tool outputs.
- Automated Remediation: Enhance
secai fixto gracefully apply multi-file patches via AST manipulation. - CI/CD Integration: Native GitHub Actions and GitLab CI templates for blocking builds.
- Expanded Scanners: Add support for Bandit (Python), Gitleaks (Secrets), and Checkov (IaC).
- Vector Memory: Give the AI context of previous scans and fixes across the repository using a local vector database.