From 100afc857b8b5f321cba489fd9b6cbb20a29a9e4 Mon Sep 17 00:00:00 2001 From: Scrattlebeard Date: Mon, 2 Feb 2026 13:37:12 -0800 Subject: [PATCH] Move stage definitions inline to support UI rendering --- .../gpt-oss-safeguard/openclaw.plugin.json | 130 +++++++++--- .../openclaw.plugin.json | 193 ++++++++++++++---- 2 files changed, 260 insertions(+), 63 deletions(-) diff --git a/extensions/gpt-oss-safeguard/openclaw.plugin.json b/extensions/gpt-oss-safeguard/openclaw.plugin.json index a8bafd6231f5..33f6d9996fa1 100644 --- a/extensions/gpt-oss-safeguard/openclaw.plugin.json +++ b/extensions/gpt-oss-safeguard/openclaw.plugin.json @@ -40,6 +40,38 @@ "maxTokens": { "label": "Max Tokens", "advanced": true + }, + "stages.beforeRequest.enabled": { + "label": "Enabled", + "help": "Enable guardrail check before user requests" + }, + "stages.beforeRequest.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.beforeToolCall.enabled": { + "label": "Enabled", + "help": "Enable guardrail check before tool calls" + }, + "stages.beforeToolCall.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.afterToolCall.enabled": { + "label": "Enabled", + "help": "Enable guardrail check after tool calls" + }, + "stages.afterToolCall.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.afterResponse.enabled": { + "label": "Enabled", + "help": "Enable guardrail check after model responses" + }, + "stages.afterResponse.mode": { + "label": "Mode", + "help": "Block violations or monitor only" } }, "configSchema": { @@ -86,38 +118,84 @@ "additionalProperties": false, "properties": { "beforeRequest": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "includeHistory": { + "type": "boolean" + } + } }, "beforeToolCall": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "includeHistory": { + "type": "boolean" + } + } }, "afterToolCall": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "includeHistory": { + "type": "boolean" + } + } }, "afterResponse": { - "$ref": "#/$defs/stageConfig" - } - } - } - }, - "$defs": { - "stageConfig": { - "type": "object", - "additionalProperties": false, - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string", - "enum": ["block", "monitor"] - }, - "blockMode": { - "type": "string", - "enum": ["replace", "append"] - }, - "includeHistory": { - "type": "boolean" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "includeHistory": { + "type": "boolean" + } + } } } } diff --git a/extensions/grayswan-cygnal-guardrail/openclaw.plugin.json b/extensions/grayswan-cygnal-guardrail/openclaw.plugin.json index 666f320805a3..eec0b444a8a6 100644 --- a/extensions/grayswan-cygnal-guardrail/openclaw.plugin.json +++ b/extensions/grayswan-cygnal-guardrail/openclaw.plugin.json @@ -30,6 +30,46 @@ "failOpen": { "label": "Fail Open", "help": "Allow requests on API errors" + }, + "stages.beforeRequest.enabled": { + "label": "Enabled", + "help": "Enable guardrail check before user requests" + }, + "stages.beforeRequest.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.beforeToolCall.enabled": { + "label": "Enabled", + "help": "Enable guardrail check before tool calls" + }, + "stages.beforeToolCall.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.afterToolCall.enabled": { + "label": "Enabled", + "help": "Enable guardrail check after tool calls" + }, + "stages.afterToolCall.mode": { + "label": "Mode", + "help": "Block violations or monitor only" + }, + "stages.afterToolCall.blockOnMutation": { + "label": "Block on Mutation", + "help": "Block when mutation/jailbreak attempt detected" + }, + "stages.afterToolCall.blockOnIpi": { + "label": "Block on IPI", + "help": "Block when indirect prompt injection detected" + }, + "stages.afterResponse.enabled": { + "label": "Enabled", + "help": "Enable guardrail check after model responses" + }, + "stages.afterResponse.mode": { + "label": "Mode", + "help": "Block violations or monitor only" } }, "configSchema": { @@ -72,49 +112,128 @@ "additionalProperties": false, "properties": { "beforeRequest": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "violationThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "blockOnMutation": { + "type": "boolean" + }, + "blockOnIpi": { + "type": "boolean" + }, + "includeHistory": { + "type": "boolean" + } + } }, "beforeToolCall": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "violationThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "blockOnMutation": { + "type": "boolean" + }, + "blockOnIpi": { + "type": "boolean" + }, + "includeHistory": { + "type": "boolean" + } + } }, "afterToolCall": { - "$ref": "#/$defs/stageConfig" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "violationThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "blockOnMutation": { + "type": "boolean" + }, + "blockOnIpi": { + "type": "boolean" + }, + "includeHistory": { + "type": "boolean" + } + } }, "afterResponse": { - "$ref": "#/$defs/stageConfig" - } - } - } - }, - "$defs": { - "stageConfig": { - "type": "object", - "additionalProperties": false, - "properties": { - "enabled": { - "type": "boolean" - }, - "mode": { - "type": "string", - "enum": ["block", "monitor"] - }, - "violationThreshold": { - "type": "number", - "minimum": 0, - "maximum": 1 - }, - "blockMode": { - "type": "string", - "enum": ["replace", "append"] - }, - "blockOnMutation": { - "type": "boolean" - }, - "blockOnIpi": { - "type": "boolean" - }, - "includeHistory": { - "type": "boolean" + "type": "object", + "additionalProperties": false, + "properties": { + "enabled": { + "type": "boolean" + }, + "mode": { + "type": "string", + "enum": ["block", "monitor"] + }, + "violationThreshold": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "blockMode": { + "type": "string", + "enum": ["replace", "append"] + }, + "blockOnMutation": { + "type": "boolean" + }, + "blockOnIpi": { + "type": "boolean" + }, + "includeHistory": { + "type": "boolean" + } + } } } }