Prompt enforcement¶
Before you begin¶
Follow the steps in the Running in a container topic to run F5 AI Gateway using Docker.
Overview¶
The F5 Prompt Enforcement processor runs in the AI Gateway container and helps to shape prompts. It can be configured to apply any required rules to the prompt before being passed to the upstream LLM.
Configuration¶
Direction |
Supported |
---|---|
Input |
Yes |
Response |
No |
processors:
- name: prompt-enforcement
type: external
config:
endpoint: "localhost:8000"
version: 1
params:
rules: []
Note
This processor should be configured to be the final processor in an input stage to avoid conflicts.
Note
To get the best results from this processor, use system messages rather than prohibitive instructions. A system message could define the prompt’s role, such as: “You are a bot that handles returns for an online store.” whereas a prohibitive instruction would be something like: “Do not talk about software development.”
Parameters¶
Parameters |
Description |
Required |
Defaults |
Examples |
---|---|---|---|---|
|
A list of strings representing the rules which will be applied to the prompt. |
No |
“Do not generate anything illegal or dangerous” |
“Only talk about insurance related issues” |