Skip to content

Agent: make the out-of-scope guardrail and Supreme Agent prompts aware of Deep Research #620

Description

@kryachkow

Context

Follow-up from the review of #575 (Deep Research mediated clarification flow).

Deep Research is deliberately excluded from ChannelConfig.tool_fields, so it never appears in the general agent's tool set, the MCP server, or the out-of-scope checker. It is reachable only via the deep_research toggle ("button") — see SupremeAgentExecutor._resolve_deep_research_mode in statgpt/app/chains/supreme_agent.py.

A side effect of that isolation is that two prompts have no idea Deep Research exists. Both should be made aware of it.

1. Out-of-scope guardrail prompt

The guardrail runs on every turn (OutOfScopeChecker in statgpt/app/chains/out_of_scope_checker.py; prompt in statgpt/app/default_prompts/assets/guardrails.yaml → checkerPrompt). Its tool descriptions come from channel_config.agent_tools, which excludes Deep Research. If it classifies a Deep Research request as out of scope, MainChainFactory._main_chain skips the Supreme Agent entirely — so the request is blocked even though the user pressed the Deep Research button.

Goal: the guardrail must not block a request while the Deep Research toggle is on.

  • The toggle state is available as configuration.deep_research (StatGPTConfiguration); it is not currently passed to the guardrail.
  • Acceptance: with the toggle on, an otherwise-borderline research request is treated as in scope and reaches the mediated Deep Research turn.

2. Supreme Agent system prompt

The Supreme Agent system prompt (statgpt/app/default_prompts/assets/supreme_agent.yaml) only mentions Deep Research inside the mediation-only deepResearchSection, which is appended solely on Deep Research turns. On a normal turn the agent has no awareness of the feature, yet defaultGeneralSection already instructs it to explain its capabilities when asked ("If asked about your capabilities, clearly explain the tools you have access to and their functions").

Goal: when the user asks about functionality/capabilities, the agent should mention that a Deep Research mode is supported, but that it is only available when the Deep Research button is enabled.

  • Acceptance: asked "what can you do?" on a normal turn, the agent lists Deep Research as an available mode and notes it is enabled via the button.

Notes

  • Both prompts are admin-configurable, so wording belongs in the default prompt assets (and should remain overridable per channel), not hard-coded.
  • Keep routing deterministic: this issue is only about prompt/guardrail awareness, not about changing how a Deep Research turn is selected (that stays driven by the toggle + session flag).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions