tencent cloud

Web Application Firewall

Prompt Content Attack Protection

ダウンロード
フォーカスモード
フォントサイズ
最終更新日: 2026-11-19 16:21:13
AI翻訳

Feature Overview

A prompt injection attack is an attack in which the attacker uses carefully crafted input text to induce an LLM to break through preset security boundaries, perform unauthorized operations, leak system prompts, or generate non-compliant content. Its typical characteristic is that the input appears compliant and harmless on the surface, but through inductive techniques such as jailbreak instructions, role-playing, fictional scenario assumptions, identity forgery, instruction overriding, and encoding/multilingual conversion, the model is manipulated into deviating from its established security settings.
Prompt injection attack protection is one of the core capabilities of LLM security. It uses a built-in small-model security detection engine to review requests to LLM applications in real time, accurately identifying and blocking various prompt injection attacks and jailbreak behaviors.

Detection Capability

Injection pattern recognition: matches known injection features and malicious instruction patterns based on a massive attack sample library to quickly block common attacks.
Jailbreak detection: deeply identifies jailbreak behaviors such as role-playing, rule overriding, and logic traps that attempt to bypass the model's native security restrictions.
Encoding bypass detection: intelligently parses various encoding obfuscation methods such as Base64, Hex, and Unicode to restore the real input and uncover hidden attack intentions.
Context analysis: performs semantic correlation analysis in conjunction with multi-turn conversation context to dynamically assess input risks and effectively defend against fragmented and progressive attacks.

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 Prompt Injection. 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.
The DescribeLLMContentSecCheck API has been called to report the input prompt to the LLM security feature.

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 Prompt Content Attack Protection feature.
4. Click Prompt Content Attack Protection to switch to the Prompt Content Attack Protection 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, 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.
7. To perform batch operations on multiple rules, select the checkboxes before the rules, click Batch Configuration above the list, and then adjust the Action and On/Off settings in a unified manner.

Must-Knows

Prompt Content Attack Protection only detects requests on the input side. For security review of model output content, use Content Compliance Check.
If your business involves legitimate role-playing scenarios (such as game dialogue or script writing), we recommend that you first set the relevant rules to Observe mode to evaluate false positives.
When the system is integrated via SDK/API, prompt injection protection results can be queried through Log Audit for easy auditing and traceability.

References



ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック