Skip to content

Latest commit

 

History

History
138 lines (100 loc) · 3.65 KB

File metadata and controls

138 lines (100 loc) · 3.65 KB

Getting Started

This guide walks you through installing SentinelAI, running your first security scan, and understanding the results.

Prerequisites

  • Python 3.11 or later
  • pip or uv package manager
  • Git (for source installation)

Installation

From PyPI (recommended)

pip install sentinelai

From source

git clone https://github.com/threatvec/SentinelAI.git
cd SentinelAI
pip install -e ".[dev]"

With optional dependencies

# LLM Firewall support
pip install sentinelai[firewall]

# Agent monitoring support
pip install sentinelai[monitor]

# All features
pip install sentinelai[all]

First Scan

Command line

Run a scan against a target directory:

sentinelai scan ./my-project

With specific options:

sentinelai scan ./my-project \
  --severity high \
  --scanners code,secrets \
  --format json \
  --output report.json

Python API

from sentinelai import SentinelEngine

engine = SentinelEngine()
results = engine.scan("./my-project")

print(f"Found {results.total_findings} issues")
for finding in results.findings:
    print(f"  [{finding.severity.value}] {finding.rule_id}: {finding.message}")

Understanding Results

Each finding contains the following information:

Field Description
rule_id Unique identifier (e.g., SAI-SQL-001)
severity critical, high, medium, low, or info
file_path Path to the affected file
line_number Line where the issue was found
message Human-readable description of the vulnerability
category Vulnerability category (e.g., sql_injection)
confidence Detection confidence: high, medium, or low
cwe_id Associated CWE identifier, if applicable

Severity levels

  • Critical -- Exploitable vulnerabilities that pose an immediate risk (e.g., hardcoded production credentials, RCE vectors).
  • High -- Serious vulnerabilities that should be fixed before deployment (e.g., SQL injection, command injection).
  • Medium -- Issues that should be addressed but may require specific conditions to exploit (e.g., XSS, insecure defaults).
  • Low -- Minor issues or code quality concerns with limited security impact.
  • Info -- Informational findings, best-practice recommendations, or items that need manual review.

Example output

[!!!] CRITICAL  SAI-SEC-003
       src/config.py:42
       Hardcoded AWS credentials detected (AKIAIOSFODNN7...)

[!! ] HIGH      SAI-SQL-001
       src/db/users.py:18
       SQL query built with string concatenation using user input

[!  ] MEDIUM    SAI-XSS-002
       src/views/comments.py:31
       User input rendered in HTML template without escaping

Configuration

Create a sentinelai.yaml file in your project root for persistent configuration:

severity_threshold: medium
scanners:
  - code
  - secrets
  - dependencies
exclude:
  - "tests/**"
  - "**/*.min.js"
  - "node_modules/**"

See the Configuration Reference for all available options.

Next Steps