AI agents with large language models (LLMs) can handle user requests, fetch external data, understand external tools' responses, and execute actions on external tools. These are features that enhance automation but also create security concerns. Malicious instructions in a user prompt, web page, document, or tool output can cause an agent to act in an inappropriate way, rather than following the user's intent [1] and [2]. This study introduces a straightforward security framework to mitigate the threat of prompt injection tampering on AI tools that are used by people. This study suggests a simple security framework for decreasing the risk of prompt injection affecting people using tools with AI. The framework consists of four functions: the collection of contexts, the analysis of context, the detection of prompt, and the validation of tools. The suspected trust and suspicious attributes of input elements and proposed tool requests are classified based on their content, and the original user goal is checked for relevance, for suspected influence from suspicious context, and for action sensitivity. The framework makes one of four decisions based on these checks: Allow, Monitor, Require Confirmation, and Block. The paper also provides a reproducible experimental methodology based on comparison with the approach without any security mechanism and with basic prompt filtering. At this point no experimental results are claimed. This contribution is a practical approach that maps context analysis and pre-execution validation of agent tool requests.
Prompt Injection; AI Agent Security; Large Language Models; Tool Validation; Context-Aware Security; Indirect Prompt Injection
Shivam Rai, Dr. Sandeep Kumar Soni, Kshama Rani Sahu. Prompt Injection and Unauthorized Tool Usage Detection In AI Agents With a Context-Aware Security Framework. Indian Journal of Modern Research and Reviews. 2026; 4(9):141-147
Download PDF