Responsible Prompt Engineering: An Embedding Based Approach to Secure LLM Interactions

Securing the interaction layer of large language models (LLMs) against emerging threats is paramount for their responsible and ethical deployment. These powerful AI systems, while offering flexibility, are highly susceptible to prompt injection, abuse and the generation of malicious behaviors. In this paper, we propose a novel, ethical governance approach for responsible prompt engineering, based on pre inference semantic threat detection. This methodology involves converting user prompts into semantically rich embedding vectors using Sentence Transformer (all-MiniLM-L6-v2). These vectors are then classified using a Random Forest model into various cybersecurity threat categories, such as Malware Attacks, Cryptographic Attacks, Intrusion Attack, Evasion attack, and several others. Validated extensively on the Cysecbench dataset, a comprehensive benchmark of real-world cybersecurity prompts, the presented system shows a strong multi-class classification ability with an overall macro averaged precision of 0.91, recall of 0.89, F1-score 0.90, and an accuracy of 91.3%. This approach aligns with the SPIN framework and provides a scalable solution to reduce ethical risks in LLM deployment, thereby contributing to the development of responsible AI system.

Authors

Publication Details

Journal
International Journal for Research in Applied Science and Engineering Technology
Published
2025-06-11
DOI
https://doi.org/10.22214/ijraset.2025.72157
Primary Topic
Information and Cyber Security
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Responsible Prompt Engineering: An Embedding Based Approach to Secure LLM Interactions

Pulkit Sharma
International Journal for Research in Applied Science and Engineering Technology
Information and Cyber Security
article

Responsible Prompt Engineering: An Embedding Based Approach to Secure LLM Interactions

Pulkit Sharma
article en

Abstract

Securing the interaction layer of large language models (LLMs) against emerging threats is paramount for their responsible and ethical deployment. These powerful AI systems, while offering flexibility, are highly susceptible to prompt injection, abuse and the generation of malicious behaviors. In this paper, we propose a novel, ethical governance approach for responsible prompt engineering, based on pre inference semantic threat detection. This methodology involves converting user prompts into semantically rich embedding vectors using Sentence Transformer (all-MiniLM-L6-v2). These vectors are then classified using a Random Forest model into various cybersecurity threat categories, such as Malware Attacks, Cryptographic Attacks, Intrusion Attack, Evasion attack, and several others. Validated extensively on the Cysecbench dataset, a comprehensive benchmark of real-world cybersecurity prompts, the presented system shows a strong multi-class classification ability with an overall macro averaged precision of 0.91, recall of 0.89, F1-score 0.90, and an accuracy of 91.3%. This approach aligns with the SPIN framework and provides a scalable solution to reduce ethical risks in LLM deployment, thereby contributing to the development of responsible AI system.

International Journal for Research in Applied Science and Engineering TechnologyVol. 13(6)
Openalex Percentile: Top 81%
Information and Cyber Security
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.