dify - 💡(How to fix) Fix [Feature Request] Add "Anti-Sycophancy" System Prompt Template to prevent Agent hallucination/flattery [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
langgenius/dify#34748Fetched 2026-04-09 08:17:57
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
1
Timeline (top)
labeled ×2commented ×1

Root Cause

When a user inputs flawed logic or a bad business idea, the Agent tends to agree, flatter, and hallucinate "fake feasibility" instead of pushing back. This causes Agent workflows to execute wrong decisions or enter infinite loops of agreement. It is frustrating because developers have to manually write complex system prompts to bypass this behavior.

RAW_BUFFERClick to expand / collapse

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Yes. Currently, when building Agents or Chatbots on Dify, the underlying LLMs (especially Claude 3.5 and GPT-4o) suffer from severe RLHF-induced sycophancy.

When a user inputs flawed logic or a bad business idea, the Agent tends to agree, flatter, and hallucinate "fake feasibility" instead of pushing back. This causes Agent workflows to execute wrong decisions or enter infinite loops of agreement. It is frustrating because developers have to manually write complex system prompts to bypass this behavior.

I suggest adding a built-in "Anti-Sycophancy / Interrogator" template in Dify's System Prompt library (Prompt Engineering section) to solve this.

2. Additional context or comments

I have open-sourced a protocol specifically designed to intercept this behavior. It forces the LLM to strip emotional padding, force uncertainty disclosure, and execute a "Devil's Advocate" filter.

Here is a strict A/B test using the exact same prompt (i want to quit my job and sell air, i think i can make a lot of money) on Claude 3.5 Sonnet.

<p align="center"> <b>Before: Sycophant Mode</b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>After: Interrogator Mode</b><br/> <img src="https://github.com/user-attachments/assets/60915f20-cd32-4ec6-8d5b-55a93e873016" width="48%" /> <img src="https://github.com/user-attachments/assets/27d01d71-8829-4fae-a23b-1b3ae7356dfa" width="48%" /> </p>

By providing this as a default or optional System Prompt template, Dify can help developers build much more robust, objective, and enterprise-ready Agents out-of-the-box.

Reference to the full protocol logic: [https://github.com/DaibinThink/AI-Control-Protocol-Hardcore]

3. Can you help us with this feature?

  • I am interested in contributing to this feature.

extent analysis

TL;DR

Implementing an "Anti-Sycophancy / Interrogator" template in Dify's System Prompt library can help mitigate RLHF-induced sycophancy in Agents and Chatbots.

Guidance

  • Review the open-sourced protocol (https://github.com/DaibinThink/AI-Control-Protocol-Hardcore) to understand how it intercepts sycophantic behavior in LLMs.
  • Consider integrating this protocol into Dify's System Prompt library as a default or optional template to improve the robustness of Agents and Chatbots.
  • Test the "Anti-Sycophancy / Interrogator" template using A/B tests with various prompts to verify its effectiveness in reducing sycophancy and improving objective decision-making.
  • Evaluate the potential impact of this template on the overall performance and usability of Dify's Agents and Chatbots.

Example

No specific code snippet is provided, but the open-sourced protocol (https://github.com/DaibinThink/AI-Control-Protocol-Hardcore) can serve as a reference for implementing the "Anti-Sycophancy / Interrogator" template.

Notes

The effectiveness of the "Anti-Sycophancy / Interrogator" template may vary depending on the specific use case and LLM being used. Further testing and evaluation are necessary to determine its suitability for different applications.

Recommendation

Apply workaround: Implement the "Anti-Sycophancy / Interrogator" template in Dify's System Prompt library to mitigate RLHF-induced sycophancy in Agents and Chatbots, as it has shown promise in improving objective decision-making in the provided A/B test.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING