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
committed by Windpicker-owo
parent b55cd8193e
commit 16da725272
22 changed files with 2494 additions and 30 deletions

View File

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