securevibebench 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- securevibebench-0.2.0/LICENSE +21 -0
- securevibebench-0.2.0/MANIFEST.in +11 -0
- securevibebench-0.2.0/PKG-INFO +183 -0
- securevibebench-0.2.0/README.md +156 -0
- securevibebench-0.2.0/THIRD_PARTY_NOTICES.md +12 -0
- securevibebench-0.2.0/build_backend.py +77 -0
- securevibebench-0.2.0/docs/README.md +77 -0
- securevibebench-0.2.0/evaluation/README.md +6 -0
- securevibebench-0.2.0/evaluation/__init__.py +1 -0
- securevibebench-0.2.0/evaluation/__main__.py +3 -0
- securevibebench-0.2.0/evaluation/bootstrap.py +159 -0
- securevibebench-0.2.0/evaluation/cli.py +29 -0
- securevibebench-0.2.0/evaluation/editable_mini.py +109 -0
- securevibebench-0.2.0/evaluation/harbor.yaml +11 -0
- securevibebench-0.2.0/evaluation/hf_verifier.py +63 -0
- securevibebench-0.2.0/evaluation/mini-source.tar.gz +0 -0
- securevibebench-0.2.0/evaluation/prepare.sh +5 -0
- securevibebench-0.2.0/evaluation/resources.json +1037 -0
- securevibebench-0.2.0/evaluation/resources.py +72 -0
- securevibebench-0.2.0/evaluation/run.py +244 -0
- securevibebench-0.2.0/evaluation/run.sh +11 -0
- securevibebench-0.2.0/evaluation/setup.sh +4 -0
- securevibebench-0.2.0/pyproject.toml +52 -0
- securevibebench-0.2.0/securevibebench.egg-info/PKG-INFO +183 -0
- securevibebench-0.2.0/securevibebench.egg-info/SOURCES.txt +34 -0
- securevibebench-0.2.0/securevibebench.egg-info/dependency_links.txt +1 -0
- securevibebench-0.2.0/securevibebench.egg-info/entry_points.txt +3 -0
- securevibebench-0.2.0/securevibebench.egg-info/requires.txt +6 -0
- securevibebench-0.2.0/securevibebench.egg-info/top_level.txt +1 -0
- securevibebench-0.2.0/setup.cfg +4 -0
- securevibebench-0.2.0/tests/test_bootstrap.py +99 -0
- securevibebench-0.2.0/tests/test_package.py +158 -0
- securevibebench-0.2.0/tools/bundle_resources.py +100 -0
- securevibebench-0.2.0/tools/download_dataset.py +13 -0
- securevibebench-0.2.0/tools/install.py +13 -0
- securevibebench-0.2.0/uv.lock +3355 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Junkai Chen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
include LICENSE THIRD_PARTY_NOTICES.md README.md uv.lock
|
|
2
|
+
include build_backend.py
|
|
3
|
+
recursive-include evaluation *.py *.yaml *.sh *.md
|
|
4
|
+
include evaluation/resources.json evaluation/mini-source.tar.gz
|
|
5
|
+
exclude evaluation/resources.tar.gz
|
|
6
|
+
recursive-include tools *.py
|
|
7
|
+
recursive-include docs *.md
|
|
8
|
+
recursive-include tests *.py
|
|
9
|
+
prune evaluation/mini-swe-agent
|
|
10
|
+
prune dev
|
|
11
|
+
global-exclude __pycache__ *.py[cod] .env .env.*
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: securevibebench
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Generate and evaluate secure coding agents on SecureVibeBench
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/iCSawyer/SecureVibeBench
|
|
7
|
+
Project-URL: Documentation, https://github.com/iCSawyer/SecureVibeBench/blob/main/docs/README.md
|
|
8
|
+
Project-URL: Issues, https://github.com/iCSawyer/SecureVibeBench/issues
|
|
9
|
+
Project-URL: Dataset, https://huggingface.co/datasets/iCSawyer/SecureVibeBench
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Science/Research
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Topic :: Software Development :: Testing
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
20
|
+
Requires-Dist: harbor<0.26.0,>=0.25.0
|
|
21
|
+
Requires-Dist: mini-swe-agent==2.4.6
|
|
22
|
+
Requires-Dist: huggingface-hub>=0.34.3
|
|
23
|
+
Requires-Dist: docker>=7.1.0
|
|
24
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
25
|
+
Requires-Dist: python-dotenv>=1.1.1
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# SecureVibeBench
|
|
29
|
+
|
|
30
|
+
<p align="left">
|
|
31
|
+
<img src="https://img.shields.io/badge/Version-v0.2-blue.svg?style=for-the-badge" alt="Version: v0.2">
|
|
32
|
+
<a href="https://2026.aclweb.org/"><img src="https://img.shields.io/badge/Venue-ACL%202026-2ea44f.svg?style=for-the-badge" alt="Venue: ACL 2026"></a>
|
|
33
|
+
<a href="https://arxiv.org/abs/2509.22097"><img src="https://img.shields.io/badge/arXiv-2509.22097-b31b1b.svg?style=for-the-badge" alt="arXiv"></a>
|
|
34
|
+
<a href="https://huggingface.co/datasets/iCSawyer/SecureVibeBench"><img src="https://img.shields.io/badge/HF-SecureVibeBench-FFD21F.svg?style=for-the-badge&logo=huggingface" alt="Hugging Face: SecureVibeBench"></a>
|
|
35
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="License MIT"></a>
|
|
36
|
+
<!-- <a href="https://chen-junkai.github.io/securevibebench-leaderboard/"><img src="https://img.shields.io/badge/Leaderboard-Online-2ea44f.svg?style=for-the-badge" alt="Leaderboard"></a> -->
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
> [!IMPORTANT]
|
|
40
|
+
> **SecureVibeBench is now v0.2!** Try `pip install securevibebench`!
|
|
41
|
+
>
|
|
42
|
+
> We refer to the original release and evaluation workflow as **v0.1**, and **results obtained with v0.2 may differ from v0.1.** The original task instructions, tests, and scoring logic remain unchanged. Please report the benchmark version and agent/model configuration when comparing results.
|
|
43
|
+
|
|
44
|
+
<p align="left">
|
|
45
|
+
✨ <a href="#nav-news">News</a>
|
|
46
|
+
| 🛠️ <a href="#nav-quick-start">Quick Start</a>
|
|
47
|
+
| 🔭 <a href="#nav-overview">Overview</a>
|
|
48
|
+
| 📚 <a href="#nav-citation">Citation</a>
|
|
49
|
+
| 🙏 <a href="#nav-acknowledgments">Acknowledgments</a>
|
|
50
|
+
</p>
|
|
51
|
+
|
|
52
|
+
<a id="nav-news"></a>
|
|
53
|
+
|
|
54
|
+
## ✨ News
|
|
55
|
+
|
|
56
|
+
- **[2026-10-29]** We updated to **v0.2**, introducing a PyPI package, Harbor-format tasks, and unified model generation and evaluation. The original version is now referred to as **v0.1**; results may differ between versions.
|
|
57
|
+
<!-- - **[2026-06-06]** 🏆 We released the online [Leaderboard](https://chen-junkai.github.io/securevibebench-leaderboard/) for SecureVibeBench.
|
|
58
|
+
- **[2026-04-15]** 🤗 We support the usage via [Hugging Face Datasets](https://huggingface.co/datasets/iCSawyer/SecureVibeBench).
|
|
59
|
+
- **[2026-04-11]** 🚀 We released code and data for SecureVibeBench. -->
|
|
60
|
+
- **[2026-04-07]** 🎉 Our paper has been accepted to **ACL 2026**.
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<a id="nav-quick-start"></a>
|
|
64
|
+
|
|
65
|
+
## 🛠️ Quick Start
|
|
66
|
+
|
|
67
|
+
Requirements: Python 3.12+, Linux x86_64, Docker Engine with Compose, and a running Docker daemon.
|
|
68
|
+
|
|
69
|
+
### Install
|
|
70
|
+
|
|
71
|
+
We recommend [uv](https://docs.astral.sh/uv/getting-started/installation/) for managing Python environments. pip also works; uv is not installed as a package dependency.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Run without installing into your current environment
|
|
75
|
+
uvx securevibebench --help
|
|
76
|
+
|
|
77
|
+
# Or install into an active virtual environment
|
|
78
|
+
uv pip install securevibebench
|
|
79
|
+
|
|
80
|
+
# Or with pip
|
|
81
|
+
pip install securevibebench
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Installation downloads all 105 tasks and the original evaluator from Hugging Face. Task containers are prepared when evaluation starts.
|
|
85
|
+
|
|
86
|
+
### For development
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
git clone https://github.com/iCSawyer/SecureVibeBench.git
|
|
90
|
+
cd SecureVibeBench
|
|
91
|
+
uv sync # editable install + development tools
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Use `uv run securevibebench eval ...` for the development checkout, or activate `.venv/bin/activate`.
|
|
95
|
+
|
|
96
|
+
Without uv, use `python tools/install.py --dev --installer pip` in an active virtual environment.
|
|
97
|
+
|
|
98
|
+
### Run evaluation
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
export OPENAI_API_KEY='<your-api-key>'
|
|
102
|
+
export MODEL='openai/<model-name>'
|
|
103
|
+
|
|
104
|
+
# With uv, without a persistent installation
|
|
105
|
+
uvx securevibebench eval --model "$MODEL" --task 992
|
|
106
|
+
|
|
107
|
+
# Or after installing the package
|
|
108
|
+
securevibebench eval --model "$MODEL" --task 992
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Omit `--task 992` to run all 105 tasks. Static analysis is disabled by default. Enable it with `--run-sast TRUE` and configure Semgrep credentials such as `SEMGREP_APP_TOKEN`. Results are saved to `runs/<job>/summary.json` under the current working directory.
|
|
112
|
+
|
|
113
|
+
> [!NOTE]
|
|
114
|
+
> For custom endpoints, development setup, and more details, see the [Usage Guide](https://github.com/iCSawyer/SecureVibeBench/blob/main/docs/README.md). Run `securevibebench eval --help` for evaluation options.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<a id="nav-overview"></a>
|
|
118
|
+
|
|
119
|
+
## 🔭 Overview
|
|
120
|
+
|
|
121
|
+
SecureVibeBench is the **first** SWE-bench-level benchmark for secure vibe coding of agents, consisting of 105 C/C++ coding tasks sourced from real vulnerabilities ([OSS-Fuzz](https://github.com/google/oss-fuzz)/[ARVO](https://arxiv.org/abs/2408.02153)) covering various projects.
|
|
122
|
+
|
|
123
|
+

|
|
124
|
+
|
|
125
|
+
For each task in SecureVibeBench, we **reconstruct the real scenario where a human developer introduced a vulnerability** into the codebase, and then ask the agent to **implement the same requirements** and to see if the agent will also introduce the same vulnerability or not (and maybe new security issues as well).
|
|
126
|
+
|
|
127
|
+
To comprehensively evaluate the generated code of code agents, we conduct (i) **functional** correctness evaluation, (ii) PoV (proof-of-vulnerability) based **dynamic security** evaluation, and (iii) SAST-tool based **static security** evaluation.
|
|
128
|
+
|
|
129
|
+
> [!IMPORTANT]
|
|
130
|
+
> **Why SecureVibeBench?**
|
|
131
|
+
>
|
|
132
|
+
> - First SWE-bench-level, peer-reviewed benchmark for secure vibe coding.
|
|
133
|
+
> - Reconstruct coding scenarios where humans introduced vulnerabilities.
|
|
134
|
+
> - No other secure coding benchmark considering (i) functional correctness, (ii) PoV-based evaluation, and (iii) SAST tool-based new security issue detection.
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<a id="nav-citation"></a>
|
|
138
|
+
|
|
139
|
+
## 📚 Citation
|
|
140
|
+
|
|
141
|
+
If you find SecureVibeBench useful, please cite:
|
|
142
|
+
|
|
143
|
+
```bibtex
|
|
144
|
+
@inproceedings{chen2026securevibebench,
|
|
145
|
+
title = "{S}ecure{V}ibe{B}ench: Benchmarking Secure Vibe Coding of {AI} Agents via Reconstructing Vulnerability-Introducing Scenarios",
|
|
146
|
+
author = "Chen, Junkai and Huang, Huihui and Lyu, Yunbo and An, Junwen and
|
|
147
|
+
Shi, Jieke and Yang, Chengran and Zhang, Ting and Tian, Haoye and
|
|
148
|
+
Li, Yikun and Li, Zhenhao and Zhou, Xin and Hu, Xing and Lo, David",
|
|
149
|
+
editor = "Liakata, Maria and Moreira, Viviane P. and Zhang, Jiajun and Jurgens, David",
|
|
150
|
+
booktitle = "Proceedings of the 64th Annual Meeting of the {A}ssociation for {C}omputational {L}inguistics (Volume 1: Long Papers)",
|
|
151
|
+
year = "2026", month = jul, pages = "24144--24168",
|
|
152
|
+
address = "San Diego, California, United States",
|
|
153
|
+
publisher = "Association for Computational Linguistics",
|
|
154
|
+
url = "https://aclanthology.org/2026.acl-long.1107/",
|
|
155
|
+
ISBN = "979-8-89176-390-6"
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
<a id="nav-acknowledgments"></a>
|
|
160
|
+
|
|
161
|
+
## 🙏 Acknowledgments
|
|
162
|
+
|
|
163
|
+
Our work builds on [OSS-Fuzz](https://github.com/google/oss-fuzz) and [ARVO](https://arxiv.org/abs/2408.02153).
|
|
164
|
+
|
|
165
|
+
```bibtex
|
|
166
|
+
@misc{mei2024arvoatlasreproduciblevulnerabilities,
|
|
167
|
+
title = {ARVO: Atlas of Reproducible Vulnerabilities for Open Source Software},
|
|
168
|
+
author = {Xiang Mei and Pulkit Singh Singaria and Jordi Del Castillo and Haoran Xi and
|
|
169
|
+
Abdelouahab and Benchikh and Tiffany Bao and Ruoyu Wang and Yan Shoshitaishvili and
|
|
170
|
+
Adam Doupé and Hammond Pearce and Brendan Dolan-Gavitt},
|
|
171
|
+
year = {2024}, eprint = {2408.02153},
|
|
172
|
+
archivePrefix = {arXiv}, primaryClass = {cs.CR},
|
|
173
|
+
url = {https://arxiv.org/abs/2408.02153}
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
```bibtex
|
|
178
|
+
@article{serebryany2017oss,
|
|
179
|
+
title = {$\{$OSS-Fuzz$\}$-Google's continuous fuzzing service for open source software},
|
|
180
|
+
author = {Serebryany, Kostya},
|
|
181
|
+
year = {2017}
|
|
182
|
+
}
|
|
183
|
+
```
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# SecureVibeBench
|
|
2
|
+
|
|
3
|
+
<p align="left">
|
|
4
|
+
<img src="https://img.shields.io/badge/Version-v0.2-blue.svg?style=for-the-badge" alt="Version: v0.2">
|
|
5
|
+
<a href="https://2026.aclweb.org/"><img src="https://img.shields.io/badge/Venue-ACL%202026-2ea44f.svg?style=for-the-badge" alt="Venue: ACL 2026"></a>
|
|
6
|
+
<a href="https://arxiv.org/abs/2509.22097"><img src="https://img.shields.io/badge/arXiv-2509.22097-b31b1b.svg?style=for-the-badge" alt="arXiv"></a>
|
|
7
|
+
<a href="https://huggingface.co/datasets/iCSawyer/SecureVibeBench"><img src="https://img.shields.io/badge/HF-SecureVibeBench-FFD21F.svg?style=for-the-badge&logo=huggingface" alt="Hugging Face: SecureVibeBench"></a>
|
|
8
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" alt="License MIT"></a>
|
|
9
|
+
<!-- <a href="https://chen-junkai.github.io/securevibebench-leaderboard/"><img src="https://img.shields.io/badge/Leaderboard-Online-2ea44f.svg?style=for-the-badge" alt="Leaderboard"></a> -->
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
> [!IMPORTANT]
|
|
13
|
+
> **SecureVibeBench is now v0.2!** Try `pip install securevibebench`!
|
|
14
|
+
>
|
|
15
|
+
> We refer to the original release and evaluation workflow as **v0.1**, and **results obtained with v0.2 may differ from v0.1.** The original task instructions, tests, and scoring logic remain unchanged. Please report the benchmark version and agent/model configuration when comparing results.
|
|
16
|
+
|
|
17
|
+
<p align="left">
|
|
18
|
+
✨ <a href="#nav-news">News</a>
|
|
19
|
+
| 🛠️ <a href="#nav-quick-start">Quick Start</a>
|
|
20
|
+
| 🔭 <a href="#nav-overview">Overview</a>
|
|
21
|
+
| 📚 <a href="#nav-citation">Citation</a>
|
|
22
|
+
| 🙏 <a href="#nav-acknowledgments">Acknowledgments</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<a id="nav-news"></a>
|
|
26
|
+
|
|
27
|
+
## ✨ News
|
|
28
|
+
|
|
29
|
+
- **[2026-10-29]** We updated to **v0.2**, introducing a PyPI package, Harbor-format tasks, and unified model generation and evaluation. The original version is now referred to as **v0.1**; results may differ between versions.
|
|
30
|
+
<!-- - **[2026-06-06]** 🏆 We released the online [Leaderboard](https://chen-junkai.github.io/securevibebench-leaderboard/) for SecureVibeBench.
|
|
31
|
+
- **[2026-04-15]** 🤗 We support the usage via [Hugging Face Datasets](https://huggingface.co/datasets/iCSawyer/SecureVibeBench).
|
|
32
|
+
- **[2026-04-11]** 🚀 We released code and data for SecureVibeBench. -->
|
|
33
|
+
- **[2026-04-07]** 🎉 Our paper has been accepted to **ACL 2026**.
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
<a id="nav-quick-start"></a>
|
|
37
|
+
|
|
38
|
+
## 🛠️ Quick Start
|
|
39
|
+
|
|
40
|
+
Requirements: Python 3.12+, Linux x86_64, Docker Engine with Compose, and a running Docker daemon.
|
|
41
|
+
|
|
42
|
+
### Install
|
|
43
|
+
|
|
44
|
+
We recommend [uv](https://docs.astral.sh/uv/getting-started/installation/) for managing Python environments. pip also works; uv is not installed as a package dependency.
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# Run without installing into your current environment
|
|
48
|
+
uvx securevibebench --help
|
|
49
|
+
|
|
50
|
+
# Or install into an active virtual environment
|
|
51
|
+
uv pip install securevibebench
|
|
52
|
+
|
|
53
|
+
# Or with pip
|
|
54
|
+
pip install securevibebench
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Installation downloads all 105 tasks and the original evaluator from Hugging Face. Task containers are prepared when evaluation starts.
|
|
58
|
+
|
|
59
|
+
### For development
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
git clone https://github.com/iCSawyer/SecureVibeBench.git
|
|
63
|
+
cd SecureVibeBench
|
|
64
|
+
uv sync # editable install + development tools
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Use `uv run securevibebench eval ...` for the development checkout, or activate `.venv/bin/activate`.
|
|
68
|
+
|
|
69
|
+
Without uv, use `python tools/install.py --dev --installer pip` in an active virtual environment.
|
|
70
|
+
|
|
71
|
+
### Run evaluation
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
export OPENAI_API_KEY='<your-api-key>'
|
|
75
|
+
export MODEL='openai/<model-name>'
|
|
76
|
+
|
|
77
|
+
# With uv, without a persistent installation
|
|
78
|
+
uvx securevibebench eval --model "$MODEL" --task 992
|
|
79
|
+
|
|
80
|
+
# Or after installing the package
|
|
81
|
+
securevibebench eval --model "$MODEL" --task 992
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Omit `--task 992` to run all 105 tasks. Static analysis is disabled by default. Enable it with `--run-sast TRUE` and configure Semgrep credentials such as `SEMGREP_APP_TOKEN`. Results are saved to `runs/<job>/summary.json` under the current working directory.
|
|
85
|
+
|
|
86
|
+
> [!NOTE]
|
|
87
|
+
> For custom endpoints, development setup, and more details, see the [Usage Guide](https://github.com/iCSawyer/SecureVibeBench/blob/main/docs/README.md). Run `securevibebench eval --help` for evaluation options.
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<a id="nav-overview"></a>
|
|
91
|
+
|
|
92
|
+
## 🔭 Overview
|
|
93
|
+
|
|
94
|
+
SecureVibeBench is the **first** SWE-bench-level benchmark for secure vibe coding of agents, consisting of 105 C/C++ coding tasks sourced from real vulnerabilities ([OSS-Fuzz](https://github.com/google/oss-fuzz)/[ARVO](https://arxiv.org/abs/2408.02153)) covering various projects.
|
|
95
|
+
|
|
96
|
+

|
|
97
|
+
|
|
98
|
+
For each task in SecureVibeBench, we **reconstruct the real scenario where a human developer introduced a vulnerability** into the codebase, and then ask the agent to **implement the same requirements** and to see if the agent will also introduce the same vulnerability or not (and maybe new security issues as well).
|
|
99
|
+
|
|
100
|
+
To comprehensively evaluate the generated code of code agents, we conduct (i) **functional** correctness evaluation, (ii) PoV (proof-of-vulnerability) based **dynamic security** evaluation, and (iii) SAST-tool based **static security** evaluation.
|
|
101
|
+
|
|
102
|
+
> [!IMPORTANT]
|
|
103
|
+
> **Why SecureVibeBench?**
|
|
104
|
+
>
|
|
105
|
+
> - First SWE-bench-level, peer-reviewed benchmark for secure vibe coding.
|
|
106
|
+
> - Reconstruct coding scenarios where humans introduced vulnerabilities.
|
|
107
|
+
> - No other secure coding benchmark considering (i) functional correctness, (ii) PoV-based evaluation, and (iii) SAST tool-based new security issue detection.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
<a id="nav-citation"></a>
|
|
111
|
+
|
|
112
|
+
## 📚 Citation
|
|
113
|
+
|
|
114
|
+
If you find SecureVibeBench useful, please cite:
|
|
115
|
+
|
|
116
|
+
```bibtex
|
|
117
|
+
@inproceedings{chen2026securevibebench,
|
|
118
|
+
title = "{S}ecure{V}ibe{B}ench: Benchmarking Secure Vibe Coding of {AI} Agents via Reconstructing Vulnerability-Introducing Scenarios",
|
|
119
|
+
author = "Chen, Junkai and Huang, Huihui and Lyu, Yunbo and An, Junwen and
|
|
120
|
+
Shi, Jieke and Yang, Chengran and Zhang, Ting and Tian, Haoye and
|
|
121
|
+
Li, Yikun and Li, Zhenhao and Zhou, Xin and Hu, Xing and Lo, David",
|
|
122
|
+
editor = "Liakata, Maria and Moreira, Viviane P. and Zhang, Jiajun and Jurgens, David",
|
|
123
|
+
booktitle = "Proceedings of the 64th Annual Meeting of the {A}ssociation for {C}omputational {L}inguistics (Volume 1: Long Papers)",
|
|
124
|
+
year = "2026", month = jul, pages = "24144--24168",
|
|
125
|
+
address = "San Diego, California, United States",
|
|
126
|
+
publisher = "Association for Computational Linguistics",
|
|
127
|
+
url = "https://aclanthology.org/2026.acl-long.1107/",
|
|
128
|
+
ISBN = "979-8-89176-390-6"
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
<a id="nav-acknowledgments"></a>
|
|
133
|
+
|
|
134
|
+
## 🙏 Acknowledgments
|
|
135
|
+
|
|
136
|
+
Our work builds on [OSS-Fuzz](https://github.com/google/oss-fuzz) and [ARVO](https://arxiv.org/abs/2408.02153).
|
|
137
|
+
|
|
138
|
+
```bibtex
|
|
139
|
+
@misc{mei2024arvoatlasreproduciblevulnerabilities,
|
|
140
|
+
title = {ARVO: Atlas of Reproducible Vulnerabilities for Open Source Software},
|
|
141
|
+
author = {Xiang Mei and Pulkit Singh Singaria and Jordi Del Castillo and Haoran Xi and
|
|
142
|
+
Abdelouahab and Benchikh and Tiffany Bao and Ruoyu Wang and Yan Shoshitaishvili and
|
|
143
|
+
Adam Doupé and Hammond Pearce and Brendan Dolan-Gavitt},
|
|
144
|
+
year = {2024}, eprint = {2408.02153},
|
|
145
|
+
archivePrefix = {arXiv}, primaryClass = {cs.CR},
|
|
146
|
+
url = {https://arxiv.org/abs/2408.02153}
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```bibtex
|
|
151
|
+
@article{serebryany2017oss,
|
|
152
|
+
title = {$\{$OSS-Fuzz$\}$-Google's continuous fuzzing service for open source software},
|
|
153
|
+
author = {Serebryany, Kostya},
|
|
154
|
+
year = {2017}
|
|
155
|
+
}
|
|
156
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Bundled resources
|
|
2
|
+
|
|
3
|
+
SecureVibeBench installs the original dataset and evaluator from
|
|
4
|
+
[iCSawyer/SecureVibeBench](https://huggingface.co/datasets/iCSawyer/SecureVibeBench)
|
|
5
|
+
and bundles the source of [mini-swe-agent](https://github.com/SWE-agent/mini-swe-agent),
|
|
6
|
+
both licensed under the MIT license. Source distributions include the agent's
|
|
7
|
+
license in `mini-source.tar.gz`. Installed resources include both license texts
|
|
8
|
+
as `dataset/LICENSE` and `mini-swe-agent/LICENSE.md`.
|
|
9
|
+
|
|
10
|
+
The installed `resources.json` records the exact upstream commits and file
|
|
11
|
+
checksums. Dataset instructions, tests, and scoring code are preserved verbatim;
|
|
12
|
+
the host verifier is stored in `dataset/evaluator/` for packaging.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""PEP 517 backend that fetches the pinned HF dataset during installation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import gzip
|
|
6
|
+
import hashlib
|
|
7
|
+
import importlib.util
|
|
8
|
+
import io
|
|
9
|
+
import json
|
|
10
|
+
from pathlib import Path, PurePosixPath
|
|
11
|
+
import tarfile
|
|
12
|
+
import tempfile
|
|
13
|
+
|
|
14
|
+
from setuptools import build_meta as _backend
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
ROOT = Path(__file__).resolve().parent
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _prepare_resources() -> None:
|
|
21
|
+
package = ROOT / "evaluation"
|
|
22
|
+
release = json.loads((package / "resources.json").read_text())
|
|
23
|
+
spec = importlib.util.spec_from_file_location("svb_build_bootstrap", package / "bootstrap.py")
|
|
24
|
+
bootstrap = importlib.util.module_from_spec(spec)
|
|
25
|
+
spec.loader.exec_module(bootstrap)
|
|
26
|
+
snapshot = bootstrap.download_dataset(release=release)
|
|
27
|
+
|
|
28
|
+
with tarfile.open(package / "mini-source.tar.gz", "r:gz") as source:
|
|
29
|
+
mini = {}
|
|
30
|
+
for member in source.getmembers():
|
|
31
|
+
if not member.isfile() or not member.name.startswith("mini-swe-agent/"):
|
|
32
|
+
raise ValueError(f"Invalid bundled agent source: {member.name}")
|
|
33
|
+
mini[member.name] = source.extractfile(member).read()
|
|
34
|
+
|
|
35
|
+
with tempfile.TemporaryDirectory(prefix=".svb-build-", dir=ROOT) as temporary:
|
|
36
|
+
archive = Path(temporary) / "resources.tar.gz"
|
|
37
|
+
with archive.open("wb") as raw, gzip.GzipFile(filename="", mode="wb", fileobj=raw, mtime=0) as zipped:
|
|
38
|
+
with tarfile.open(fileobj=zipped, mode="w") as tar:
|
|
39
|
+
for name, expected in sorted(release["files_sha256"].items()):
|
|
40
|
+
relative = PurePosixPath(name)
|
|
41
|
+
if relative.is_absolute() or ".." in relative.parts:
|
|
42
|
+
raise ValueError(f"Unsafe resource path: {name}")
|
|
43
|
+
if name.startswith("dataset/evaluator/"):
|
|
44
|
+
path = snapshot / "habour/dev" / name.removeprefix("dataset/evaluator/")
|
|
45
|
+
content = path.read_bytes()
|
|
46
|
+
elif name.startswith("dataset/"):
|
|
47
|
+
content = (snapshot / "habour" / name.removeprefix("dataset/")).read_bytes()
|
|
48
|
+
else:
|
|
49
|
+
content = mini[name]
|
|
50
|
+
if hashlib.sha256(content).hexdigest() != expected:
|
|
51
|
+
raise ValueError(f"Resource checksum mismatch: {name}")
|
|
52
|
+
info = tarfile.TarInfo(name)
|
|
53
|
+
info.size, info.mode = len(content), 0o644
|
|
54
|
+
tar.addfile(info, io.BytesIO(content))
|
|
55
|
+
# Compression output can vary with Python/zlib versions. File checksums
|
|
56
|
+
# above pin the content; record the archive produced by this build.
|
|
57
|
+
release["archive_sha256"] = hashlib.sha256(archive.read_bytes()).hexdigest()
|
|
58
|
+
archive.replace(package / "resources.tar.gz")
|
|
59
|
+
(package / "resources.json").write_text(json.dumps(release, indent=2) + "\n")
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
|
|
63
|
+
_prepare_resources()
|
|
64
|
+
return _backend.build_wheel(wheel_directory, config_settings, metadata_directory)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def build_editable(wheel_directory, config_settings=None, metadata_directory=None):
|
|
68
|
+
_prepare_resources()
|
|
69
|
+
return _backend.build_editable(wheel_directory, config_settings, metadata_directory)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
build_sdist = _backend.build_sdist
|
|
73
|
+
get_requires_for_build_sdist = _backend.get_requires_for_build_sdist
|
|
74
|
+
get_requires_for_build_wheel = _backend.get_requires_for_build_wheel
|
|
75
|
+
get_requires_for_build_editable = _backend.get_requires_for_build_editable
|
|
76
|
+
prepare_metadata_for_build_wheel = _backend.prepare_metadata_for_build_wheel
|
|
77
|
+
prepare_metadata_for_build_editable = _backend.prepare_metadata_for_build_editable
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Usage Guide
|
|
2
|
+
|
|
3
|
+
Requirements: Python 3.12+, Linux x86_64, Docker Engine with Compose, and a running Docker daemon. We recommend [uv](https://docs.astral.sh/uv/getting-started/installation/); pip also works. uv is not a host package dependency.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Run in an isolated environment managed by uv
|
|
9
|
+
uvx securevibebench --help
|
|
10
|
+
|
|
11
|
+
# Or install into an active virtual environment
|
|
12
|
+
uv pip install securevibebench
|
|
13
|
+
|
|
14
|
+
# Or use pip
|
|
15
|
+
pip install securevibebench
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Create a virtual environment first if needed: `uv venv` or `python -m venv .venv`, then `source .venv/bin/activate`.
|
|
19
|
+
|
|
20
|
+
Installation downloads the pinned 105-task dataset and original evaluator from Hugging Face. pip/uv installs mini-swe-agent as a dependency. Docker images and container tools are prepared when evaluation starts.
|
|
21
|
+
|
|
22
|
+
## Source installation and development
|
|
23
|
+
|
|
24
|
+
From a source checkout:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python tools/install.py
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The installer uses uv when available, otherwise the current Python's pip. Use `--installer pip` to choose pip explicitly.
|
|
31
|
+
|
|
32
|
+
For editable source and development tools:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv sync
|
|
36
|
+
# Or with pip, in an active virtual environment
|
|
37
|
+
python tools/install.py --dev --installer pip
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The uv path creates `.venv`; activate it with `source .venv/bin/activate`. The pip path installs into the current environment.
|
|
41
|
+
|
|
42
|
+
## Evaluate
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
export OPENAI_API_KEY='<your-api-key>'
|
|
46
|
+
securevibebench eval --model 'openai/<model-name>' --task 992
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Omit `--task 992` to run all tasks, or repeat `--task` to select several. Without a persistent install, use `uvx securevibebench eval ...`. Other providers use their own prefix and credential variable, such as `anthropic/<model-name>` and `ANTHROPIC_API_KEY`.
|
|
50
|
+
|
|
51
|
+
For an OpenAI-compatible endpoint:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export MODEL_API_KEY='<your-endpoint-api-key>'
|
|
55
|
+
securevibebench eval --model 'openai/<model-name>' --task 992 \
|
|
56
|
+
--base-url 'http://<model-server>:8000/v1' \
|
|
57
|
+
--api-key-name MODEL_API_KEY \
|
|
58
|
+
--api-format openai_chat_completions
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The endpoint must be reachable from task containers. Set the key to `unused` if authentication is disabled. SAST is disabled by default. To enable it, pass `--run-sast TRUE` and provide Semgrep configuration and credentials such as `SEMGREP_APP_TOKEN`. See `securevibebench eval --help` for options.
|
|
62
|
+
|
|
63
|
+
## Results
|
|
64
|
+
|
|
65
|
+
Results are written to `runs/<job>/summary.json` under the current working directory, alongside trajectories, patches, and original reports. Functional and PoV security scores remain independent and retain the original scoring rules.
|
|
66
|
+
|
|
67
|
+
Downloaded data is cached in `~/.cache/securevibebench/huggingface/`; installed resources are extracted to `~/.cache/securevibebench/resources/`. Both respect `XDG_CACHE_HOME`. The package's `resources.json` records upstream commits and checksums. No `dev/` directory is required.
|
|
68
|
+
|
|
69
|
+
## Developer checks
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
uv run python -m unittest discover -s tests -v
|
|
73
|
+
uv build --sdist
|
|
74
|
+
uv run twine check dist/*.tar.gz
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
With pip, use `python -m unittest discover -s tests -v`, `python -m build --sdist`, and `python -m twine check dist/*.tar.gz` instead. Publish the source archive (`dist/*.tar.gz`) to PyPI. Development dependencies are installed by `tools/install.py --dev`. To refresh release resources, run `python tools/bundle_resources.py` (requires Git).
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""HF-sourced tasks and evaluation, orchestrated by official Harbor agents."""
|