Skip to content

GH-4089 Fixed the issue where sensitive words in chat memory repeatedly triggered SafeGuardAdvisor interception #4112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunyuhan1998
Copy link
Contributor

@sunyuhan1998 sunyuhan1998 commented Aug 11, 2025

As described in the issue, the current default order of SafeGuardAdvisor is lower than that of MessageChatMemoryAdvisor, which causes a problem: when users employ both advisors simultaneously without manually adjusting their order, if any historical message contains sensitive content, all subsequent messages will be blocked by SafeGuardAdvisor. This behavior is clearly undesirable.

This PR addresses the issue with the following changes:

  1. Adjusts the default priority of SafeGuardAdvisor to be higher than that of MessageChatMemoryAdvisor, ensuring that content filtering occurs before chat memory is stored.
  2. Enhances the documentation for SafeGuardAdvisor to alert users about this potential issue and recommend appropriate priority configuration based on their specific use cases.

Fixes: #4089

…rdAdvisor` to ensure it is always higher than that of `MessageChatMemoryAdvisor`, preventing sensitive terms in chat memory from repeatedly triggering `SafeGuardAdvisor`'s interception mechanism.

Signed-off-by: Sun Yuhan <[email protected]>
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.

The default order of SafeGuardAdvisor should be higher than MessageChatMemoryAdvisor
1 participant