Skip to content

feat: 开放群聊互动评估入口并接收反注入防护结果 - #63

Merged
timeance merged 1 commit into
mainfrom
feat/protection-trust
Nov 19, 2026
Merged

timeance merged 1 commit into
mainfrom
feat/protection-trust

Conversation

@timeance

@timeance timeance commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Bond 原有的跨插件接口只能查关系称谓和排行。其他插件没有提交群聊互动供 Bond 评估的入口,也无法通知 Bond 某条消息已经触发反注入防护。

改动

  • 保留原查询接口,新增 submit_assessment_event_v1(event)。只接收当前 OneBot 群消息;身份、受话对象和消息编号由 Bond 核对。与原生评估共用模型、额度和去重记录。调用方不能指定分值,不新增聊天命令或模型工具。
  • 反注入通知使用独立接口。Bond 从已注册的 AntiPromptInjector 领取本轮事实;只有确认且能归责的用户消息才影响信任度。按当前 Bot 的关系空间计入已有流水,同一条消息跨重试、重启或切换空间不重复扣分。不会改动熟悉度和亲近度。
  • 关系流水标注「反注入复核」。更新日志面向使用者;开发者可在 docs/PLUGIN_API.md 查看调用方法、状态和限制。

升级

两个新入口各有开关,默认关闭。保存设置后重载 Bond。通用入口需要启用自动评估,可能产生模型费用;反注入联动不要求自动评估,也不会额外调用模型。联动需同时安装 AntiPromptInjector 4.2.0,并开启两端对应设置;发送端改动见 AntiPromptInjector PR #5。

验证

  • Python 全量测试:1870 项通过,1 项因 Windows 符号链接权限跳过。页面测试 106 项通过;格式、元数据和公开内容检查通过。
  • AstrBot v4.29.4:源码和安装包均通过真实框架装配、原生 API、配置保存、重载与卸载检查。安装包验证确认实际导入归档内的代码。
  • 跨插件离线集成连接真实 Bond 服务和 SQLite:通用入口两次提交同一条消息只调用一次模型;反注入通知两次送达只产生一次信任度变化。已验证不接收调用方自填的确认结果,并检查群白名单、归责、重启、跨作用域去重和每日下降额度。
  • 远端 CI:Linux Python 3.10/3.12、Windows Python 3.12、AstrBot 4.28.0/4.29.4 装配、格式和 CodeQL 检查均通过。发布任务按 PR 流程跳过。

上述消息和模型响应均为合成数据,未连接真实 QQ 或付费模型。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T04:03:10.786728Z 2310ad3 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@timeance
timeance merged commit 7963c47 into main Nov 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant