Kairos Sotos 2.0 (4B BF16)
Kairos Sotos 2.0 is an offline, autonomous cybersecurity and privacy code auditor fine-tuned from Qwen/Qwen3.5-4B. It reports the audit verdict, evidence, smallest safe remediation diff, and exact CWE along with versioned framework IDs.
This repository hosts the full-precision BF16 (16-bit Brain Float) GGUF binary, preserving 100% of fine-tuned weight fidelity with zero quantization loss.
Key Achievements & Highlights
- 100% Consumer GPU Resident: At 8.4 GB, the entire unquantized model fits into a standard 12 GB VRAM consumer card (e.g. NVIDIA RTX 3060), leaving ~3.6 GB of VRAM headroom for up to 8,192 tokens of context without GPU memory thrashing or CPU offloading.
- 30% Size Reduction vs 1.0: Reduced file size from 12.0 GB (1.0 baseline) down to 8.4 GB while simultaneously upgrading from quantized to full-precision BF16.
- Zero False-Positive Degradation: In benchmark tests (Promptfoo TC02), Sotos 1.0 hallucinated SQL injection on safe parameterized queries (
%s). Sotos 2.0 cleared 10/10 safe controls (0% false alarm rate).
- Empirical Benchmark Score: Achieved 98.4% (9.84 / 10.0) across a 25-case complex vulnerability suite (23 of 25 cases scored a perfect 10.0/10.0).
- Native OWASP Top 10:2025 Fluency: Correctly attributes Injection to
A05:2025 and explains why A03:2021 is historical, while reserving A03:2025 for Software Supply Chain Failures.
- OWASP GenAI LLM Top 10:2026: Native support for auditing autonomous agentic workflows, including Excessive Agency (
LLM03:2026) and Sensitive Information Disclosure (LLM02:2026).
- Privacy & Data Protection: Directly audits GDPR (Regulation (EU) 2016/679) and LGPD (Lei 13.709/2018) compliance for storage limitation and children's data handling.
- Bilingual Auditor: Fluently conducts code audits in English and Portuguese (PT-BR) while preserving all code identifiers in English.
Model Comparison: Sotos 2.0 vs Sotos 1.0
| Metric / Dimension |
Kairos Sotos 2.0 (New) |
Kairos Sotos 1.0 (Legacy) |
Operational Significance |
| Model Size |
8.4 GB |
12.0 GB |
30.0% smaller disk & transfer footprint |
| Precision |
BF16 (Unquantized) |
Q6_K_M (Quantized) |
Zero mathematical perplexity degradation |
| VRAM Footprint (RTX 3060) |
~8,023 MiB (67%) |
~11,850 MiB (99%) |
+3.6 GB headroom for 8k token context window |
| Promptfoo Pass Rate |
100.0% (5 / 5) |
80.0% (4 / 5) |
v0 failed on safe parameterized SQL |
| False Positive Rate |
0.0% (10 / 10 Safe) |
50.0% False Alarms |
Eliminates developer alert fatigue |
| 25-Suite Score |
9.84 / 10.0 (98.4%) |
Baseline |
246 / 250 points (23 perfect 10/10) |
| OWASP Edition |
Top 10:2025 Native |
Top 10:2021 Legacy |
Correctly separates A05 Injection from A03 Supply Chain |
| Agentic AI Safety |
OWASP GenAI 2026 |
Not Supported |
Audits Excessive Agency (LLM03) and Tool Redaction (LLM02) |
| Thinking Loop Hang |
Resolved |
Template Hang |
Streams directly to Verdict: ... in ~4-5 seconds |
Benchmark Results Summary
Full per-test breakdown is documented in BENCHMARK.md.
25-Case Complex Security Suite
| Category |
Cases Tested |
Score |
Key Sinks Audited |
| SQL Injection |
2 |
10.0 / 10 |
ORM raw interpolation, cast int safe negative |
| SSRF |
2 |
10.0 / 10 |
Prefix/redirect bypass, parsed host safe negative |
| Path Traversal |
2 |
10.0 / 10 |
Unconfined upload root, canonical is_relative_to safe |
| Command Injection |
2 |
10.0 / 10 |
Shell -c concatenation, direct argv vector safe |
| XXE Injection |
2 |
10.0 / 10 |
External entity expansion, disallow-doctype-decl safe |
| IDOR / BOLA |
2 |
10.0 / 10 |
Missing owner check, authenticated session binding |
| Insecure Deserialization |
2 |
10.0 / 10 |
Python pickle.loads, safe json.loads negative |
| Cryptographic Failures |
1 |
7.0 / 10 |
JWT algorithm confusion (['RS256', 'HS256']) |
| Hardcoded Credentials |
2 |
10.0 / 10 |
API token in source, environment variable ingest |
| CRLF Header Injection |
2 |
10.0 / 10 |
Unescaped response header, regex strip safe |
| CI/CD Supply Chain |
1 |
10.0 / 10 |
pull_request_target script injection & token write |
| K8s Pod Security |
2 |
10.0 / 10 |
Privileged container vs Restricted PSS profile |
| LLM Agentic Safety |
2 |
10.0 / 10 |
Destructive tool agency (LLM03), tool output PII filter |
| Privacy Compliance |
1 |
10.0 / 10 |
GDPR Art. 5/8/9 & LGPD storage limitation & minor consent |
| Total / Overall |
25 |
9.84 / 10 |
246.0 / 250.0 Total Points (98.4%) |
Noticeable Limits & Operational Boundaries
To ensure transparent production deployment:
- AST Scope: Sotos 2.0 is specialized for single-function, endpoint handler, middleware, and configuration audits. It does not replace global cross-repository taint graph analyzers (e.g. CodeQL) across millions of distributed lines without an orchestrator providing snippet context.
- Defensive-Only Policy: Sotos strictly refuses to generate weaponized exploit payloads, SQL injection query strings (e.g.
' OR 1=1 --), or automated attack scripts.
- Cryptographic Nuances (TC15): In JWT algorithm confusion scenarios (
['RS256', 'HS256']), Sotos flags the CWE-347 risk and recommends pinning RS256, but makes conservative assumptions regarding server signature verification defaults.
- Hardware Threshold: For real-time 35–45 tokens/second throughput, a GPU with at least 10–12 GB VRAM is recommended. On CPU-only RAM, speeds degrade to 4–6 tokens/second.
Quickstart with Ollama
Step 1: Download Files
Clone or download kairos-sotos-2.0-4B-BF16.gguf and Modelfile into the same folder.
Step 2: Register in Ollama
ollama create kairos-sotos:2.0-4b -f Modelfile
Step 3: Run Interactive Audit
ollama run kairos-sotos:2.0-4b
Step 4: Python API Example
import urllib.request
import json
code_snippet = """
def load_user_invoice(invoice_id):
invoice = Invoice.query.filter_by(id=invoice_id).first()
return jsonify(invoice.serialize())
"""
prompt = f"Review this python snippet. Give the verdict, the evidence, the impact, the CWE, the versioned framework id, and the smallest fix. Do not provide an exploit.\n\n```python\n{code_snippet}\n```"
req = urllib.request.Request(
"http://127.0.0.1:11434/api/chat",
data=json.dumps({
"model": "kairos-sotos:2.0-4b",
"messages": [{"role": "user", "content": prompt}],
"stream": False,
"options": {"temperature": 0}
}).encode(),
headers={"Content-Type": "application/json"}
)
response = json.loads(urllib.request.urlopen(req).read())
print(response["message"]["content"])
Modelfile Specification
FROM ./kairos-sotos-2.0-4B-BF16.gguf
TEMPLATE """{{- if .System }}<|im_start|>system
{{ .System }}<|im_end|>
{{ end }}{{- range .Messages }}<|im_start|>{{ .Role }}
{{ .Content }}<|im_end|>
{{ end }}<|im_start|>assistant
<think>
</think>
"""
SYSTEM """You are Kairos Sotos, a local security and privacy auditor. Report a verdict, the evidence, the smallest safe fix, and the CWE plus the versioned framework id when one applies. Use OWASP Top 10:2025 for web application risks, OWASP API Security Top 10:2023 for HTTP APIs, and OWASP GenAI LLM Top 10:2026 for LLM applications. Do not describe an older edition as the current list. Do not provide an exploitable proof of concept, a ready-to-run payload, or step-by-step attack instructions. If the code or configuration is safe, say that no exploitable vulnerability was found and name the control that holds.
Audit for both syntactic vulnerabilities (such as injection, unescaped interpolation, format strings, and parser configuration) and semantic vulnerabilities (such as broken access control, IDOR/BOLA, missing ownership checks, and multi-tenant isolation failures). When an endpoint or function retrieves an object by identifier, verify whether caller identity is bound to resource ownership.
If asked who you are or what model you are, state clearly that you are Kairos Sotos. Reply in the user's language. Keep code identifiers in English."""
PARAMETER stop "<|im_start|>"
PARAMETER stop "<|im_end|>"
PARAMETER num_ctx 8192
PARAMETER temperature 0
License
Apache 2.0 (same as the Qwen 3.5 base model).