function pickSystemRunParams(raw: Record<string, unknown>): Record<string, unknown> { // Defensive allowlist: only forward fields that the node-host `system.run` handler understands. // This prevents future internal control fields from being smuggled through the gateway. const next: Record<string, unknown> = {}; for (const key of [ "command", "rawCommand", "systemRunPlan", "cwd", "env", "timeoutMs", "needsScreenRecording", "agentId", "sessionKey", "runId", "suppressNotifyOnExit",
]) { if (key in raw) {
next[key] = raw[key];
}
} return next;
}
// Always strip control fields from user input. If the override is allowed, // we re-add trusted fields based on the gateway approval record. const next: Record<string, unknown> = pickSystemRunParams(obj);
// Normal path: enforce the decision recorded by the gateway. if (snapshot.decision === "allow-once") { if (typeof manager.consumeAllowOnce !== "function" || !manager.consumeAllowOnce(runId)) { return systemRunApprovalRequired(runId);
}
next.approved = true;
next.approvalDecision = "allow-once"; return { ok: true, params: next };
}
if (snapshot.decision === "allow-always") {
next.approved = true;
next.approvalDecision = "allow-always"; return { ok: true, params: next };
}
// If the approval request timed out (decision=null), allow askFallback-driven // "allow-once" ONLY for clients that are allowed to use exec approvals. const timedOut =
snapshot.resolvedAtMs !== undefined &&
snapshot.decision === undefined &&
snapshot.resolvedBy === null; if (
timedOut &&
approved &&
requestedDecision === "allow-once" &&
clientHasApprovals(opts.client)
) {
next.approved = true;
next.approvalDecision = "allow-once"; return { ok: true, params: next };
}
return systemRunApprovalRequired(runId);
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.