Downloads · 30 days
0
netgoat-ai/koda-waf-2
koda-waf-2 is a text classification model from netgoat-ai. Use it when you need a label for a piece of text. It is set up for scikit-learn. The card lists the license as mit.
Koda WAF 2 is an experimental AI-assisted Web Application Firewall classifier for HTTP request analysis. It classifies request-like inputs as benign or malicious.
Downloads · 30 days
0
Access
Public
Updated Jul 26, 2026
Repo size
3.2 MB
Likes
0
Public
Click a slice to open those files.
.joblib3.2 MB · 99%
From the Hugging Face model README
Koda WAF 2 is an experimental AI-assisted Web Application Firewall classifier for HTTP request analysis. It classifies request-like inputs as benign or malicious.
Repository:
https://huggingface.co/netgoat-ai/koda-waf-2
Current artifact:
koda_waf_2_advanced.joblib
The model was trained on structured HTTP request fields:
method
path
query
headers
body
For the advanced model, inference expects a pandas DataFrame with those columns.
pip install huggingface_hub joblib pandas scikit-learn
import joblib
import pandas as pd
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(
repo_id="netgoat-ai/koda-waf-2",
filename="koda_waf_2_advanced.joblib",
)
payload = joblib.load(model_path)
model = payload["model"]
request = pd.DataFrame(
[
{
"method": "GET",
"path": "/api/search",
"query": "q=' OR '1'='1",
"headers": "user-agent:test-client",
"body": "",
}
]
)
label = model.predict(request)[0]
classes = list(model.classes_)
probabilities = model.predict_proba(request)[0]
print("label:", label)
print(dict(zip(classes, probabilities)))
Benign-looking request:
{
"method": "GET",
"path": "/api/search",
"query": "q=laptop&page=1",
"headers": "user-agent:browser accept:application/json",
"body": "",
}
Suspicious request:
{
"method": "GET",
"path": "/api/search",
"query": "q=' OR '1'='1",
"headers": "user-agent:test-client",
"body": "",
}
Local held-out CSV evaluation for koda_waf_2_advanced.joblib:
accuracy: 0.9853
benign precision 1.00 recall 0.98 f1 0.99
malicious precision 0.97 recall 1.00 f1 0.98
Local test split size:
15,000 rows
8,801 benign
6,199 malicious
This repository uses a .joblib model artifact. Joblib uses Python pickle under the hood, and pickle files can execute code when loaded. Only load this model if you trust the repository and artifact.
Hugging Face may show security warnings for pickle/joblib artifacts. That is expected for this file type and should be taken seriously.
Good uses:
Do not use:
MIT License.