An end-to-end, AI-powered security scanner and auto-remediation platform. Run security agents locally, detect vulnerabilities, and self-heal breaking API changes automatically.
OpenSecAI orchestrates independent, local LangGraph agents managed via a modern Tauri-based desktop application. Run scans, interact with live logging, and review AI-driven patches without your source code or secrets ever leaving your machine.
- Local & secure. A Tauri desktop shell hosting a React frontend paired with a local FastAPI sidecar. No SaaS APIs, no external code uploads.
- Autonomous self-healing. Integrated LLM code-patching and Claude Code agents automatically remediate vulnerabilities, upgrade packages, and fix compilation errors.
- Human-in-the-loop (HITL). Uses LangGraph interrupts to pause, verify, and request decisions when build or analysis checks fail.
- Currently Go-first. Dependency scanning is currently supported for Go (Golang) projects, with support for more security domains (container scanning, SAST, secrets, IaC, SBOM, licensing) and programming languages planned for future releases.
Want a fully local, agentic security analysis pipeline running right on your workstation? You're in the right place.
- Single-User Desktop First: Designed to run securely on a developer's local machine without exposing source code or secrets to external SaaS endpoints.
- Autonomous Agents: Built using LangGraph, agents scan target codebases, analyze results, and attempt self-healing/auto-remediation (using LLMs and Claude Code subprocesses) directly on the local filesystem.
- Human-in-the-Loop (HITL): Utilizes LangGraph interrupts to pause execution and request human guidance (e.g., when breaking changes are detected and code modification is needed).
- FastAPI Sidecar Backend: A Python-based FastAPI server runs as a local sidecar managed by the Tauri app, running on
127.0.0.1and secured with token handshakes. - SQLite Persistence: SQLModel-backed SQLite database tracks projects, execution jobs, live agent event logs, and historical findings.
- Typesafe Schema Codegen: Pydantic models automatically export to JSON Schemas, which are then compiled directly to TypeScript types for UI consumption.
|
Landing Page
|
Agent Dashboard
|
|
Run Configuration
|
Live Job Logs & Progress
|
|
Human-in-the-Loop Decision
|
Historical Reports Browser
|
OpenSecAI consists of three main components: the Rust-based Tauri container, the React-based frontend webview, and the Python-based API sidecar running LangGraph agents.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Desktop App Container (Tauri Process) β
β β
β βββββββββββββββββββ Tauri IPC ββββββββββββββββββββββββββββββββ β
β β React + Vite β ββββββββββββββΊ β Rust Shell (src-tauri) β β
β β (Webview UI) β invoke / eventβ β’ Window management β β
β β desktop/src β β β’ Sidecar supervisor β β
β ββββββββββ¬βββββββββ β β’ Process termination β β
β β HTTP + WS β (SIGKILL via active_pid) β β
β β (127.0.0.1:8765) ββββββββββββββ¬ββββββββββββββββββ β
β βΌ β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββ β
β β Python Sidecar β FastAPI (opensecai.api) β β β
β β ββββββββββββ ββββββββββββ ββββββββββββ βββββΌβββββββ β β
β β β Routes β β WS App β β Runtime β β Storage β β β
β β β /agents β β /ws/... β β JobMgr β β SQLite β β β
β β β /jobs β β stream β β EventBus β β stores β β β
β β β /projectsβ β β β registry β β β β β
β β β /settingsβ β β β β β β β β
β β ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ ββββββ¬ββββββ β β
β β β β β β β β
β β βββββββββββββββ΄βββββββ¬βββββββ β β β
β β βΌ βΌ β β
β β ββββββββββββββββββββ ββββββββββββββββββββ β β
β β β Agent Runners β β opensecai.db β β β
β β β (dep_scan, ...) β β (Jobs/Projects/ β β β
β β β LangGraph β β Settings) β β β
β β ββββββββββ¬ββββββββββ ββββββββββββββββββββ β β
β β β β β
β βββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
ββββββββββββββββββββββββββββββββββββ
β Target Filesystem (Per Project) β
β <root_dir>/ β
β workspaces/<repo>/ β β Target repository source code
β reports/<proj>/ β
β <agent>/ β
β index.json β β Run logs and history
β index.json.lock β β Cross-agent concurrent lock
β <run_id>/ β
β start.json β β Pre-healing scan report
β end.json β β Post-healing scan report
β diff.json β β Fixed/persisted vulns diff
β events.jsonl β β Replayable log stream
β active_pid β β Process PID (for instant kill)
ββββββββββββββββββββββββββββββββββββ
Make sure you have the following installed on your machine:
- Python:
>= 3.13 - Rust:
>= 1.77.2(Tauri v2 requirement) - Node.js:
>= 20.0 - uv: Python package and project manager (recommended)
- Go (Golang): Required (the tool currently supports Go projects only)
- Trivy: Vulnerability scanner (required for
dep_scan)
Start by cloning the repository and entering the project directory:
git clone https://github.com/hitesharma/OpenSecAI
cd OpenSecAINext, choose one of the options below to install dependencies:
If you are running on a Debian/Ubuntu-based Linux environment, you can run our automated script to verify and install all system prerequisites, Node.js, Rust, Trivy, and uv, sync the Python virtual environment, and install the frontend packages:
make setupTo manually set up your environment:
- Install Python dependencies:
uv sync
- Install frontend dependencies:
cd desktop npm install cd ..
OpenSecAI stores all analysis data locally. When you configure the application (via settings in the UI), you define a Service Data Directory (the global data root) which holds the workspaces and scan reports for all projects created within the app.
To prepare a repository for scanning:
- Locate your configured Service Data Directory (in Dev/CLI mode, this defaults to the root of this cloned
OpenSecAIrepository). - Clone the target repository you want to scan directly inside the
workspaces/directory of your Service Data Directory:# Navigate to your Service Data Directory cd /path/to/your/service-data-dir # Clone the target repository into workspaces/ mkdir -p workspaces cd workspaces git clone <your-target-repo-url>
- In the Tauri GUI (or when setting the
PROJECTenvironment variable on the CLI), specify the folder name of the cloned repository (e.g.,your-target-repo) as the Workspace Name.
All scan results, events, and diff reports will be generated automatically in the reports/ directory adjacent to workspaces/ (categorized by project name).
To start the app in development mode (spawns both the Tauri desktop frame and the Python sidecar automatically):
make run-devTo run the default agent (dep_scan) directly on your CLI against a target workspace:
# Set target project and workspace name
export PROJECT=my-go-service
# Target workspace must exist under workspaces/my-go-service/ and contain a go.mod
make runIf you want to debug FastAPI routes or test the API via tools like Swagger UI (http://localhost:8765/docs):
make apiWe use a central Makefile to consolidate standard development actions.
| Command | Action |
|---|---|
make install |
Create virtual environment and sync python dependencies |
make run |
Run the dep_scan agent on CLI using main.py |
make run-dev |
Start Tauri GUI app in development mode |
make api |
Boot up the FastAPI sidecar server |
make lint |
Run Ruff linter checks |
make format |
Reformat python code using Ruff formatter |
make typecheck |
Run Pyright static type analysis |
make codegen |
Export Pydantic models to JSON schemas and compile to TypeScript interfaces |
make clean |
Clean up build artifacts and .venv |
Follow this recipe to add a new security domain agent:
- Scaffold Directory: Create a subpackage inside
opensecai/agents/:mkdir -p opensecai/agents/<agent_name>/prompts touch opensecai/agents/<agent_name>/{__init__,runner,graph,nodes,state}.py
- Register Entrypoint: Register your agent's runner in
pyproject.tomlunder[project.scripts]:opensecai-<agent_name> = "opensecai.agents.<agent_name>.runner:main" - Sync Environment: Run
uv syncto update the script bindings in your environment. - Implement Graph & State:
- Define the typed
AgentStateinstate.py(with thread safety variables likelog_fnandcancel_event). - Inherit the context and register nodes using LangGraph's
StateGraphingraph.py/nodes.py. Ensure all paths are safely resolved viaopensecai/core/paths.py. - Implement execution tracking using
_run_trackedfor any spawned subprocesses so they can be terminated properly.
- Define the typed
- Configure Human-in-the-Loop (HITL) Pauses (Optional):
If your agent needs to pause and prompt the user for decisions:
- Create
contracts.pyin your agent package and define/register aPauseContractwith selection options:from opensecai.runtime.notification_contracts import register, PauseContract, PauseOption register(PauseContract( name="<agent_name>.some_decision", prompt="How should the agent proceed?", options=( PauseOption(value="go", label="Continue", desc="...", variant="primary"), PauseOption(value="stop", label="Abort", desc="...", variant="ghost"), ), ))
- In your graph nodes, call
interrupt({"contract": "<agent_name>.some_decision", "context": {...}})to trigger the pause. - Import this contracts module inside your agent's registry runner in
agent_registry.py(e.g.import opensecai.agents.<agent_name>.contracts) so the registration side-effect occurs at startup.
- Create
- Register in Sidecar Registry: Add your runner function mapping to the
AGENT_RUNNERSdictionary insideopensecai/runtime/agent_registry.py:Note: Registering the runner in this dictionary publishes the agent to the backend routes (GET /agents and POST /agents/{name}/run).AGENT_RUNNERS = { "dep_scan": _run_dep_scan, "<agent_name>": _run_<agent_name>, }
- Register in Frontend (UI): Add your agent's metadata (id, name, title, description, and icon) to the
AGENTSarray insidedesktop/src/mockData.tsso that it renders as an active tile on the dashboard:export const AGENTS: Agent[] = [ { id: "<agent_name>", name: "<agent_name>", title: "My Scan", icon: "shield", enabled: true, short: "...", desc: "...", scanner: "...", scannerNote: "..." }, ... ];
- Add Tests: Create unit tests under
tests/unit/agents/and mocking fixtures undertests/fixtures/.
Note
The test directories (tests/unit/, tests/integration/, tests/e2e/) are currently scaffolded skeleton structures containing __init__.py files. Actual test cases are planned for implementation in future phases.
If you wish to set up tests, you will first need to install pytest (e.g., uv pip install pytest or add it to pyproject.toml):
# Run all unit tests once pytest is installed
uv run pytest tests/unit
# Run integration tests
uv run pytest tests/integrationThis project is licensed under the Apache 2.0 License. See the LICENSE file for more information.





