Feature Overview
Content compliance check is a content security moderation capability for LLM applications. It detects the inputs and outputs of LLM interactions to identify non-compliant content, helping to meet content security compliance requirements.
In user-facing service scenarios, LLMs may generate compliance-risk content due to malicious user input or flaws in the model's own generation mechanism. Content compliance check applies to both the input and output sides. Based on customer-configured security policies, it identifies and handles each piece of non-compliant content that actually appears in interactions, with tiered responses.
Detection Type
Content compliance check covers common risk types such as illegal content, violations, and vulgarity. The complete list of rules is subject to what is displayed in the console.
Configuration Steps
Traffic Access
Prerequisites
The LLM business has been connected to the LLM security feature through the Traffic Onboarding method. Operation Step
1. Log in to the WAF console, and in the left sidebar, choose LLM Security > Security Configurations. 2. Select the target business instance and domain, and click Custom Protection Rules.
3. On the custom protection rules page, click Add Rule.
4. In the Add Custom Protection Rule window, configure the parameters.
5. For Detection Content, select Sensitive Information. For detailed parameter descriptions, see Parameter Description. 6. After completing all parameter settings, enable the rule, and then click OK to submit the configuration. The rule takes effect immediately.
SDK/API Integration
Prerequisites
The LLM business has been connected to the LLM security feature through the SDK/API Integration method. Operation Step
1. Log in to the WAF console, and in the left sidebar, choose LLM Security > SDK Integration. 2. In the operation column of the target application, click Security Configurations.
3. In the Protection Configuration area, enable the Content Compliance Check feature.
4. Click Content Compliance Check to switch to the Content Compliance Check tab.
5. In the rule list, find the rule you want to enable, and click the On/Off on the right to turn it on.
6. In the Action column dropdown list, select the post-hit handling method:
Observe: Logs the hit event without blocking the request. You can select this action during the initial phase after policy rollout to evaluate the false positive rate.
Block: Blocks the request and returns a block prompt. For input content, requests sent from users to the origin server are blocked. For output content, model output is stopped and a prompt message is returned.
Note:
When it is enabled for the first time or the detection level is adjusted, we recommend that you set the handling action to Observe mode, run it for a period of time to evaluate false positives and false negatives, and then adjust it to Block. If you enable Block directly, normal requests that are misidentified as non-compliant content will be blocked immediately, which may cause service refusal, conversation interruption, and degraded user experience.
7. In the Detection Mode column dropdown list, select the detection direction:
Detect inbound only: Detects only input prompts.
Detect outbound only: Detects only model output.
Detect inbound and outbound: Detects both input and output.
8. To perform batch operations on multiple rules, select the checkboxes before the rules, click Batch Configuration above the list, and then adjust the Action, Detection Mode, and On/Off settings in a unified manner.
Must-Knows
We recommend that you first verify in Observe mode, and enable Block after confirming its applicability.
The rules for content compliance check are continuously maintained and updated by the Tencent security team, and the detection library is automatically synchronized.
When integration is performed via SDK/API, detection results can be queried through Log Audit for easy auditing and traceability. References