A Hybrid Approach for Automated Security Pattern Recovery
Not on the map. Why?
Abstract (arXiv)
Security-by-design emphasises integrating security into software design and development. Security pattern catalogues operationalise this principle by prescribing reusable architectural solutions to recurring security problems. However, recovering their implementations from source code remains challenging because security patterns are abstract, span multiple components, and admit many valid implementations. We present SecPatRec, a hybrid approach for automated security pattern recovery from source code repositories. We treat a security pattern as a reference architecture and frame its recovery as a deductive task: determining which prescribed roles are present, grounding them in code entities, and recovering their interaction sequences. SecPatRec pairs a ReAct-style LLM agent equipped with semantic and lexical code search for role detection and grounding with static code property graph analysis for interaction recovery. We curate a human-validated ground-truth dataset of 100 pattern instances covering five security patterns across 93 open-source Java and Python repositories, and introduce a three-level evaluation framework measuring recovery correctness against this ground truth. We evaluate SecPatRec using four LLMs, including proprietary and open-source models. Averaged over all models and pattern instances, SecPatRec achieves role-detection accuracy of 0.84, role-grounding similarity of 0.84, and an interaction-recovery score of 0.66. Compared to a one-shot end-to-end LLM baseline, SecPatRec achieves higher aggregate recovery scores and lower estimated LLM API costs per run, while processing repositories that exceed the baseline's configured input limit. The recovered role mappings and statically derived interaction sequences provide structural and behavioural evidence that can support inspection of security-pattern implementations.
Key facts. No citing papers in the map yet (data through 26 Nov 2026). Builds on 11 of its 62 references that are in the map. Submitted 4 Nov 2026.
Builds on
11 of 62 references.
References · 11
- 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 9,589
- 2023C-Pack: Packed Resources For General Chinese Embeddingscited by 701
- 2024Large Language Models for Cyber Security: A Systematic Literature Reviewcited by 76
- 2024MEGAnno+: A Human-LLM Collaborative Annotation Systemcited by 51
- 2024Can LLMs Replace Manual Annotation of Software Engineering Artifacts?cited by 46
- 2023The Vault: A Comprehensive Multilingual Dataset for Advancing Code Understanding and Generationcited by 22
- 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 17
- 2023Software Architecture Recovery with Information Fusioncited by 7
- 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyondcited by 4
- 2023A Study of Documentation for Software Architecturecited by 2
- 2025SpareCodeSearch: Searching for Code Context When You Have No Spare GPUcited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Self-Evolving Static Analysis via LLM Pseudo-Labeling
- 2026SEEK: Agentic Knowledge Graph Retrieval for Secure Code Generation
- 2026AgenticRepair: Multi-Faceted Program Context Engineering for Agentic Vulnerability Repair
- 2026Antaeus: Hunting Repository-Level Logic Vulnerabilities via Context-Grounded LLM Reasoning ↗
- 2024Enhancing Source Code Security with LLMs: Demystifying The Challenges and Generating Reliable Repairs
- 2025QLCoder: A Query Synthesizer For Static Analysis of Security Vulnerabilities
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias
- 2026Inference-Time Safety For Code LLMs Via Retrieval-Augmented Revision