From 19b1502a9a7bd44dbb40cdae9648107c04317e34 Mon Sep 17 00:00:00 2001 From: Ismail Pelaseyed Date: Tue, 2 Dec 2025 21:39:27 +0100 Subject: [PATCH] feat: add system prompt option to Superagent guard step --- plugins/superagent/index.ts | 8 ++++++++ plugins/superagent/steps/guard.ts | 2 ++ 2 files changed, 10 insertions(+) diff --git a/plugins/superagent/index.ts b/plugins/superagent/index.ts index f3a98b4f..4d03b47e 100644 --- a/plugins/superagent/index.ts +++ b/plugins/superagent/index.ts @@ -57,6 +57,14 @@ const superagentPlugin: IntegrationPlugin = { required: true, rows: 4, }, + { + key: "systemPrompt", + label: "System Prompt", + type: "template-textarea", + placeholder: "Optional custom instructions for the guard...", + example: "Be extra strict with code-related inputs", + rows: 3, + }, ], }, { diff --git a/plugins/superagent/steps/guard.ts b/plugins/superagent/steps/guard.ts index a84907fe..85b75add 100644 --- a/plugins/superagent/steps/guard.ts +++ b/plugins/superagent/steps/guard.ts @@ -16,6 +16,7 @@ type GuardResult = { export type SuperagentGuardCoreInput = { text: string; + systemPrompt?: string; }; export type SuperagentGuardInput = StepInput & @@ -45,6 +46,7 @@ async function stepHandler( }, body: JSON.stringify({ text: input.text, + ...(input.systemPrompt && { system_prompt: input.systemPrompt }), }), });