PII 策略配置
本指南提供了 PII(个人身份信息)检测和策略执行的快速配置方案。根据您的合规要求使用这些模式来保护敏感数据。
按 Decision 启用 PII 检测
将 PII plugin 添加到特定 decision rule:
decisions:
- name: "health_decision"
rules:
operator: "AND"
conditions:
- type: "domain"
name: "health"
modelRefs:
- model: "qwen3"
plugins:
- type: "pii"
configuration:
enabled: true
pii_types_allowed: [] # 阻止所有 PII
允许特定 PII 类型
允许某些 PII 类型同时阻止其他类型:
plugins:
- type: "pii"
configuration:
enabled: true
pii_types_allowed:
- "LOCATION" # 允许位置提及
- "DATE_TIME" # 允许日期和时间
- "ORGANIZATION" # 允许公司名称
# 所有其他类型(PERSON、EMAIL、PHONE 等)将被阻止
支持的 PII 类型
| PII 类型 | 描述 | 示例 |
|---|---|---|
PERSON | 人名 | "张三" |
EMAIL | 电子邮件地址 | "user@example.com" |
PHONE | 电话号码 | "+86-138-0000-0000" |
LOCATION | 地理位置 | "北京" |
DATE_TIME | 日期和时间 | "2024年1月15日" |
ORGANIZATION | 公司/组织名称 | "某某公司" |
CREDIT_CARD | 信用卡号 | "4111-1111-1111-1111" |
SSN | 社会保障号码 | "123-45-6789" |
IP_ADDRESS | IP 地址 | "192.168.1.1" |