Skip to main content

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/FastAPI
  • rules/typescript-security.yaml โ€” P0/P1 security rules for TypeScript/Next.js
  • rules/python-quality.yaml โ€” Clean code / best practices for Python
  • rules/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

hermes_review_sentinel-2.1.0.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hermes_review_sentinel-2.1.0-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

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

Hashes for hermes_review_sentinel-2.1.0.tar.gz
Algorithm Hash digest
SHA256 ab1ab7d023d2c2985e9a34b1e6150910def0b2a9e89d42f7fa68516814b97e7d
MD5 900afdb41e30c641ff6ecb4afa25fd18
BLAKE2b-256 b1d1f46f2f69ba51cc046531b9076e0b0b0061086982a5573aa0dbfdb6c5648c

See more details on using hashes here.

File details

Details for the file hermes_review_sentinel-2.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for hermes_review_sentinel-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3d7fb5090fa185cdf9ed45aa50abedbd100e71fd9186cb01c0ee52ae585a1ed
MD5 669ec10a22d5696a047e0b5791e307c5
BLAKE2b-256 84d0118c1cb5e82cfab953f8dec39f6496533ab66ddad69391cc6fb570a4d843

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page