-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: add debug logging for final messages #4682
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
ocetars
wants to merge
1
commit into
AstrBotDevs:master
Choose a base branch
from
ocetars:feature/message-debug
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚨 issue (security): 将完整的 LLM 消息写入日志可能会泄露敏感用户数据和凭据。
即使是在 DEBUG 级别,记录完整的提示词和工具消息也可能暴露用户数据、密钥或标识符,尤其是在集中式日志系统中。请对敏感字段进行脱敏处理,只记录元数据(例如角色、长度、工具名),或者将这类日志放在一个明确标记为不安全的开关(例如
unsafe_debug/log_prompts)后面,并确保在非本地环境中默认关闭。Original comment in English
🚨 issue (security): Dumping full LLM messages to logs can leak sensitive user data and credentials.
Even at DEBUG level, logging full prompts and tool messages can expose user data, secrets, or identifiers, especially in centralized logging systems. Please either redact sensitive fields, restrict logs to metadata (e.g., role, length, tool name), or guard this behind an explicit, clearly unsafe flag (e.g.,
unsafe_debug/log_prompts) that is disabled in non-local environments.