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.1.tar.gz (31.2 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.1-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file hermes_review_sentinel-2.1.1.tar.gz.

File metadata

  • Download URL: hermes_review_sentinel-2.1.1.tar.gz
  • Upload date:
  • Size: 31.2 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.1.tar.gz
Algorithm Hash digest
SHA256 c2f608c138ca152918db1ae28d527fca76bdfbc4cdfb861e61848e519875f566
MD5 2da7f229b71bf7d89a823e5130237a43
BLAKE2b-256 de12dd465b23cc5ddb362f3c3685c6ae57cf6d46623824bbfd664b74b0bef91c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hermes_review_sentinel-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 541e8cb17fd64c6a36fa0c70be4902c35f3d5b55cdfdb3a3431c06cb470314d2
MD5 e7ea527885a5f35ee63ea50f825faf75
BLAKE2b-256 e233843ba2ac23b04b8e460358b0a52858c6b46bbaf7a927b7aa2dce73507465

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