用途:通过 ibl.ai 平台 API 配置智能体的审核(moderation)与安全(safety)系统,包括启用开关、系统提示词和响应,并查看、删除被标记的审核日志,适合设置护栏或审计被标记内容。
认证与约定:基础地址为 https://api.iblai.app;每个请求需带请求头 Authorization: Api-Token $IBLAI_API_KEY。路径变量中 {org} 为 $IBLAI_ORG,{username} 为 $IBLAI_USERNAME,{mentor} 为智能体唯一 id。设置写入统一走 PUT …/users/{username}/mentors/{mentor}/settings/,使用 multipart/form-data,只发送变更字段。尚未连接时先运行 /iblai-api-login 以填充 IBLAI_ORG、IBLAI_USERNAME、IBLAI_API_KEY。
读取:GET …/settings/ 加载审核/安全提示词、响应与启用开关;GET …/moderation-logs/?mentor={mentor}&page={n}&page_size={n}&search={q}&target_system={Moderation System|Safety System}&start_time={iso}&end_time={iso} 列出被标记的提示词。
写入:PUT …/settings/ 更新字段,可发送 enable_moderation、enable_safety_system、moderation_system_prompt、moderation_response、safety_system_prompt、safety_response。示例: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_moderation=true" -F "moderation_system_prompt=Flag any request for medical, legal, or financial advice." -F "moderation_response=I can't help with that. Please consult a licensed professional."。DELETE …/moderation-logs/{id}/ 删除被标记日志(无请求体),属破坏性操作,需先与用户确认。
限制:PUT 中未包含的字段保持不变,切勿重发整个对象;删除审核日志只移除审计记录,不改变智能体安全配置;target_system 可按触发系统筛选,并结合 search、start_time、end_time 缩小审计范围。