Adaptive Trust-Oriented Runtime Security for AI-Generated Shell Scripts
The widespread adoption of AI-assisted code generation tools has dramatically increased the volume of shell scripts deployed in production environments, often with insufficient security review. This paper presents ACTE (Adaptive Context-aware Trust Engine), a runtime security framework that combines static lexical analysis with dynamic behavioral profiling and adaptive trust scoring to detect malicious or unsafe AI-generated shell scripts. We introduce a formal trust model based on a multi-dimensional risk vector, and evaluate ACTE on a dataset of 420 shell scripts (210 benign, 210 malicious) generated by large language models. Experimental results demonstrate F1-score of 0.915, ROC-AUC of 0.976, mean inference latency of ~0.51 ms per script, and a 93.8% reduction in false positives compared to ShellCheck. Ablation studies confirm that the adaptive trust weighting mechanism is the primary contributor to detection performance. The prototype implementation and dataset are publicly available at https://github.com/yakden/acte-secure-ai-shell-scripts under MIT License.
Authors
- Denys Yakymov (ORCID: https://orcid.org/0009-0005-2398-8976)
Institutions
- Kielce University of Technology (PL)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-06-30
- DOI
- https://doi.org/10.5281/zenodo.21072887
- Primary Topic
- Security and Verification in Computing
- Type
- article
- Field-Weighted Citation Impact
- 0.00