01 · SECURITY INFRASTRUCTUREONLINE

SecureLens AI

GitHub-integrated AppSec scanner and URL vulnerability prober powered by Gemini.

KEY OUTCOMES
METRIC 01Reduced scan latency from 12 minutes to under 45 seconds.
METRIC 0230+ security checks across 5 transport and exposure layers.
METRIC 03Contextual multi-turn AI chat to request vulnerability patches.
01 · PROBLEM STATEMENT
Sequential scanning of large source code repositories takes up to 12 minutes, causing CI/CD timeouts and friction in development workflows.
02 · SYSTEM ARCHITECTURE
HTTPS POSTasyncio.gatherFetch filesScan CodePersist ReportQuery ResultsReact FrontendFastAPI GatewayAsync QueueGemini APIPostgreSQLGitHub API
03 · DESIGN DECISIONS & TRADE-OFFS
DECISION 01

asyncio.gather() Semaphore throttling

Alternative Evaluated:

Celery/Redis worker queues

Decision Reason:

Avoids memory and operational overhead of broker infrastructure in a lightweight backend. Runs lightweight, concurrent async HTTP calls efficiently inside FastAPI.

Trade-off: In-memory request execution limits scalability for massive concurrent users, resolved by mapping queue backends if user concurrency spikes.
DECISION 02

Gemini 2.0 Flash JSON Mode

Alternative Evaluated:

Regex parsing of standard text LLM outputs

Decision Reason:

Guarantees output conforms exactly to Pydantic validation structures, preventing parsing crashes.

Trade-off: Free tier rate limits (15 RPM) required implementing fallback delay backoffs.
04 · SYSTEM FAILURE & RECOVERY
Attempted Strategy

Originally attempted synchronous scanning by making consecutive blocking LLM requests within the request thread.

Observed Symptom

Caused 504 Gateway Timeouts and crashed the FastAPI gateway process when scanning repos with more than 50 files.

Resolution & Fix

Refactored the orchestrator to perform asynchronous file fetching and concurrent LLM requests via asyncio, throttled by a Semaphore of 5.

TECHNOLOGY BLUEPRINT
PythonFastAPIGemini 2.0 FlashPydantic v2SQLAlchemyPostgreSQL