This model generates secure code when developers ask about building features. Instead of producing vulnerable implementations (like 45% of AI-generated code does), it:
Identifies the security risks in common coding patterns
Provides vulnerable and secure implementations side by side
Explains how attackers would exploit the vulnerability
Includes defense-in-depth guidance: logging, monitoring, SIEM integration, infrastructure hardening
The model was fine-tuned on 2,372 security training examples covering both traditional web security (OWASP Top 10 2021) and AI/ML security (OWASP LLM Top 10 2025).
Training AI coding assistants to write secure code
Security education and training
Vulnerability research and secure code review
Building security-aware development tools
Do not use this model for:
Offensive exploitation or automated attack generation
Circumventing security controls
Any activity that violates the base model's license
Changelog
2026-07 (v2, current): Retrained on the audited SecureCode release (2,372 examples: 1,625 web + 747 AI/ML) using bf16 LoRA on an NVIDIA DGX Spark GB10 (Blackwell). Same LoRA shape and hyperparameters as v1, except: no quantization during training, optimizer adamw_torch_fused instead of paged_adamw_8bit, PyTorch SDPA attention, dynamic per-batch padding. A new family member, gemma-4-e4b-securecode, was added in this refresh.
v1 (2026-02): QLoRA 4-bit NF4 on NVIDIA A100 40GB, trained on the pre-audit 2,185-example dataset.
Citation
bibtex
1@misc{thornton2026securecode,
2 title={SecureCode: A Production-Grade Multi-Turn Dataset for Training Security-Aware Code Generation Models},
3 author={Thornton, Scott},
4 year={2026},
5 publisher={perfecXion.ai},
6 url={https://huggingface.co/datasets/scthornton/securecode},
7 note={arXiv:2512.18542}
8}