Custom detections
Add your own detections to an app when the built-in guardrail categories do not describe what you need caught, such as an internal project codename, a customer ID format or competitor mentions.
Add one to an app
Custom detections are defined per app. Open the app from Settings > AI Gateway > LLM Gateway and choose any Configure option to open the app workspace's Settings tab, then select Custom Detections under Protection.
Detection types
Fields
Create a detection
- Choose Precision (regex) or Intent.
- Enter a new Detection ID, a Display name and a Code name.
- Add the regexes, or the intent description and examples.
- Select Save detection.
Save detection applies the change immediately. It does not wait for the app's Save settings button, and it is recorded in the app's Audit Log.
For intents, add negative examples that are close to the positive ones. A detection for "competitor pricing questions" needs negatives such as "what is our own pricing?" to stay precise.
Going further with the Policy Engine
Custom detections stay editable in app settings when the Policy Engine is on; they do not freeze (see What happens to classic settings). In the Data & Adversarial Risks card, they appear under the Custom group of the data type picker, so a data rule can give them their own action, threshold, stage and scope. For example, block a project codename only for one Smart group, or only on requests to one provider. See Security guardrails.
Tenant-wide detectors and the shared detection library are managed in the console's Detection Models. See Custom detections and library.
Related
- Security guardrails - built-in categories and precision detections.
- SDK mode - run the same detections from your own code.