Add LLM anti-prompt injection system

Introduces a comprehensive anti-prompt injection system for LLMs, including rule-based and LLM-based detection, user ban/whitelist management, message shielding, and statistics tracking. Adds new modules under src/chat/antipromptinjector, integrates anti-injection checks into the message receive flow, updates configuration and database models, and provides test scripts. Also updates templates and logger aliases to support the new system.
This commit is contained in:
雅诺狐
2025-08-18 17:27:59 +08:00
parent aaaf8f5ef7
commit 689aface9d
22 changed files with 2498 additions and 26 deletions

View File

@@ -505,6 +505,9 @@ MODULE_ALIASES = {
"tool_executor": "工具",
"hfc": "聊天节奏",
"chat": "所见",
"anti_injector": "反注入",
"anti_injector.detector": "反注入检测",
"anti_injector.shield": "反注入加盾",
"plugin_manager": "插件",
"relationship_builder": "关系",
"llm_models": "模型",