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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
S
SegmentFault 最新的问题
H
Help Net Security
博客园 - 【当耐特】
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
腾讯CDC
雷峰网
雷峰网
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
D
Docker

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
feat(agents): emit security events for exec approvals · o...
vincentkoc · 2026-06-17 · via Recent Commits to openclaw:main

@@ -7,6 +7,7 @@ import { isRecord } from "@openclaw/normalization-core/record-coerce";

77

import { normalizeStringEntries } from "@openclaw/normalization-core/string-normalization";

88

import { describeInterpreterInlineEval } from "../infra/command-analysis/inline-eval.js";

99

import { detectPolicyInlineEval } from "../infra/command-analysis/policy.js";

10+

import { emitTrustedSecurityEvent } from "../infra/diagnostic-events.js";

1011

import {

1112

addDurableCommandApproval,

1213

commandRequiresSecurityAuditSuppressionApproval,

@@ -250,6 +251,59 @@ function formatDiagnosticsExportSuccess(aggregated: string): string {

250251

}

251252

}

252253254+

function emitGatewayExecApprovalSecurityEvent(params: {

255+

action: "exec.approval.requested" | "exec.approval.approved" | "exec.approval.denied";

256+

outcome: "success" | "denied" | "error";

257+

severity: "low" | "medium" | "high";

258+

agentId?: string | null;

259+

reason?: string;

260+

hostSecurity: ExecSecurity;

261+

hostAsk: ExecAsk;

262+

host: "gateway";

263+

segmentCount: number;

264+

trigger?: string;

265+

decision?: string | null;

266+

}) {

267+

emitTrustedSecurityEvent({

268+

category: "approval",

269+

action: params.action,

270+

outcome: params.outcome,

271+

severity: params.severity,

272+

actor: {

273+

kind: "agent",

274+

},

275+

target: {

276+

kind: "tool",

277+

name: "system.exec",

278+

owner: params.host,

279+

},

280+

policy: {

281+

id: "exec.approval",

282+

decision:

283+

params.action === "exec.approval.requested"

284+

? "ask"

285+

: params.outcome === "success"

286+

? "allow"

287+

: "deny",

288+

...(params.reason ? { reason: params.reason } : {}),

289+

},

290+

control: {

291+

id: "exec.approval",

292+

family: "approval",

293+

},

294+

...(params.reason ? { reason: params.reason } : {}),

295+

attributes: {

296+

host: params.host,

297+

security: params.hostSecurity,

298+

ask: params.hostAsk,

299+

segment_count: params.segmentCount,

300+

has_agent_id: Boolean(params.agentId?.trim()),

301+

...(params.trigger ? { trigger: params.trigger } : {}),

302+

...(params.decision ? { decision: params.decision } : {}),

303+

},

304+

});

305+

}

306+253307

function formatDiagnosticsExportFailure(params: {

254308

outcome: { status: string; reason?: string; aggregated: string };

255309

exitLabel: string;

@@ -559,6 +613,17 @@ export async function processGatewayAllowlist(

559613

...requestArgs,

560614

register: registerGatewayApproval,

561615

});

616+

emitGatewayExecApprovalSecurityEvent({

617+

action: "exec.approval.requested",

618+

outcome: "success",

619+

severity: "low",

620+

agentId: params.agentId,

621+

hostSecurity,

622+

hostAsk,

623+

host: "gateway",

624+

segmentCount: allowlistEval.segments.length,

625+

trigger: params.trigger,

626+

});

562627

if (

563628

shouldResolveExecApprovalUnavailableInline({

564629

trigger: params.trigger,

@@ -612,6 +677,18 @@ export async function processGatewayAllowlist(

612677

onFailure,

613678

});

614679

if (decision === undefined) {

680+

emitGatewayExecApprovalSecurityEvent({

681+

action: "exec.approval.denied",

682+

outcome: "error",

683+

severity: "high",

684+

agentId: params.agentId,

685+

reason: "approval-request-failed",

686+

hostSecurity,

687+

hostAsk,

688+

host: "gateway",

689+

segmentCount: allowlistEval.segments.length,

690+

trigger: params.trigger,

691+

});

615692

return { deniedReason: "approval-request-failed", requestFailed: true };

616693

}

617694

@@ -678,6 +755,19 @@ export async function processGatewayAllowlist(

678755

deniedReason = deniedReason ?? "allowlist-miss";

679756

}

680757758+

emitGatewayExecApprovalSecurityEvent({

759+

action: deniedReason ? "exec.approval.denied" : "exec.approval.approved",

760+

outcome: deniedReason ? "denied" : "success",

761+

severity: "medium",

762+

agentId: params.agentId,

763+

reason: deniedReason ?? undefined,

764+

hostSecurity,

765+

hostAsk,

766+

host: "gateway",

767+

segmentCount: allowlistEval.segments.length,

768+

trigger: params.trigger,

769+

decision,

770+

});

681771

return { deniedReason, requestFailed: false };

682772

};

683773