Class InputGuardPlugin

java.lang.Object
com.axelor.ai.chat.plugin.InputGuardPlugin
All Implemented Interfaces:
ChatPlugin

public class InputGuardPlugin extends Object implements 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 Details

    • InputGuardPlugin

      public InputGuardPlugin()
  • Method Details

    • priority

      public int priority()
      Description copied from interface: ChatPlugin
      Execution priority. Lower values run first. Default is 100.
      Specified by:
      priority in interface ChatPlugin
    • onRequest

      public ChatRequest onRequest(ChatRequest request)
      Description copied from interface: ChatPlugin
      Called before the loop starts. May inspect or transform the request (e.g. resolve agent config, check rate limits).
      Specified by:
      onRequest in interface ChatPlugin