hermes-review-sentinel โ Security Pair Programmer (SPP)
A deterministic + AI security scanner with auto-fix and contextual learning for Python/TypeScript projects. Runs 100% locally, zero cloud dependencies.
Quick Start
# Install
pip install hermes-review-sentinel
# Or run via Docker
docker run --rm -v $(pwd):/workspace jhoxgamer/hermes-review-sentinel:latest . --auto-fix --auto-improve
# Scan + auto-fix secrets + apply contextual improvements
hermes-sentinel . --auto-fix --auto-improve
# Just scan (report only)
hermes-sentinel .
What It Does
| Feature | Description |
|---|---|
| Auto-Fix Secrets | Detects hardcoded secrets (Stripe, GitHub, OpenAI, Slack, generic) and replaces with os.getenv() / process.env, updates .env.example |
| Security Pair Programmer (SPP) | Learns your project's patterns (auth decorators, CSRF handling, env var style) and suggests/applies improvements |
| Zero Loss Mutation | AST-based edits preserve indentation, comments, quotes, formatting |
| Line Drift Prevention | Reverse-order editing prevents index corruption on multi-edit files |
| 100% Local / Offline | Zero cloud calls, runs fully offline with Ollama/local models |
| Contextual Detection | Next.js/TS detection restricted to app/api/, pages/api/, actions/, "use server" |
| Performance Filters | Skips node_modules, venv, .git, files >1MB |
CLI Usage
# Scan only (report mode)
hermes-sentinel .
# Auto-fix hardcoded secrets
hermes-sentinel . --auto-fix
# Apply contextual improvements (SPP)
hermes-sentinel . --auto-improve
# Both together
hermes-sentinel . --auto-fix --auto-improve
# Target specific file
hermes-sentinel src/auth.py --auto-fix
Example Output
๐ [Hermes Sentinel] Escaneando 35 arquivo(s)...
โ
[AUTO-FIX] src/auth.py: 2 segredo(s) removido(s) โ os.getenv() aplicado.
โโ Variรกveis adicionadas ao .env.example: STRIPE_SECRET_KEY, JWT_SECRET
๐ก [SPP] src/routes/admin.py:12
๐ก Rota sem autenticaรงรฃo detectada. Padrรฃo do projeto: `@depends(get_current_user)`.
โจ [SPP] Melhorias aplicadas com sucesso em src/routes/admin.py
๐ [Resumo]
Arquivos com issues: 2
Secrets corrigidos: 2
Melhorias SPP aplicadas: 1
Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Source Code โโโโโโถโ AST Parser โโโโโโถโ Security โ
โ (Python/TS) โ โ (ast.parse) โ โ Pair Programmerโ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโโโโผโโโโโโโโโโโ
โ Auto-Fix Engine โ
โ (Zero Loss) โ
โโโโโโโโโโโโโโโโโโโโโโโ
Rules & Patterns
| Category | Patterns |
|---|---|
| Stripe | |
| GitHub | ghp_*, gho_* |
| OpenAI | sk-* (51 chars) |
| Slack | xoxb-*, xoxp-* |
| Generic | secret_key, api_key, password, token, jwt_secret |
Configuration
rules/python-security.yamlโ P0/P1 security rules for Python/FastAPIrules/typescript-security.yamlโ P0/P1 security rules for TypeScript/Next.jsrules/python-quality.yamlโ Clean code / best practices for Pythonrules/typescript-quality.yamlโ Clean code / best practices for TypeScript
Installation
# From PyPI (when published)
pip install hermes-review-sentinel
# From source
git clone https://github.com/jhoxgamer/hermes-review-sentinel.git
cd hermes-review-sentinel
pip install -e .
# Docker
docker build -t hermes-review-sentinel .
docker run --rm -v $(pwd):/workspace hermes-review-sentinel . --auto-fix --auto-improve
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Run CLI directly
python -m src.sentinel_server . --auto-fix --auto-improve
# Validate rules
semgrep scan --config=rules/ --test
Security
- 100% Local Execution โ No code leaves your machine
- No Telemetry โ Zero tracking, zero cloud calls
- Fail-Safe โ Invalid edits are rolled back automatically
License
MIT โ Free for personal and commercial use.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hermes_review_sentinel-2.1.0.tar.gz.
File metadata
- Download URL: hermes_review_sentinel-2.1.0.tar.gz
- Upload date:
- Size: 31.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab1ab7d023d2c2985e9a34b1e6150910def0b2a9e89d42f7fa68516814b97e7d
|
|
| MD5 |
900afdb41e30c641ff6ecb4afa25fd18
|
|
| BLAKE2b-256 |
b1d1f46f2f69ba51cc046531b9076e0b0b0061086982a5573aa0dbfdb6c5648c
|
File details
Details for the file hermes_review_sentinel-2.1.0-py3-none-any.whl.
File metadata
- Download URL: hermes_review_sentinel-2.1.0-py3-none-any.whl
- Upload date:
- Size: 26.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3d7fb5090fa185cdf9ed45aa50abedbd100e71fd9186cb01c0ee52ae585a1ed
|
|
| MD5 |
669ec10a22d5696a047e0b5791e307c5
|
|
| BLAKE2b-256 |
84d0118c1cb5e82cfab953f8dec39f6496533ab66ddad69391cc6fb570a4d843
|