Skip to content

feat(reporting): Phase 4 grounded AI reporting, SMB remediation UX & encrypted secrets - #8

Open
huangji6693-max wants to merge 1 commit into
BreachDirect:mainfrom
huangji6693-max:feat/phase4-ai-reporting-smb-ux-3
Open

huangji6693-max wants to merge 1 commit into
BreachDirect:mainfrom
huangji6693-max:feat/phase4-ai-reporting-smb-ux-3

Conversation

@huangji6693-max

@huangji6693-max huangji6693-max commented Oct 27, 2026 •

Copy link
Copy Markdown

Summary

Implements Phase 4 AI reporting & SMB-friendly UX:

  • Grounded AI & Template Reports (app/services/ai_reporter.py): Added explicit finding ID citations ([ID: <finding.id>]) across template and Claude AI reports, plus sanitize_grounded_report() to strip unverified finding citations and prevent hallucinated CVE numbers.
  • Per-OWASP-Category Remediation Cards (app/services/owasp.py, static/index.html, static/js/app.js, static/css/style.css): Added OWASP_REMEDIATION_CARDS (A01:2021–A10:2021) and rendered plain-English remediation cards and per-finding "How to fix" guidance in the dashboard.
  • Safety Score Algorithm Documentation (app/services/owasp.py, docs/safety_score_and_chapter5.md): Added explain_risk_rule() alongside risk_grade() and documented the A–F decision table, 0–100 penalty formula, and < 5-minute viva demo guide (Slides 9–10).
  • Passphrase-Encrypted API Key Storage (app/services/secrets.py): Added encrypt_secret(), decrypt_secret(), and resolve_anthropic_api_key() using PBKDF2-HMAC-SHA256 (enc:v1:...), and updated validate_settings() to warn in production when ANTHROPIC_API_KEY is stored in plaintext without encryption.
  • Tests (tests/test_ai_reporting_phase4.py): Added unit and contract tests for grounded citations, CVE hallucination sanitization, remediation cards, A–F safety score grading, and encrypted secret storage.

Verification

  • pytest tests/ -v: 16 passed
  • ruff check app tests: All checks passed
  • bandit -r app -c bandit.yaml -ll -q: Clean

Closes #3


Payout Wallets

  • Stellar (XLM / USDC): GBYWLISGOUWQ43VQEGXX6KRGDZ3CKAFFK3JXVLXKDO5TIFJUJ3OHJYOZ
  • EVM / Base USDC: 0x380C97bcbcAEf29DAc2d0ba7E180F1b4A7F38fdd
  • Solana (USDC / SOL): AyXYaA9Nf4z5fpLKY6DmubWe6D2qveMd79w8pEDNHcDw

…crypted API keys

- Add finding ID citations ([ID: <finding.id>]) and sanitize_grounded_report anti-hallucination filter in app/services/ai_reporter.py
- Add OWASP_REMEDIATION_CARDS and explain_risk_rule safety score algorithm in app/services/owasp.py
- Render per-OWASP-category plain-English remediation cards and fix guidance in static/index.html, static/js/app.js, and static/css/style.css
- Add PBKDF2-HMAC-SHA256 passphrase-encrypted API key storage (enc:v1:...) and production plaintext warning in app/services/secrets.py
- Document safety score algorithm and viva demo walkthrough in docs/safety_score_and_chapter5.md and add tests/test_ai_reporting_phase4.py

Closes BreachDirect#3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 4: AI Reporting & SMB-Friendly UX

1 participant