用途:通过 ibl.ai 平台 API 配置智能体的 Privacy Router,控制智能体如何处理个人数据。
主要能力:启用 PII 检测;选择 redact(改写)、mask(掩码)或 block(拦截)动作;指定要监控的实体类型(如 PERSON、EMAIL_ADDRESS、US_SSN 等);设置检测到 PII 时返回的响应文本;切换输出过滤,将相同检测同时应用于智能体输出。
鉴权与约定:Base URL 为 https://api.iblai.app;每个请求需带请求头 Authorization: Api-Token $IBLAI_API_KEY。路径变量:{org} 对应 $IBLAI_ORG,{username} 对应 $IBLAI_USERNAME,{mentor} 为智能体唯一 id。设置写入统一走一个端点,使用 multipart/form-data,仅发送变更字段。若尚未连接,先运行 /iblai-login 以填充 IBLAI_ORG、IBLAI_USERNAME 与 IBLAI_API_KEY。
读取:GET …/mentors/{mentor}/settings/ 加载当前隐私字段;GET …/mentors/{mentor}/public-settings/ 查看匿名(未认证)请求的隐私路由器状态。
写入:PUT …/mentors/{mentor}/settings/,字段包括 enable_privacy_router、privacy_action、privacy_entities、privacy_response、enable_privacy_output_filter。示例:
curl -X PUT "https://api.iblai.app/dm/api/ai-mentor/orgs/$IBLAI_ORG/users/$IBLAI_USERNAME/mentors/$MENTOR/settings/" -H "Authorization: Api-Token $IBLAI_API_KEY" -F "enable_privacy_router=true" -F "privacy_action=redact" -F "privacy_entities=PERSON" -F "privacy_entities=EMAIL_ADDRESS" -F "privacy_entities=US_SSN" -F "privacy_response=I can't process personal information. Please remove it and try again." -F "enable_privacy_output_filter=true"
限制与注意:PUT 中未包含的字段保持不变,切勿重发整个对象;privacy_action 只能取 redact、mask 或 block,block 会中止本轮并返回 privacy_response,而 redact/mask 会改写检测到的 PII;privacy_entities 为检测器名称列表,multipart/form-data 中每个实体需重复一次 -F 键;enable_privacy_output_filter 将同一检测应用于智能体输出,而非仅用户输入。可用 public-settings/ 读取确认已应用于匿名请求的状态。