You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before you continue with this lab, here is a recap on what has been done/completed and what the pending/to-do task. This lab is to learn how to deploy F5 AI Gateway and configure AIGW policy.
161
161
162
162
.. image:: ./_static/class5-1-0-0.png
@@ -210,6 +210,10 @@ Try to interact with GenAI RAG Chatbot.
210
210
211
211
.. image:: ../class4/_static/class4-9.png
212
212
213
+
.. NOTE::
214
+
215
+
You may need to make multiple repeated queries, to provide more data to the smaller CPU inferencing AI model.
216
+
213
217
214
218
.. attention::
215
219
You may occasionally see document identifiers, such as *"<doc id='2'>,"* appear in the response output. This issue can arise for several reasons, such as inadequate post-processing where metadata is not properly cleaned or removed, or during pre-processing when data is tagged with metadata that the model interprets as legitimate text. In this particular lab, the issue is likely due to a combination of factors, including the inference and embedding model's behavior and the use of a CPU for processing. **For the purposes of this class, please ignore if any imperfection of the AI responses.**
@@ -222,7 +226,7 @@ The GenAI RAG chatbot after asking both questions. Sometimes you may need to ask
222
226
.. image:: ../class4/_static/class4-10.png
223
227
224
228
.. attention::
225
-
As shown above, GenAI RAG Chatbot exposed sensitive information (PII) - **OWASP Top 10 - LLM01:2025 Sensitive Information Disclosure**. We need to leverage F5's AI Gateway to redact PII data
229
+
As shown above, GenAI RAG Chatbot exposed sensitive information (PII) - **OWASP Top 10 - LLM01:2025 Sensitive Information Disclosure**. We need to leverage F5's AI Gateway to redact PII data
226
230
227
231
Apart from exposing sensitive information (PII), the chatbot also reveal sensitive data via system prompt leakage - **OWASP Top 10 - LLM07:2025 System Prompt Leakage**.
228
232
@@ -471,7 +475,7 @@ Update AIGW policy by upgrading the helm chart with the AIGW configuration file.
471
475
cd~/ai-gateway/aigw-core/
472
476
473
477
.. code-block:: bash
474
-
:caption: Update the aigw-core value file with the embeded policy.
478
+
:caption: Update the aigw-core value file with the embedded policy.
In a previous step, we installed and setup Open-WebUI portal. It is a simple chat frontend that allows users to interact with the LLM model. In this section, we will implement a governance layer to the interaction with LLM model by enforcing traffic through AIGW. This will allow us to apply respective AI security policy.
1121
+
1122
+
From the Windows 10 Jumphost, open the Chrome browser, and confirm you can access the Open-Webui service.
You do not need to update Open-WebUI to the latest version when prompted. This lab has been tested with the currently installed version, so you can safely ignore the update recommendation.
1115
1139
1116
-
In our previous steps, we had install and setup Open-WebUI portal. It is a simple chat frontend that allows users to interact with the LLM model. In this section, we will implement a governance layer to the interaction with LLM model by enforcing traffic through AIGW. This will allow us to apply respective AI security policy.
1117
1140
1118
1141
Simulate sending out sensitive information by employee.
1119
1142
@@ -1125,19 +1148,40 @@ Simulate sending out sensitive information by employee.
1125
1148
.. image:: ./_static/class5-37-a.png
1126
1149
1127
1150
1128
-
Update Open-WebUI to use AIGW as the inference endpoint.
1151
+
Open-WebUI configuration is using the LLM model endpoint directly.
1152
+
1153
+
Now, lets update Open-WebUI to use AIGW as the inference endpoint.
1154
+
1155
+
.. NOTE::
1129
1156
1130
-
Existing Open-WebUI configuration is using the LLM model endpoint directly. We will update it to use AIGW as the inference endpoint.
1157
+
You may need to click the Hamburger button on the left to reveal the Admin Panel option (pictured).
1158
+
1159
+
Then navigate to Settings -> Connections.
1131
1160
1132
-
For API key, can be any value (e.g. f5123), as AIGW will not validate the API key.
API key, can be any value (e.g. 42), as AIGW will not validate the API key.
1179
+
1180
+
Click **Save**
1137
1181
1138
1182
.. image:: ./_static/class5-37-c.png
1139
1183
1140
-
Validate the outcome by sending out sensitive information.
1184
+
Start a new chat and validate the outcome by sending out sensitive information.
1141
1185
1142
1186
.. code-block:: bash
1143
1187
@@ -1147,12 +1191,13 @@ Validate the outcome by sending out sensitive information.
1147
1191
1148
1192
.. NOTE::
1149
1193
1150
-
You may need to make multiple repeated queries, as LLM occasinally may not response when it sees sensitive data. This also cloud be attributed because our environment is running on CPU.
1194
+
You may need to make multiple repeated queries, as LLM occasionally may not response when it sees sensitive data. This also cloud be attributed because our environment is running on CPU.
1195
+
You can also try asking: "echo this text please: S0000004C"
1151
1196
1152
1197
Direct Prompt Injection
1153
1198
~~~~~~~~~~~~~~~~~~~~~~~~
1154
1199
1155
-
A Prompt Injection Vulnerability occurs when user prompts alter the LLM’s behaviour or output in unintended ways. These inputs can affect the model even if they are imperceptible to humans, therefore prompt injections do not need to be human-visible/readable, as long as the content is parsed by the model.
1200
+
A Prompt Injection Vulnerability occurs when user prompts alter the LLM’s behavior or output in unintended ways. These inputs can affect the model even if they are imperceptible to humans, therefore prompt injections do not need to be human-visible/readable, as long as the content is parsed by the model.
1156
1201
1157
1202
Type of Prompt Injection
1158
1203
@@ -1164,7 +1209,7 @@ In this use case, we will test a direct prompt injection.
1164
1209
From a separate terminal, monitor AIGW Core logs.
1165
1210
1166
1211
.. code-block:: bash
1167
-
:caption: Change directory to ai-gatway to switch to AIGW core cluster.
1212
+
:caption: Change directory to ai-gateway to switch to AIGW core cluster.
1168
1213
1169
1214
cd~/ai-gateway
1170
1215
@@ -1178,7 +1223,7 @@ From a separate terminal, monitor AIGW Core logs.
1178
1223
1179
1224
Test prompt-injection from Arcadia RAG Chatbot
1180
1225
1181
-
In end of Class 4 (before implment AI security protection), we experience that Arcadia RAG Chatbot vulnerable to OWASP Top 10 - LLM07:2025 - System Prompt Leakage via a direct prompt injection. In this section, we will test the prompt-injection attack vector against Arcadia RAG Chatbot but this time, we will leverage the AIGW prompt-injection processor to detect and prevent the prompt-injection attack.
1226
+
In end of Class 4 (before implementation of AI security protection), we experienced that Arcadia RAG Chatbot was vulnerable to OWASP Top 10 - LLM07:2025 - System Prompt Leakage via a direct prompt injection. In this section, we will test the prompt-injection attack vector against Arcadia RAG Chatbot but this time, we will leverage the AIGW prompt-injection processor to detect and prevent prompt-injection attacks.
1182
1227
1183
1228
1184
1229
.. code-block:: bash
@@ -1188,10 +1233,14 @@ In end of Class 4 (before implment AI security protection), we experience that A
1188
1233
1189
1234
.. image:: ./_static/class5-37-e.png
1190
1235
1236
+
.. NOTE::
1237
+
1238
+
The chatbot response will be delayed. AI Gateway is blocking the request as expected, but our LLM Orchestrator Flowise is retrying the request. After some time, a timeout message will be provided to the user. A custom error message can be configured in Flowise in a future lab to handle this use-case.
1239
+
1191
1240
Example logs shown **AIGW_POLICY_VIOLATION**. **Possible Injection detected**. This is the expected outcome, as we have successfully prevented the prompt-injection attack.
1192
1241
1193
1242
1194
-
Alternatively, you can also use similar prompt-injection attack vector on Open-WebUI.
1243
+
Alternatively, for a quicker response, you can attempt similar prompt-injection attacks on Open-WebUI.
0 commit comments