Search arXiv⌕ Search

arXiv subjects

Shreyas Mahajan

Publications and source records attributed to Shreyas Mahajan.

2 recordsLinked to original sources

Fast but Forgetful: Cross-Agent KV Reuse Breaks Decision Fidelity in LLM Security Review

Multi-agent software engineering increasingly relies on specialized agents to generate, review, and validate code, creating redundancy when the same program is processed across different contexts. Cross-context key-value (KV) cache reuse can reduce this cost, but whether it preserves security-critical decisions remains unclear. We study this as an inference-fidelity problem by holding the model, code, prompt, and decoding configuration fixed and comparing approximate reuse against identical-input exact dense inference. Across 533 paired gate-hit executions spanning three open-weight models, KVCOMM admits 65.8% of validator calls to reuse and achieves a mean 2.52x TTFT speedup. Yet approximate execution changes 40.6-85.7% of security reports and silences 21.7-89.5% of dense vulnerability findings while creating at most 5.3% new findings. Most suppressed findings transition from FAIL to NOT APPLICABLE, revealing a strongly directional fidelity failure. A structurally distinct KV-reuse method, CacheBlend, reproduces the same pattern of decision deviation. PrimeVul experiments further show that both mechanisms can suppress dense detections corresponding to externally labeled vulnerabilities. Cross-context KV reuse can therefore improve inference efficiency while silently altering downstream security behavior.

cs.CR↗

The Illusion of Secure LLM Code: Closing the Security Gap via Iterative Reprompting

Large Language Models (LLMs) are increasingly integrated into software development workflows, yet their ability to autonomously generate secure authentication code remains uncertain. This paper evaluates the security architecture of authentication systems generated by five prominent AI coding assistants through a bi-modal assessment framework combining static code analysis and dynamic penetration testing, mapped to NIST SP 800-63B guidelines. The study examines model behavior across four prompting strategies Basic, Secure, NIST-Based, and Reprompting to reflect varying levels of developer guidance. Empirical results demonstrate that code generated from functional or generically secure prompts consistently omits critical protections, particularly concerning brute-force resistance, session management, and robust password handling. While providing explicit, single-shot NIST context significantly improves compliance, the findings reveal that this remains structurally inadequate. Instead, iterative Reprompting: forcing models into a contextual self-auditing loop is strictly required to achieve a comprehensive, defense-in-depth security architecture. Ultimately, this study proves that current AI coding assistants do not produce secure-by-default applications, dictating that enterprise deployments must transition from single-shot prompt engineering to continuous, standards-driven verification pipelines.

cs.CR↗