How keyuraghao/aisrf works
AISRF is a human-in-the-loop security gateway for LLM applications and agents. Its central workflow intercepts and normalizes outbound requests, analyzes them, applies policy, holds them for review when needed, forwards approved traffic, analyzes responses, and records decisions and evidence. Around that lifecycle, the repository provides red-team campaigns and scanner adapters, source-code review, reporting, integrations, and operator interfaces. The README documents these capabilities; sampled source confirms key pipeline, ticket, campaign, and code-review orchestration, but not every subsystem’s internal wiring.
Main entry points: pipeline.py Request Pipeline · service.py Ticket Lifecycle · db.py Application Database · main.py Application Assembly
Components 23
Request Gateway
- Gateway Router
aisrf/gateway/router.py - Request Pipeline
aisrf/gateway/pipeline.py - Risk Analysis
aisrf/analysis/runner.py - Guardrail Integrations
aisrf/guardrails - Traffic Policy
aisrf/gateway/policy.py - Upstream Forwarder
aisrf/gateway/forwarder.py - Response Analysis
aisrf/analysis/analyzers/response_analyzers.py
Review and Audit
- Ticket Lifecycle
aisrf/tickets/service.py - Review Dashboard
aisrf/dashboard/router.py - Audit Trail
aisrf/audit/service.py
Security Assessment
- Campaign Runner
aisrf/redteam/engine.py - Scanner Adapters
aisrf/scanners - Source Review
aisrf/codereview/engine.py - Report Generation
aisrf/reports
Platform Services
- Application Database
aisrf/db.py - TypeSafe Decisions
aisrf/typesafe/client.py - Live Settings
aisrf/settings_store.py - Reviewer Notifications
aisrf/notifications.py - MCP Actions
aisrf/mcp_server.py - Application Assembly
aisrf/main.py
Other components
- LLM Client
- Human Reviewer
- Model Backend
Connections 30
- LLM Client → Gateway Router: submits request
- Gateway Router → Request Pipeline: dispatches traffic
- Request Pipeline → Risk Analysis: runs analysis
- Request Pipeline → Guardrail Integrations: checks guardrails
- Request Pipeline → Traffic Policy: applies policy
- Request Pipeline → Ticket Lifecycle: creates ticket
- Request Pipeline → Upstream Forwarder: forwards approved
- Upstream Forwarder → Model Backend: sends request
- Model Backend → Upstream Forwarder: returns response
- Request Pipeline → Response Analysis: checks response
- Request Pipeline → Ticket Lifecycle: records outcome
- Review Dashboard → Ticket Lifecycle: reviews tickets
- Human Reviewer → Review Dashboard: decides tickets
- Ticket Lifecycle → Audit Trail: records decisions
- Request Pipeline → Application Database: persists state
- Ticket Lifecycle → Application Database: stores tickets
- Audit Trail → Application Database: stores events
- Campaign Runner → Request Pipeline: submits probes
- Scanner Adapters → Gateway Router: sends probes
- Source Review → Application Database: stores findings
- Report Generation → Application Database: reads records
- Risk Analysis → TypeSafe Decisions: requests judgment
- Source Review → TypeSafe Decisions: triages findings
- Request Pipeline → Live Settings: reads configuration
- Review Dashboard → Reviewer Notifications: triggers paging
- MCP Actions → Ticket Lifecycle: invokes review actions
- Application Assembly → Gateway Router: mounts routes
- Application Assembly → Review Dashboard: mounts routes
- Application Assembly → Campaign Runner: mounts routes
- Application Assembly → Report Generation: mounts routes