mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:28:26 +00:00
fix(security): harden untrusted web tool transcripts
This commit is contained in:
@@ -568,6 +568,12 @@ async function runWebSearch(params: {
|
||||
provider: params.provider,
|
||||
model: params.perplexityModel ?? DEFAULT_PERPLEXITY_MODEL,
|
||||
tookMs: Date.now() - start,
|
||||
externalContent: {
|
||||
untrusted: true,
|
||||
source: "web_search",
|
||||
provider: params.provider,
|
||||
wrapped: true,
|
||||
},
|
||||
content: wrapWebContent(content),
|
||||
citations,
|
||||
};
|
||||
@@ -589,6 +595,12 @@ async function runWebSearch(params: {
|
||||
provider: params.provider,
|
||||
model: params.grokModel ?? DEFAULT_GROK_MODEL,
|
||||
tookMs: Date.now() - start,
|
||||
externalContent: {
|
||||
untrusted: true,
|
||||
source: "web_search",
|
||||
provider: params.provider,
|
||||
wrapped: true,
|
||||
},
|
||||
content: wrapWebContent(content),
|
||||
citations,
|
||||
inlineCitations,
|
||||
@@ -652,6 +664,12 @@ async function runWebSearch(params: {
|
||||
provider: params.provider,
|
||||
count: mapped.length,
|
||||
tookMs: Date.now() - start,
|
||||
externalContent: {
|
||||
untrusted: true,
|
||||
source: "web_search",
|
||||
provider: params.provider,
|
||||
wrapped: true,
|
||||
},
|
||||
results: mapped,
|
||||
};
|
||||
writeCache(SEARCH_CACHE, cacheKey, payload, params.cacheTtlMs);
|
||||
|
||||
Reference in New Issue
Block a user