Views
No views yet
| Metric | Score | Description |
|---|---|---|
| Bandit Pass Rate | 88.0% | Percentage of fixes that pass the Bandit static analysis security tool. |
| BLEU Score | 69.27 | High structural similarity to human-expert security patches. |
1import requests
2
3API_URL = "[https://api-inference.huggingface.co/models/oke39/llama3-8b-secure-code](https://api-inference.huggingface.co/models/oke39/llama3-8b-secure-code)"
4headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}
5
6payload = {
7 "inputs": """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
8
9You are Jack, a Secure Code Agent. Fix the security vulnerability in the provided code.<|eot_id|><|start_header_id|>user<|end_header_id|>
10
11def login(username, password):
12 # Vulnerable SQL Injection
13 query = "SELECT * FROM users WHERE username = '" + username + "' AND password = '" + password + "'"
14 cursor.execute(query)<|eot_id|><|start_header_id|>assistant<|end_header_id|>
15"""
16}
17
18response = requests.post(API_URL, headers=headers, json=payload)
19print(response.json())