Skip to content

feat: Add Web UI for AgentRed#1

Open
a805026135 wants to merge 7 commits into
mainfrom
feature/web-ui
Open

feat: Add Web UI for AgentRed#1
a805026135 wants to merge 7 commits into
mainfrom
feature/web-ui

Conversation

@a805026135

Copy link
Copy Markdown
Owner

🌐 Add Web UI for AgentRed

This PR adds a Flask-based Web UI that allows users to run AgentRed security tests through a browser interface, making the tool much more accessible and user-friendly.

New Files

  • web/app.py — Flask backend API (9 API endpoints + 2 page routes)
  • web/templates/index.html — Test configuration & execution page (4 input modes, toggles, real-time progress, results display)
  • web/templates/results.html — Historical reports page (score circles, risk badges, detail modal)
  • web/static/favicon.svg — Website icon
  • web/__init__.py — Module marker

Modified Files

  • requirements.txt — Added flask>=3.0.0 dependency
  • .gitignore — Added web/uploads/ for temporary upload files

Web UI Features

  1. 4 Input Modes (tab switch): Local ZIP upload, Prompt input, API endpoint, Results JSON upload
  2. 6 Feature Toggles (visual): Advisor, Config Checker, Tool Use, RAG/Memory Eval, Adaptive, Sanitized input
  3. Real-time Progress: Progress bar + stage indicators + scrolling log output
  4. Result Visualization: Score circle (color-coded by risk level), static/dynamic scores, recommendations
  5. Historical Reports: Score sorting, risk level tags, detail modal, one-click download
  6. 160 Test Cases Preview: Pagination + dimension/severity filters
  7. Dark Red Theme: Matching AgentRed brand style
  8. Health Check: Server status indicator (online/offline)
  9. Toast Notifications: Differentiated error types (timeout, unreachable, non-JSON response)
  10. Input Validation: Missing file/text prompts before sending empty requests

Start Command

python -m web.app --port 5000

Key Bug Fixes

  • LogCapture instead of builtins.print — Prevents Flask server crash from global print replacement
  • Global JSON error handlers — 400/404/413/500 all return JSON, not HTML error pages
  • 50MB upload limit — Supports larger agent packages
  • Safe ZIP extraction — Prevents path traversal attacks

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.

1 participant