惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
云风的 BLOG
云风的 BLOG
WordPress大学
WordPress大学
Vercel News
Vercel News
Apple Machine Learning Research
Apple Machine Learning Research
T
Tailwind CSS Blog
I
InfoQ
小众软件
小众软件
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
美团技术团队
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
MongoDB | Blog
MongoDB | Blog
V
V2EX
J
Java Code Geeks
有赞技术团队
有赞技术团队
博客园 - 聂微东
B
Blog RSS Feed
博客园 - 司徒正美

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(security): resolve model aliases before audit classif...
blaspat · 2026-04-30 · via Recent Commits to openclaw:main

@@ -3,15 +3,12 @@ import { resolveSandboxToolPolicyForAgent } from "../agents/sandbox/tool-policy.

33

import type { SandboxToolPolicy } from "../agents/sandbox/types.js";

44

import { isToolAllowedByPolicies } from "../agents/tool-policy-match.js";

55

import { resolveToolProfilePolicy } from "../agents/tool-policy.js";

6-

import {

7-

resolveAgentModelFallbackValues,

8-

resolveAgentModelPrimaryValue,

9-

} from "../config/model-input.js";

106

import type { OpenClawConfig } from "../config/types.openclaw.js";

117

import type { AgentToolsConfig } from "../config/types.tools.js";

128

import { hasConfiguredInternalHooks } from "../hooks/configured.js";

139

import { hasConfiguredWebSearchCredential } from "../plugins/web-search-credential-presence.js";

1410

import { inferParamBFromIdOrName } from "../shared/model-param-b.js";

11+

import { collectAuditModelRefs } from "./audit-model-refs.js";

1512

import { pickSandboxToolPolicy } from "./audit-tool-policy.js";

16131714

export type SecurityAuditFinding = {

@@ -24,8 +21,6 @@ export type SecurityAuditFinding = {

24212522

const SMALL_MODEL_PARAM_B_MAX = 300;

262327-

type ModelRef = { id: string; source: string };

28-2924

function summarizeGroupPolicy(cfg: OpenClawConfig): {

3025

open: number;

3126

allowlist: number;

@@ -55,59 +50,6 @@ function summarizeGroupPolicy(cfg: OpenClawConfig): {

5550

return { open, allowlist, other };

5651

}

575258-

function addModel(models: ModelRef[], raw: unknown, source: string) {

59-

if (typeof raw !== "string") {

60-

return;

61-

}

62-

const id = raw.trim();

63-

if (!id) {

64-

return;

65-

}

66-

models.push({ id, source });

67-

}

68-69-

function collectModels(cfg: OpenClawConfig): ModelRef[] {

70-

const out: ModelRef[] = [];

71-

addModel(

72-

out,

73-

resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model),

74-

"agents.defaults.model.primary",

75-

);

76-

for (const fallback of resolveAgentModelFallbackValues(cfg.agents?.defaults?.model)) {

77-

addModel(out, fallback, "agents.defaults.model.fallbacks");

78-

}

79-

addModel(

80-

out,

81-

resolveAgentModelPrimaryValue(cfg.agents?.defaults?.imageModel),

82-

"agents.defaults.imageModel.primary",

83-

);

84-

for (const fallback of resolveAgentModelFallbackValues(cfg.agents?.defaults?.imageModel)) {

85-

addModel(out, fallback, "agents.defaults.imageModel.fallbacks");

86-

}

87-88-

const list = Array.isArray(cfg.agents?.list) ? cfg.agents?.list : [];

89-

for (const agent of list ?? []) {

90-

if (!agent || typeof agent !== "object") {

91-

continue;

92-

}

93-

const id =

94-

typeof (agent as { id?: unknown }).id === "string" ? (agent as { id: string }).id : "";

95-

const model = (agent as { model?: unknown }).model;

96-

if (typeof model === "string") {

97-

addModel(out, model, `agents.list.${id}.model`);

98-

} else if (model && typeof model === "object") {

99-

addModel(out, (model as { primary?: unknown }).primary, `agents.list.${id}.model.primary`);

100-

const fallbacks = (model as { fallbacks?: unknown }).fallbacks;

101-

if (Array.isArray(fallbacks)) {

102-

for (const fallback of fallbacks) {

103-

addModel(out, fallback, `agents.list.${id}.model.fallbacks`);

104-

}

105-

}

106-

}

107-

}

108-

return out;

109-

}

110-11153

function extractAgentIdFromSource(source: string): string | null {

11254

const match = source.match(/^agents\.list\.([^.]*)\./);

11355

return match?.[1] ?? null;

@@ -210,7 +152,9 @@ export function collectSmallModelRiskFindings(params: {

210152

env: NodeJS.ProcessEnv;

211153

}): SecurityAuditFinding[] {

212154

const findings: SecurityAuditFinding[] = [];

213-

const models = collectModels(params.cfg).filter((entry) => !entry.source.includes("imageModel"));

155+

const models = collectAuditModelRefs(params.cfg).filter(

156+

(entry) => !entry.source.includes("imageModel"),

157+

);

214158

if (models.length === 0) {

215159

return findings;

216160

}