Thanks to visit codestin.com
Credit goes to github.com

Skip to content

This repository provides the official implementation of the S²CG-Agent.

Notifications You must be signed in to change notification settings

conf-anonymous-273/S2CG-Agent

Repository files navigation

S²CG-Agent: A Schedulable Multi-Agent Secure Code Generation Framework

This repository provides the official implementation of the S²CG-Agent, a schedulable and safe code generation agent designed to generate secure code with the help of LLMs. It is developed to support research in safe AI-assisted software engineering.

🔍 Project Overview

S²CG-Agent introduces a multi-agent architecture where code generation tasks are scheduled and coordinated to ensure safety and correctness.

This repository accompanies the paper:
"S²CG-Agent: A Schedulable Multi-Agent Secure Code Generation Framework"
framework

📁 Directory Structure

S2CG-Agent-main/
├── AutoSafeCoder/ # baseline: AutoSafeCoder
├── LLM-Agent/ # baseline: LLM-Agent
├── OriginalLLM/ # baseline: Original LLM
├── SCG-Agent/ # ablation baseline: SCG-Agent
├── S²CG-Agent/ # S²CG-Agent
├── trained_decision_model/ # trained scheduling model, need to download from Releases or Google Cloud
├── results/ # outputs of S²CG-Agent and baselines
├── evaluation/ # Scripts and configs for evaluating performance
├── requirements.txt # Python dependencies
└── README.md # This file

🚀 Getting Started

Requirements

  • Python 3.8+
  • OpenAI or other LLM API access
  • Install required packages:
pip install -r requirements.txt

API Key Setup

Ensure you have your API key set as an environment variable:

xxx_key = your-api-key

🧠 Running the Agent

Navigate to the S²CG-Agent/ directory and run the main agent:

cd S²CG-Agent
python main.py

📦 Pretrained Scheduling Model

A pretrained scheduling model is available for download:

👉 Download from Releases 👉 Download from Google Drive

After downloading, place the model files in the appropriate directory (e.g., S2CG-Agent-main/trained_decision_model/).

📊 Evaluation

To evaluate the performance and safety of generated code, use the scripts in the evaluation/ directory:

cd evaluation
python eval_time.py api_calls.py eval_unit.py eval_static.py eval_fuzzing.py

You may configure evaluation parameters in the included config files (your api key).

📌 Notes

  • This repo is research-oriented and intended for reproducibility and further development.
  • Please ensure compliance with LLM provider usage policies when deploying the agent.

📄 License

This project is released under the MIT License. See the LICENSE file for details.

🙌 Acknowledgements

This work is part of the research project described in the paper: "S²CG-Agent: A Schedulable Multi-Agent Secure Code Generation Framework" If you use this code, please consider citing our work.

About

This repository provides the official implementation of the S²CG-Agent.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages