ai-lc4j-demos/demo-08
2025-03-28 17:53:29 +01:00
..
src/main chore: fix model URLs 2025-03-28 17:53:29 +01:00
pom.xml chore: Add README.md files 2025-03-28 17:36:22 +01:00
README.md chore: Add README.md files 2025-03-28 17:36:22 +01:00

Demo 08 - Guardrails

We will explore how to mitigate prompt injection using input guardrails, that are a set of functions executed before and after the LLMs response to ensure the safety and reliability of the interaction.

Prompt injection

Prompt injection is a security risk that arises when malicious input is crafted to manipulate the behavior of an LLM.

LLMs are particularly susceptible to these attacks because they are trained to follow natural language instructions, which can be exploited to alter their intended logic.

To mitigate prompt injection, developers should implement validation mechanisms, such as input sanitization and strict control over which functions the model is allowed to call.