SafetySecurityTrustworthinesscs.SE
Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision
Manisha Mukherjee, Vincent J. Hellendoorn
March 2, 2026
arXiv.org
Key Takeaways
-
AI safety doesn't require retraining models: The paper demonstrates that security improvements can be achieved at inference time (when the model generates code) rather than requiring expensive model retraining, making safety updates faster and more practical for deployed systems.
-
Transparency matters for trustworthiness: By grounding safety interventions in real expert explanations from Stack Overflow, the approach makes the AI's reasoning visible and understandable to developers, rather than applying opaque safety filters that users cannot interpret or challenge.
-
Code-generating AI systems need continuous adaptation: Since new security vulnerabilities are discovered regularly and coding standards evolve, static AI models trained once become outdated; this work shows how to keep AI systems current with emerging threats without full model retraining.
-
Real-time intervention prevents harm before deployment: The system catches unsafe code suggestions and revises them before developers use them, rather than relying on post-deployment detection—a critical safeguard for high-stakes software development environments.
-
Practical security improvements are measurable: Testing on real-world datasets showed improved code security with no introduction of new vulnerabilities, suggesting this approach could be implemented in production systems today to reduce AI-generated security risks.