mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:54:31 +00:00
fix(security): separate untrusted channel metadata from system prompt (thanks @KonstantinMirin)
This commit is contained in:
@@ -31,6 +31,12 @@ export function finalizeInboundContext<T extends Record<string, unknown>>(
|
||||
normalized.CommandBody = normalizeTextField(normalized.CommandBody);
|
||||
normalized.Transcript = normalizeTextField(normalized.Transcript);
|
||||
normalized.ThreadStarterBody = normalizeTextField(normalized.ThreadStarterBody);
|
||||
if (Array.isArray(normalized.UntrustedContext)) {
|
||||
const normalizedUntrusted = normalized.UntrustedContext.map((entry) =>
|
||||
normalizeInboundTextNewlines(entry),
|
||||
).filter((entry) => Boolean(entry));
|
||||
normalized.UntrustedContext = normalizedUntrusted;
|
||||
}
|
||||
|
||||
const chatType = normalizeChatType(normalized.ChatType);
|
||||
if (chatType && (opts.forceChatType || normalized.ChatType !== chatType)) {
|
||||
|
||||
Reference in New Issue
Block a user