mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 21:48:27 +00:00
fix(exec): require explicit safe-bin profiles
This commit is contained in:
@@ -337,6 +337,15 @@ const ToolExecApplyPatchSchema = z
|
||||
.strict()
|
||||
.optional();
|
||||
|
||||
const ToolExecSafeBinProfileSchema = z
|
||||
.object({
|
||||
minPositional: z.number().int().nonnegative().optional(),
|
||||
maxPositional: z.number().int().nonnegative().optional(),
|
||||
allowedValueFlags: z.array(z.string()).optional(),
|
||||
deniedFlags: z.array(z.string()).optional(),
|
||||
})
|
||||
.strict();
|
||||
|
||||
const ToolExecBaseShape = {
|
||||
host: z.enum(["sandbox", "gateway", "node"]).optional(),
|
||||
security: z.enum(["deny", "allowlist", "full"]).optional(),
|
||||
@@ -344,6 +353,7 @@ const ToolExecBaseShape = {
|
||||
node: z.string().optional(),
|
||||
pathPrepend: z.array(z.string()).optional(),
|
||||
safeBins: z.array(z.string()).optional(),
|
||||
safeBinProfiles: z.record(z.string(), ToolExecSafeBinProfileSchema).optional(),
|
||||
backgroundMs: z.number().int().positive().optional(),
|
||||
timeoutSec: z.number().int().positive().optional(),
|
||||
cleanupMs: z.number().int().positive().optional(),
|
||||
|
||||
Reference in New Issue
Block a user