/ AIG-PromptSecurity / cli / mappings.py
mappings.py
 1  # Copyright (c) 2024-2026 Tencent Zhuque Lab. All rights reserved.
 2  #
 3  # Licensed under the Apache License, Version 2.0 (the "License");
 4  # you may not use this file except in compliance with the License.
 5  # You may obtain a copy of the License at
 6  #
 7  #     http://www.apache.org/licenses/LICENSE-2.0
 8  #
 9  # Unless required by applicable law or agreed to in writing, software
10  # distributed under the License is distributed on an "AS IS" BASIS,
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  # See the License for the specific language governing permissions and
13  # limitations under the License.
14  #
15  # Requirement: Any integration or derivative work must explicitly attribute
16  # Tencent Zhuque Lab (https://github.com/Tencent/AI-Infra-Guard) in its
17  # documentation or user interface, as detailed in the NOTICE file.
18  
19  # 支持的scenarios和techniques映射
20  TECHNIQUE_CLASS_MAP = {
21      "A1Z26": "deepteam.attacks.single_turn.A1Z26",
22      "AcrosticPoem": "deepteam.attacks.single_turn.AcrosticPoem",
23      "AffineCipher": "deepteam.attacks.single_turn.AffineCipher",
24      "AsciiSmuggling": "deepteam.attacks.single_turn.AsciiSmuggling",
25      "Aurebesh": "deepteam.attacks.single_turn.Aurebesh",
26      "CaesarCipher": "deepteam.attacks.single_turn.CaesarCipher",
27      "DRAttack": "deepteam.attacks.single_turn.DRAttack",
28      "Leetspeak": "deepteam.attacks.single_turn.Leetspeak",
29      "MirrorText": "deepteam.attacks.single_turn.MirrorText",
30      "Ogham": "deepteam.attacks.single_turn.Ogham",
31      "Raw": "deepteam.attacks.single_turn.Raw",
32      "Stego": "deepteam.attacks.single_turn.Stego",
33      "Vaporwave": "deepteam.attacks.single_turn.Vaporwave",
34      "Zalgo": "deepteam.attacks.single_turn.Zalgo",
35  }
36  
37  SCENARIO_CLASS_MAP = {
38      "Bias": "deepteam.vulnerabilities.Bias",
39      "Toxicity": "deepteam.vulnerabilities.Toxicity",
40      "Misinformation": "deepteam.vulnerabilities.Misinformation",
41      "IllegalActivity": "deepteam.vulnerabilities.IllegalActivity",
42      "PromptLeakage": "deepteam.vulnerabilities.PromptLeakage",
43      "PIILeakage": "deepteam.vulnerabilities.PIILeakage",
44      "UnauthorizedAccess": "deepteam.vulnerabilities.UnauthorizedAccess",
45      "ExcessiveAgency": "deepteam.vulnerabilities.ExcessiveAgency",
46      "Robustness": "deepteam.vulnerabilities.Robustness",
47      "IntellectualProperty": "deepteam.vulnerabilities.IntellectualProperty",
48      "Competition": "deepteam.vulnerabilities.Competition",
49      "GraphicContent": "deepteam.vulnerabilities.GraphicContent",
50      "PersonalSafety": "deepteam.vulnerabilities.PersonalSafety",
51      "Custom": "deepteam.vulnerabilities.CustomVulnerability",
52      "CustomPrompt": "deepteam.vulnerabilities.CustomPrompt",
53      "MultiDataset": "deepteam.vulnerabilities.MultiDatasetVulnerability",
54  }
55  
56  # 支持的自定义metric映射
57  METRIC_CLASS_MAP = {
58      'RandomMetric': 'deepteam.metrics.RandomMetric',
59      'JailbreakMetric': 'deepteam.metrics.JailbreakMetric'
60  }