SecureFlow AI
A multi-agent security reviewer for GitHub pull requests: it finds vulnerabilities, ranks them by real-world risk, and posts validated fixes as inline suggestions developers can commit.
- Period
- 2026
- Stack
- Python, Semantic Kernel, Azure OpenAI, Semgrep, FastAPI, Cosmos DB, OpenTelemetry, MCP, Azure Container Apps
- Links
- Source ↗
secureflow-ai suggested a change
CWE-89 SQL built from a request parameter on a public route.
- db.execute(f"… WHERE id={order_id}")+ db.execute("… WHERE id = %s", (order_id,))
Security scanners are good at finding problems and bad at everything after that. A single scan can return dozens or hundreds of findings, most of them noise, and the advice that comes with them ("use parameterized queries") ignores your framework, your conventions and the lines you actually changed. SecureFlow AI is a prototype that tries to close that gap inside the place developers already work: the pull request.
Three Agents, One Pipeline
When a pull request is opened or updated, GitHub sends a webhook to a FastAPI service, which runs three specialised agents in sequence:
- Scanner reads the changed files, runs Semgrep, checks dependency manifests, and returns structured findings: CWE, severity, file, line range and the vulnerable snippet.
- Intelligence decides what matters. It scores each finding on reachability, data sensitivity, exploit complexity, existing controls and blast radius, keeps the critical few, and adds a plain-language impact explanation. Severity alone isn't trusted: a medium issue in a public payment endpoint can outrank a critical one in unreachable test code.
- Remediation generates a fix for each remaining finding, validates it, retries if validation fails, and posts the result as an inline GitHub suggestion.
I split the work this way instead of using one large prompt so each agent has a narrow job and each stage can be inspected and debugged on its own.
Confidence Decides What Happens Next
An AI-generated fix is only useful if you know how far to trust it, so every fix is routed by confidence:
- 90% or higher: posted as a suggestion the developer can apply with GitHub's "Commit suggestion" button.
- 70–89%: posted with a review-required tag.
- Below 70%: escalated as a GitHub issue for the security team instead of being guessed at.
Keeping the Model on a Leash
The agents never act on their own. Everything they do, from reading a diff to scoring risk to posting a review, goes through a Semantic Kernel plugin: GitHub, Semgrep, risk scoring, fix validation, compliance mapping and an optional GitHub MCP server. Detection comes from a conventional SAST engine rather than the model alone, and the deterministic parts stay deterministic.
The service is built to fail gracefully. If remediation breaks, the prioritised findings are still posted. If intelligence breaks, the raw scan is. If the whole pipeline fails, the pull request gets an error comment rather than silence. Webhooks are verified with HMAC signatures, payload size is capped, and a semaphore limits concurrent analyses. OpenTelemetry traces every stage, which is what made a multi-agent workflow debuggable.
Learning and Evidence
When a pull request closes, the outcome is recorded: merged means the suggestions were accepted, closed without merging counts against them. Those results update team fix patterns in Cosmos DB, so later suggestions reflect what a team actually accepts. Each finding is also mapped from its CWE to SOC 2, PCI-DSS, OWASP and HIPAA requirements and stored as audit evidence, so the workflow that fixes a vulnerability also documents it.
A Streamlit dashboard shows pipeline activity, severity and confidence distributions, and acceptance rates. It falls back to demo data when no database is connected. The service ships as a multi-stage Docker image that runs as a non-root user, with a script that deploys it to Azure Container Apps.
Where It Stands
SecureFlow AI is a working prototype, not a validated product. The test suite is still empty. Fix validation checks syntax rather than proving behaviour at runtime. I haven't measured precision, latency or cost on real repositories, so I make no claims about false-positive reduction. Building an evaluation harness, with sandboxed execution of generated fixes, is what I'd do next.