Package com.axelor.ai.chat.plugin
Class InputGuardPlugin
java.lang.Object
com.axelor.ai.chat.plugin.InputGuardPlugin
- All Implemented Interfaces:
ChatPlugin
Defends against prompt injection by injecting security rules into the conversation. Runs at
priority 5 (before all other plugins) so the defense prompt is always present.
Instead of regex-based detection (which only works in one language), this plugin injects instructions that tell the LLM to recognize and reject manipulation attempts in any language.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiononRequest(ChatRequest request) Called before the loop starts.intpriority()Execution priority.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.ai.chat.ChatPlugin
decorateProvider, decorateToolExecutor, decorateWriter, estimateInjectedTokens, onComplete, onError, onMessage
-
Constructor Details
-
InputGuardPlugin
public InputGuardPlugin()
-
-
Method Details
-
priority
public int priority()Description copied from interface:ChatPluginExecution priority. Lower values run first. Default is 100.- Specified by:
priorityin interfaceChatPlugin
-
onRequest
Description copied from interface:ChatPluginCalled before the loop starts. May inspect or transform the request (e.g. resolve agent config, check rate limits).- Specified by:
onRequestin interfaceChatPlugin
-