Skip to main content

An agentic tool to fix vulnerabilities

Project description

ScopeFix: Autonomous Open-Source Vulnerability Remediation

Detect. Strategize. Surgically Repair

ScopeFix is an open-source framework designed to resolve security vulnerabilities in software codebases. By utilizing a novel Strategist-First Architecture powered exclusively by open-weights Large Language Models (LLMs), it unburdens human developers from the overwhelming volume of routine security patches.

In the modern DevSecOps landscape, thousands of vulnerabilities are detected daily. Human developers simply cannot keep up, leading to a massive backlog of "Low" and "Medium" complexity issues that remain unpatched for months. ScopeFix aims to clear this "Security Debt" by autonomously resolving these vulnerabilities, allowing human engineers to focus on high-severity, architectural security challenges.

The Problem

Automated vulnerability scanning tools like Bandit, Semgrep are able to pinpont thousands of security issues in a jiffy. It takes a lot of human effort to analyze and fix these vulnerabilities leading to Security Debt. Most projects don't have enough resources to fix every detected vulnerability. Studies show that even after 6 months only 56% of detected vulnerabilities are fixed.

Solution: The Strategy first architecture

Scopefix introduces a strategist agent to the repair loop. Instead of blindly asking an LLM to "fix this code," our pipeline mimics a human engineering workflow: Plan first, then Code.

The Strategist (Qwen3-32b)

Before any code is written, the strategist analyzes vulnerability report, source code and common methods to fix the vulnerability (obtained to web scraping) to generate a repair plan. It defines the root cause of the vulnerability and provides guidance to the fixer.
Impact: This guidance allows the smaller Level 1 model to achieve significantly higher fix rates than if it were working alone.

Level 1 Fixer (Qwen3-32B)

Qwen3-32B is used as it is capable despite being a lightweight model and high availability of inference providers for it. Function: It takes the Strategist's plan and executes a surgical patch. Efficiency: Because it follows a strict plan, it effectively resolves the majority of routine vulnerabilities (e.g., input validation, secure defaults) with minimal compute overhead.

Level 2 Fixer (DeepSeek-R1)

DeepSeek-R1 was choosen for high availability of inference providers and relatively larger context window and coding capabilities. Other opensource models like glm-4.7, qwen3-max and kimi-k2-thinking are better suited but were not chosen due to lack of serverless inference providers.

Function: Leverages a massive context window and advanced reasoning capabilities to handle complex, logic-heavy vulnerabilities.

Local Setup & Usage Instructions

1. Clone the Repository

Open your terminal and clone the repository to your local machine:

git clone [https://github.com/abhiram-29/scopefix.git](https://github.com/abhiram-29/scopefix.git)
cd scopefix

2. Setup Python Virtual Environment

python3 -m venv venv
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Configure Environment Variables

refer to the .env.example file to configure your environment variables

5. Run the remediation loop

To fix a vulnerability in a specific file, you need to pass the file path to the fix_vuln function inside fix_loop.py

python fix_loop.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scopefix-0.1.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scopefix-0.1.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file scopefix-0.1.1.tar.gz.

File metadata

  • Download URL: scopefix-0.1.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scopefix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 58b2f2afd03525ba2c547b40640163aa6dd0fde05947446f6feb3b8565381c58
MD5 58e9f1d77a77ef84415a3186d0e7cc10
BLAKE2b-256 9bedef2eaa4d2643bdc0902017789d6382430812e6c4044cc6bf688de4f0fd51

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopefix-0.1.1.tar.gz:

Publisher: publish.yml on Abhiram-29/scopefix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scopefix-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: scopefix-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for scopefix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba22b51aa6a70c789f482961931c8df8d97063c2b9bf8798f6526fb5d67a725d
MD5 a9ae6acb1330985f63e966db7d3db5e5
BLAKE2b-256 6666b7a79b3e97e4b65cce0e351d147cb26b2900fae798d3cbd5c6290c9c8ee9

See more details on using hashes here.

Provenance

The following attestation bundles were made for scopefix-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Abhiram-29/scopefix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page