Skip to content

feat: add AI executive summary and remediation endpoint#95

Merged
Vishnu2707 merged 2 commits into
openshield-org:devfrom
SHAURYAKSHARMA24:feat/ai-insights-endpoint
May 30, 2026
Merged

feat: add AI executive summary and remediation endpoint#95
Vishnu2707 merged 2 commits into
openshield-org:devfrom
SHAURYAKSHARMA24:feat/ai-insights-endpoint

Conversation

@SHAURYAKSHARMA24
Copy link
Copy Markdown
Collaborator

Summary

Implements #81 by adding a secure AI insights endpoint.

Changes

  • Adds POST /api/ai/insights
  • Accepts provider, api_key, and findings
  • Returns executive_summary and remediation_plan
  • Adds AI provider abstraction for Anthropic, Groq, and Gemini
  • Sorts findings by severity before generating the remediation prompt
  • Registers the AI blueprint in api/app.py
  • Adds pytest unit tests with mocked provider responses

Security

  • JWT auth is enforced through the existing global /api/... auth middleware
  • User API keys are not stored
  • User API keys are not logged
  • User API keys are not returned in responses
  • Provider failure logs use a fixed safe message and provider name only
  • Provider failures return a safe 502 response

Tests

  • python -m py_compile api/providers/ai_provider.py
  • python -m py_compile api/routes/ai.py
  • python -m pytest tests/test_ai_insights.py -v
  • python -m pytest tests/ -v

Closes #81

@SHAURYAKSHARMA24 SHAURYAKSHARMA24 self-assigned this May 30, 2026
@SHAURYAKSHARMA24 SHAURYAKSHARMA24 force-pushed the feat/ai-insights-endpoint branch from c17e37d to 6f93d79 Compare May 30, 2026 10:49
@SHAURYAKSHARMA24 SHAURYAKSHARMA24 force-pushed the feat/ai-insights-endpoint branch from 0a981b7 to e3bfecb Compare May 30, 2026 11:09
Copy link
Copy Markdown
Member

@Vishnu2707 Vishnu2707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One note: api_key is accepted in the request body over the wire but make sure the transport is always HTTPS in deployment docs. Nothing blocking merge.

@Vishnu2707 Vishnu2707 merged commit 4b2afb5 into openshield-org:dev May 30, 2026
1 check passed
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.

2 participants