M1-04 Content Safety 深化 #18
Closed
opened 2026-05-22 21:03:39 +08:00 by wangdl
·
2 comments
Labels
Clear labels
area:activity
活动/统计
area:admin
管理后台
area:admin-api
area:ai
AI/RAG
area:ai-runtime
AI Runtime / AI 分析体系相关
area:analytics
area:api
API 接口
area:auth
认证与授权
area:cos
对象存储
area:database
数据库/Migration
area:import
文件导入/解析
area:knowledge
知识库/知识点
area:learning-info
area:learning-session
area:quiz
测验/自测
area:reading-event
area:reading-progress
area:review
复习系统
area:security
安全相关
audit:api-admin-info
audit:api-info
audit:planned
已完成宏观规划,尚未代码审查
audit:reviewed
blocked-by:api-info-aggregation
blocked-by:api-info-core
blocked-by:api-info-ops
blocked-by:api-info-schema
blocked-by:processor
blocked-by:schema
priority:p0
最高优先级,阻塞发布
priority:p1
高优先级,里程碑必需
priority:p2
中优先级,后续版本
repo:api
API 仓库 Issue
status:blocked
被阻塞
status:done
已完成
status:partial
status:todo
type:aggregation
type:bug
缺陷修复
type:design
设计
type:docs
文档
type:feature
新功能
type:migration
type:refactor
重构
type:test
work:admin-api
work:aggregation
work:api
work:artifact
题目/卡片产物
work:audit
work:circuit-breaker
熔断
work:contract
work:design
架构/协议设计工作
work:docs
work:export
work:extend-existing
work:internal-api
Runtime 内部接口
work:job
Job 调度相关
work:new-module
work:new-table
work:ops
work:query
work:quota
额度/限流
work:schema
Prisma Schema 设计
work:security
work:service
Service 层实现
work:snapshot
Snapshot 构建
work:test
No Label
Milestone
No items
No Milestone
M1:AI / RAG 运行时与检索底座(P0~P1)
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: wangdl/api-server#18
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
在 M0-06 Content Safety 基础版之上深化内容安全能力,接入 AI 输入/输出审核、举报处理流程和完善违规处罚记录。
本 Issue 只做深化设计,基础能力(敏感词库、文本审核、人工复核队列)已在 M0-06 完成。
背景说明
M0-06 建立了敏感词库和人工复核队列。本阶段需要把 Content Safety 正式接入 AI 链路:RAG Chat 的用户问题在发给 LLM 之前检测、LLM 回答在返回用户之前检测。同时完善用户举报的处理流程和违规记录。
模块深化内容
AI 输入审核接入:
AI 输出审核接入:
举报处理流程:
违规记录与处罚:
基础设施依赖变更
相比 M0-06,无新增依赖。
接口设计(新增部分)
CAPI 新增:
AAPI 新增/深化:
Domain Event(新增)
交付检查
验收标准
禁止事项
不建议当前阶段实现
✅ M1-04 实施完成
交付内容
prisma/schema.prisma+ migrationcontent-safety.controller.tsPOST /api/reports用户举报content-safety.controller.tscontent-safety.controller.tsai-gateway.service.tsContentSafety.tsxE2E 测试 (test/m1.e2e-spec.ts M1-04)
POST /api/reportsGET /admin-api/content-safety/reportsGET /admin-api/content-safety/violationsPOST /admin-api/content-safety/violations/:id/penaltyPOST /admin-api/content-safety/reports/:id/handle运行
🔍 审计备注 — 2026-05-24
检查项: M1-04 要求"RAG Chat 用户消息在发给 LLM 之前经过 ContentSafetyService.check()",当前 RAG 模块尚未接入此检查。
结论: 合理延后。RAG Chat 的完整实现属于 M2-07 的范畴,AI 输入审核的接入点放在那里更自然。AI 输出审核已在 ai-gateway.service.ts 中完成。
wangdl referenced this issue2026-06-05 19:34:44 +08:00
wangdl referenced this issue2026-06-05 19:36:08 +08:00