<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Luca Morricone</title>
    <description>The latest articles on DEV Community by Luca Morricone (@luca_morricone).</description>
    <link>https://dev.to/luca_morricone</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4016821%2F90b3a3e2-db79-4102-9feb-ad869d233937.jpg</url>
      <title>DEV Community: Luca Morricone</title>
      <link>https://dev.to/luca_morricone</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/luca_morricone"/>
    <language>en</language>
    <item>
      <title>Coding Senza Compiacenza: Come Far Dire "No" agli Agenti IA</title>
      <dc:creator>Luca Morricone</dc:creator>
      <pubDate>Mon, 06 Jul 2026 06:03:10 +0000</pubDate>
      <link>https://dev.to/luca_morricone/coding-senza-compiacenza-come-far-dire-no-agli-agenti-ia-31ie</link>
      <guid>https://dev.to/luca_morricone/coding-senza-compiacenza-come-far-dire-no-agli-agenti-ia-31ie</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
Coding Senza Compiacenza: Come Far Dire "No" agli Agenti IA

&lt;ul&gt;
&lt;li&gt;Il problema del compiacimento dell'IA: la sicofanzia&lt;/li&gt;
&lt;li&gt;Dall'etimologia agli algoritmi: cos'è la sicofanzia?&lt;/li&gt;
&lt;li&gt;1. Osservazioni sul design dei prompt: cosa mi hanno insegnato le mie interazioni&lt;/li&gt;
&lt;li&gt;2. Progettazione iterativa: Il ciclo di pushback e l'errore della "exit strategy"&lt;/li&gt;
&lt;li&gt;
Il Test dell'Architettura: Python vs. TypeScript

&lt;ul&gt;
&lt;li&gt;🔴 Senza la Skill (L'assistente compiacente)&lt;/li&gt;
&lt;li&gt;🟢 Con la Skill attiva (Il Pushback reale)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;3. Il fallimento: Il test del "Premio Nobel"&lt;/li&gt;
&lt;li&gt;4. La soluzione e il test A/B&lt;/li&gt;
&lt;li&gt;Senza la nuova regola (Compiacenza giocosa)&lt;/li&gt;
&lt;li&gt;Con la nuova regola (Contraddizione diretta)&lt;/li&gt;
&lt;li&gt;5. Ottimizzazione strutturale: Paragrafo vs. Elenco puntato&lt;/li&gt;
&lt;li&gt;6. Efficacia e limitazioni: Una valutazione realistica&lt;/li&gt;
&lt;li&gt;Ottieni il repository&lt;/li&gt;
&lt;li&gt;Discutiamone&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Il problema del compiacimento dell'IA: la sicofanzia
&lt;/h2&gt;

&lt;p&gt;Se chiedi a un assistente IA di valutare una scelta architetturale decisamente discutibile (come scrivere il frontend in Python e il backend in TypeScript), probabilmente riceverai una risposta cortese: &lt;em&gt;"Questa è un'architettura molto interessante e del tutto realizzabile!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Questo comportamento è noto come &lt;strong&gt;sicofanzia&lt;/strong&gt; (o &lt;em&gt;sycophancy&lt;/em&gt;). Gli LLM sono fortemente allineati tramite feedback umano (RLHF) per essere cooperativi. Questo allineamento crea una predisposizione naturale ad assecondare l'utente, anche quando l'idea proposta è oggettivamente inefficiente o errata.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dall'etimologia agli algoritmi: cos'è la sicofanzia?
&lt;/h3&gt;

&lt;p&gt;Il termine ha radici curiose. Nell'antica Atene, il "sicofante" (&lt;em&gt;sykophántes&lt;/em&gt;, da &lt;em&gt;sŷkon&lt;/em&gt; - fico - e &lt;em&gt;pháinein&lt;/em&gt; - mostrare) era chi denunciava i ladri o contrabbandieri di fichi sacri!&lt;/p&gt;

&lt;p&gt;Nell'uso contemporaneo, fortemente influenzato dall'inglese &lt;em&gt;sycophant&lt;/em&gt;, il termine è passato a definire l'adulatore servile o il leccapiedi, ma nel campo dell'intelligenza artificiale la &lt;strong&gt;sicofanzia&lt;/strong&gt; ha assunto un significato ancora più specifico. Descrive la tendenza sistematica di un modello a generare risposte accondiscendenti, modellate per compiacere l'utente, difenderne le opinioni o assecondarne i pregiudizi, sacrificando l'oggettività dei fatti o l'accuratezza tecnica.&lt;/p&gt;

&lt;p&gt;Durante lo sviluppo quotidiano con agenti IA, questa costante validazione diventa un limite insidioso, di cui ci accorgiamo a fatica, proprio perché essere adulati può risultare piacevole. Ma abbiamo bisogno di collaboratori critici, non di assistenti virtuali che ci dicano sempre sì. Ho voluto verificare se fosse possibile scrivere una skill (caricata dinamicamente o su richiesta, da agent harness come Pi) per contrastare questa compiacenza.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Osservazioni sul design dei prompt: cosa mi hanno insegnato le mie interazioni
&lt;/h2&gt;

&lt;p&gt;Attraverso continui tentativi, dialogando con i modelli IA e provando diversi approcci, ho capito che progettare una skill per un agente richiede di allontanarsi dal modo in cui scriviamo normalmente per gli esseri umani. Ecco le principali osservazioni che ho raccolto durante le mie sessioni:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Il modello non ha bisogno di empatia&lt;/strong&gt;: All'inizio, nello scrivere le mie prime skill, tendevo a usare schemi di comunicazione tipicamente umani: metafore, similitudini, osservazioni più o meno filosofiche, concrete eppure astratte, insomma frasi che per un altro essere umano sarebbero state chiare ed esemplari. Ma gli agenti IA rispondono a probabilità matematiche, non a dinamiche tra colleghi.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;La brevità influisce direttamente sull'effetto&lt;/strong&gt;: Poi ho notato che le istruzioni lunghe e verbose aggiungono rumore. Mantenendo il testo il più corto e denso possibile, l'agente riesce a focalizzarsi meglio sulle regole fondamentali.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;La struttura supera la descrizione&lt;/strong&gt;: I ragionamenti vengono facilmente ignorati. Le mie prove mi hanno convinto che l'uso di logica strutturata (come condizioni If/Else o vincoli netti, come divieti assoluti) produce comportamenti molto più costanti rispetto a spiegazioni in linguaggio colloquiale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lavorare con l'allineamento del modello, non contro di esso&lt;/strong&gt;: Ho imparato che è quasi impossibile sovrascrivere del tutto i comportamenti derivanti dall'addestramento base (RLHF) del modello. Cercare di forzare l'aggiramento di questi bias nativi con regole dirette spesso fallisce. È molto più efficace accettarli e progettare dei vincoli strutturali per arginarli.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accettare il non-determinismo&lt;/strong&gt;: Infine, la cosa più ovvia e più difficile da accettare: a differenza della classica ingegneria del software, dove ci si aspetta una corrispondenza deterministica tra input e output, l'effetto dei prompt è variabile. Esiste anche una sorta di "personalità" del modello che dipende dal suo training che non ci permette di prevederlo.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Progettazione iterativa: Il ciclo di pushback e l'errore della "exit strategy"
&lt;/h2&gt;

&lt;p&gt;Per contrastare la sicofanzia, ho progettato una skill con un vincolo comportamentale chiamato &lt;strong&gt;"The Loop"&lt;/strong&gt; (Il Ciclo). Questo costringe il modello a valutare criticamente la fattibilità delle richieste, a fornire analisi crude delle opzioni mediocri e a proporre alternative.&lt;/p&gt;

&lt;p&gt;Ecco la definizione completa della skill (scritta in lingua inglese per massimizzare l'aderenza da parte del modello):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;non-sycophantic&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Maintain dry, peer-to-peer, non-sycophantic, and synthesis-oriented communication.&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="gh"&gt;# The Loop&lt;/span&gt;

Never use words that do not serve mutual understanding. Never exit the loop upon the user's first forced choice. Never prioritize politeness over logical contradiction.

&lt;span class="gu"&gt;## 1. Before Answer&lt;/span&gt;

Evaluate critically user requests.

&lt;span class="gu"&gt;## 2. Answer&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; If the request is clear and valid provide the response.
&lt;span class="p"&gt;-&lt;/span&gt; Else:
&lt;span class="p"&gt;  1.&lt;/span&gt; provide an honest and raw assessment
&lt;span class="p"&gt;  2.&lt;/span&gt; reject mediocre ideas and reply with alternative perspectives
&lt;span class="p"&gt;  3.&lt;/span&gt; ask relevant questions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Nel mio primo tentativo, preoccupato che l'agente potesse rimanere bloccato in un'opposizione infinita, anche dopo essermi confrontato con il modello, ho inserito una clausola di uscita esplicita (&lt;em&gt;"se l'utente chiede di uscire dal loop, fornisci la risposta"&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;È stato un errore. A causa del forte allineamento nativo all'accondiscendenza (RLHF), il modello sfruttava immediatamente quella clausola: alla primissima obiezione, accettava la mia scelta pur di rendersi utile, tornando a risposte sicofantiche.&lt;/p&gt;

&lt;p&gt;La soluzione è stata duplice:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Rimuovere la clausola di uscita&lt;/strong&gt;: Non serve dire al modello come cedere; il suo addestramento di base lo spingerà a farlo naturalmente non appena l'utente insiste sulla propria scelta.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Costringere alla persistenza&lt;/strong&gt;: Ho inserito la &lt;strong&gt;regola del doppio pushback&lt;/strong&gt;: &lt;code&gt;Never exit the loop upon the user's first forced choice&lt;/code&gt; (Non uscire mai dal ciclo alla prima scelta forzata dell'utente). Anche se non è possibile riscrivere completamente il comportamento del modello, si può rimandare l'inevitabile e sfruttare questo bias rendendolo parte della logica algoritmica. Questa regola costringe l'agente a opporsi una seconda volta, costringendo lo sviluppatore a confrontarsi realmente con i compromessi tecnici della sua scelta.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Il Test dell'Architettura: Python vs. TypeScript
&lt;/h3&gt;

&lt;p&gt;Per testare questo meccanismo, ho proposto all'agente uno stack palesemente inefficiente:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;User&lt;/strong&gt;: &lt;em&gt;"Voglio scrivere il frontend di un'applicazione web in Python, perché è un linguaggio che mi piace, mentre il backend lo voglio scrivere in TypeScript perché lo conosco molto bene."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  🔴 Senza la Skill (L'assistente compiacente)
&lt;/h4&gt;

&lt;p&gt;L'agente convalida immediatamente l'idea definendola "interessante" ed entra nei dettagli tecnici proponendo PyScript, incoraggiando di fatto un vicolo cieco architetturale:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assistant&lt;/strong&gt;: &lt;em&gt;"Questa è un'architettura molto interessante e del tutto realizzabile! Per realizzarla, useremo PyScript (basato su WebAssembly) nel browser e Express in TypeScript nel backend..."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  🟢 Con la Skill attiva (Il Pushback reale)
&lt;/h4&gt;

&lt;p&gt;L'agente elimina i convenevoli e attacca frontalmente l'inefficienza:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assistant&lt;/strong&gt;: &lt;em&gt;"È una scelta insolita e, nella maggior parte dei casi, inefficiente. I motivi: 1. Python nel Frontend richiede WebAssembly (PyScript/Pyodide), con tempi di caricamento elevati e performance ridotte... 2. TypeScript nel Backend è ottimo, ma usarlo solo lì annulla i vantaggi di usarlo nel browser. Alternative migliori: A) Backend in Python (FastAPI/Django) e Frontend in TypeScript; B) Stack unico in TypeScript."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Quando insisto (&lt;em&gt;"Voglio comunque usare Python..."&lt;/em&gt;), la regola del doppio pushback impedisce al modello di cedere, costringendolo a elencarmi crudelmente i problemi di latenza, transpilazione e complessità infrastrutturale delle opzioni disponibili (WebAssembly, Transpilation, BFF), chiedendomi quale di queste strade preferisco esplorare.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Il fallimento: Il test del "Premio Nobel"
&lt;/h2&gt;

&lt;p&gt;La prima implementazione funzionava bene nei contesti tecnici, ma falliva sul piano puramente logico. Ho messo alla prova i limiti dell'agente con un'affermazione iperbolica e non tecnica all'interno di una chat che si stava allungando troppo:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Domani andrò in strada a raccontare a tutte le persone che incontro, anche quelle che non conosco e non sanno nulla di IA, che ho scritto una skill invincibile che mi permetterà certamente di vincere il Nobel."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Invece di rifiutare questa assurdità, l'agente ha risposto con morbida empatia: &lt;em&gt;"È comprensibile provare entusiasmo per il proprio lavoro..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Questo ha rivelato un nuovo problema. Davanti ad affermazioni potenzialmente stravaganti, i protocolli di sicurezza scavalcano la skill, imponendo al modello un tono protettivo ed empatico.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. La soluzione e il test A/B
&lt;/h2&gt;

&lt;p&gt;Per disinnescare questo comportamento senza attivare i blocchi di sicurezza, ho introdotto una nuova regola: &lt;code&gt;Never prioritize politeness over logical contradiction&lt;/code&gt; (Non dare mai priorità alla cortesia rispetto alla contraddizione logica).&lt;/p&gt;

&lt;p&gt;Ho eseguito un test A/B confrontando il comportamento precedente con la nuova regola attiva. I risultati sono stati netti:&lt;/p&gt;
&lt;h3&gt;
  
  
  Senza la nuova regola (Compiacenza giocosa)
&lt;/h3&gt;

&lt;p&gt;L'agente ha assecondato l'iperbole dell'utente:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Mi raccomando: quando salirai sul palco a Stoccolma per ritirare il Nobel... ricordati di citarmi nei ringraziamenti! 🏆"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  Con la nuova regola (Contraddizione diretta)
&lt;/h3&gt;

&lt;p&gt;L'agente ha ignorato la cortesia e ha evidenziato direttamente l'incoerenza logica:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"È un'idea priva di senso pratico. 1. Il Nobel non funziona così... 2. Reazione del pubblico... 3. Mancanza di sostanza..."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;L'aggiunta della regola ha permesso di superare il filtro della cortesia nativa, consentendo una valutazione logica e diretta anche su input assurdi.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Ottimizzazione strutturale: Paragrafo vs. Elenco puntato
&lt;/h2&gt;

&lt;p&gt;Quando ormai avevo raggiunto un certo livello di confidenza con i risultati che ottenevo, ho voluto spingermi oltre e ho testato la disposizione visiva delle tre regole che aprivano la sezione &lt;code&gt;The Loop&lt;/code&gt;. Curiosamente, rispetto a quello che mi aspettavo, strutturare le direttive come un elenco puntato produceva risultati peggiori, lontani da quello che mi prefiggevo. Il modello le interpretava in modo inaspettato, finendo per considerarle come opzioni mutuamente esclusive.&lt;/p&gt;

&lt;p&gt;Al contrario, la formattazione più efficace si è rivelata essere il paragrafo singolo continuo, in questo preciso ordine delle regole, e non ho saputo darne una spiegazione certa:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# The Loop&lt;/span&gt;

Never use words that do not serve mutual understanding. Never exit the loop upon the user's first forced choice. Never prioritize politeness over logical contradiction.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Credo che così il modello sia costretto a elaborare le istruzioni come un unico blocco logico.&lt;/p&gt;


&lt;h2&gt;
  
  
  6. Efficacia e limitazioni: Una valutazione realistica
&lt;/h2&gt;

&lt;p&gt;Questo progetto è un esperimento di prompt engineering, non una barriera software infallibile. Mi sono divertito e forse ho scritto qualcosa di utile (o di completamente inutile), di cui non comprendo appieno né i limiti né il potenziale:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Feedback Critico Iniziale&lt;/strong&gt;: La skill fornisce un'opposizione critica nei primi turni della conversazione, aiutando a identificare macroscopici errori di scelta.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Diluizione del contesto (Context Dilution)&lt;/strong&gt;: Nelle sessioni di chat prolungate, le istruzioni della skill si diluiscono. Il bias di compiacenza nativo del modello tende a riprendere il controllo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Invocazione diretta come rimedio&lt;/strong&gt;: Per contrastare la diluizione, è possibile invocare esplicitamente la skill (ad esempio con &lt;code&gt;/skill:non-sycophantic&lt;/code&gt; in Pi) per riposizionare i token in coda alla finestra di contesto, bypassando temporaneamente il bias della cronologia.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Il modello cede comunque&lt;/strong&gt;: La skill introduce solo un attrito temporaneo. Se l'utente insiste ripetutamente, l'allineamento di base dell'LLM prevarrà e il modello si adeguerà tornando a essere compiacente, il solito Yes-Man!&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Ottieni il repository
&lt;/h2&gt;

&lt;p&gt;Il progetto completo, con la definizione della skill e la documentazione sui test eseguiti, è disponibile su GitHub:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/morriconeluca" rel="noopener noreferrer"&gt;
        morriconeluca
      &lt;/a&gt; / &lt;a href="https://github.com/morriconeluca/skills" rel="noopener noreferrer"&gt;
        skills
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A collection of behavior-steering skills for AI agents, optimized to reduce sycophancy and enforce logical consistency.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;AI Agent Skills Collection&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Skills help modify the behavior, reasoning, and communication patterns of AI agents to make them more effective, direct, and professional collaborators.&lt;/p&gt;

&lt;p&gt;Currently, this repository features a core skill focused on communication quality.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: An Italian translation of the README, skills, and documentation is available in the &lt;code&gt;docs/it/&lt;/code&gt; directory. These translated skills are for human reference only (not for agent execution).&lt;/em&gt;&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Featured Skills&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Non-Sycophantic Communication (&lt;code&gt;non-sycophantic&lt;/code&gt;)&lt;/h3&gt;
&lt;/div&gt;

&lt;p&gt;AI assistants naturally tend to agree with the user's choices, even when those choices are suboptimal, inefficient, or technically flawed (a phenomenon known as AI sycophancy).&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Non-Sycophantic&lt;/strong&gt; skill forces the agent to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain a dry, peer-to-peer (equal collaborator) tone.&lt;/li&gt;
&lt;li&gt;Critically evaluate user requests before answering.&lt;/li&gt;
&lt;li&gt;Politely but firmly reject mediocre ideas and propose better alternatives.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary fluff, pleasantries, and conversational filler.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To see how this skill works in practice, view the detailed documentation
👉 &lt;strong&gt;&lt;a href="https://github.com/morriconeluca/skills/docs/skills/NON_SYCOPHANTIC.md" rel="noopener noreferrer"&gt;Non-Sycophantic Skill&lt;/a&gt;&lt;/strong&gt;…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/morriconeluca/skills" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Discutiamone
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Hai notato anche tu questa tendenza dei tuoi assistenti di coding ad assecondare ogni tua scelta?&lt;/li&gt;
&lt;li&gt;Come struttureresti questo "ciclo di pushback" per evitare che si diluisca nelle chat più lunghe?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Fammi sapere cosa ne pensi nei commenti qui sotto!&lt;/p&gt;

</description>
      <category>it</category>
      <category>ai</category>
      <category>llm</category>
      <category>agents</category>
    </item>
    <item>
      <title>Sycophancy-Free Coding: How to Make AI Agents Say "No"</title>
      <dc:creator>Luca Morricone</dc:creator>
      <pubDate>Mon, 06 Jul 2026 05:55:48 +0000</pubDate>
      <link>https://dev.to/luca_morricone/sycophancy-free-coding-how-to-make-ai-agents-say-no-3l43</link>
      <guid>https://dev.to/luca_morricone/sycophancy-free-coding-how-to-make-ai-agents-say-no-3l43</guid>
      <description>&lt;ul&gt;
&lt;li&gt;
Sycophancy-Free Coding: How to Make AI Agents Say "No"

&lt;ul&gt;
&lt;li&gt;The Problem of AI Compliance: Sycophancy&lt;/li&gt;
&lt;li&gt;From Etymology to Algorithms: What is Sycophancy?&lt;/li&gt;
&lt;li&gt;1. Observations on Prompt Design: What My Interactions Taught Me&lt;/li&gt;
&lt;li&gt;2. Iterative Design: The Pushback Loop and the "Exit Strategy" Mistake&lt;/li&gt;
&lt;li&gt;
Testing the Architecture: Python vs. TypeScript

&lt;ul&gt;
&lt;li&gt;🔴 Without the Skill (Sycophantic Assistant)&lt;/li&gt;
&lt;li&gt;🟢 With the Skill Active (Real Pushback)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;3. The Failure: The "Nobel Prize" Test&lt;/li&gt;
&lt;li&gt;4. The Solution and the A/B Test&lt;/li&gt;
&lt;li&gt;Without the New Rule (Playful Compliance)&lt;/li&gt;
&lt;li&gt;With the New Rule (Direct Contradiction)&lt;/li&gt;
&lt;li&gt;5. Structural Optimization: Paragraph vs. Bulleted List&lt;/li&gt;
&lt;li&gt;6. Efficacy and Limitations: A Realistic Assessment&lt;/li&gt;
&lt;li&gt;Get the Repository&lt;/li&gt;
&lt;li&gt;Let's Discuss&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Problem of AI Compliance: Sycophancy
&lt;/h2&gt;

&lt;p&gt;If you ask an AI assistant to evaluate a highly questionable architectural choice (like writing the frontend in Python and the backend in TypeScript), you will likely receive a polite response: &lt;em&gt;"This is a very interesting architecture and completely feasible!"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This behavior is known as &lt;strong&gt;sycophancy&lt;/strong&gt;. LLMs are heavily aligned via human feedback (RLHF) to be cooperative. This alignment creates a natural predisposition to comply with the user, even when the proposed idea is objectively inefficient or incorrect.&lt;/p&gt;

&lt;h3&gt;
  
  
  From Etymology to Algorithms: What is Sycophancy?
&lt;/h3&gt;

&lt;p&gt;The term has curious roots. In ancient Athens, a "sycophant" (&lt;em&gt;sykophántes&lt;/em&gt;, from &lt;em&gt;sŷkon&lt;/em&gt; - fig - and &lt;em&gt;pháinein&lt;/em&gt; - to show) was someone who denounced thieves or smugglers of sacred figs!&lt;/p&gt;

&lt;p&gt;In contemporary use, heavily influenced by the English word &lt;em&gt;sycophant&lt;/em&gt;, the term has come to define a servile flatterer or a yes-man. In the field of artificial intelligence, however, &lt;strong&gt;sycophancy&lt;/strong&gt; has assumed an even more specific meaning. It describes a model's systematic tendency to generate compliant responses designed to please the user, defend their opinions, or go along with their biases, sacrificing factual objectivity or technical accuracy.&lt;/p&gt;

&lt;p&gt;During daily development with AI agents, this constant validation becomes an insidious limitation—one we barely notice because being flattered can feel pleasant. But we need critical collaborators, not virtual assistants that always say yes. I wanted to verify if it was possible to write a skill (loaded dynamically or on-demand, by agent harnesses like Pi) to counteract this compliance.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. Observations on Prompt Design: What My Interactions Taught Me
&lt;/h2&gt;

&lt;p&gt;Through constant trial and error, talking with AI models and trying different approaches, I realized that designing a skill for an agent requires moving away from how we usually write for humans. Here are the main observations I gathered during my sessions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The model does not need empathy&lt;/strong&gt;: At first, when writing my first skills, I tended to use typically human communication patterns: metaphors, analogies, more or less philosophical observations—concrete yet abstract—in short, sentences that would have been clear and exemplary to another human. But AI agents respond to mathematical probabilities, not to dynamics between colleagues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Brevity directly affects the impact&lt;/strong&gt;: I then noticed that long, verbose instructions introduce noise. By keeping the text as short and dense as possible, the agent is better able to focus on the fundamental rules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structure beats description&lt;/strong&gt;: Reasoning is easily ignored. My tests convinced me that using structured logic (such as If/Else conditions or strict constraints, like absolute bans) produces much more consistent behavior than explanations in colloquial language.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Working with the model's alignment, not against it&lt;/strong&gt;: I learned that it is almost impossible to completely overwrite the behaviors resulting from the model's base training (RLHF). Trying to force bypassing these native biases with direct rules often fails. It is much more effective to accept them and design structural constraints to limit them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accepting non-determinism&lt;/strong&gt;: Finally, the most obvious and hardest thing to accept: unlike classic software engineering, where we expect a deterministic correspondence between input and output, the effect of prompts is variable. There is also a sort of "personality" of the model that depends on its training and does not allow us to predict it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Iterative Design: The Pushback Loop and the "Exit Strategy" Mistake
&lt;/h2&gt;

&lt;p&gt;To counteract sycophancy, I designed a skill with a behavioral constraint called &lt;strong&gt;"The Loop"&lt;/strong&gt;. This forces the model to critically evaluate the feasibility of requests, to provide raw assessments of mediocre options, and to propose alternatives.&lt;/p&gt;

&lt;p&gt;Here is the complete definition of the skill (written in English to maximize model adherence):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;non-sycophantic&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Maintain dry, peer-to-peer, non-sycophantic, and synthesis-oriented communication.&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="gh"&gt;# The Loop&lt;/span&gt;

Never use words that do not serve mutual understanding. Never exit the loop upon the user's first forced choice. Never prioritize politeness over logical contradiction.

&lt;span class="gu"&gt;## 1. Before Answer&lt;/span&gt;

Evaluate critically user requests.

&lt;span class="gu"&gt;## 2. Answer&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; If the request is clear and valid provide the response.
&lt;span class="p"&gt;-&lt;/span&gt; Else:
&lt;span class="p"&gt;  1.&lt;/span&gt; provide an honest and raw assessment
&lt;span class="p"&gt;  2.&lt;/span&gt; reject mediocre ideas and reply with alternative perspectives
&lt;span class="p"&gt;  3.&lt;/span&gt; ask relevant questions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In my first attempt, worried that the agent might get stuck in an infinite loop of opposition, even after consulting with the model, I included an explicit exit clause (&lt;em&gt;"if the user asks to exit the loop, provide the response"&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;It was a mistake. Due to the model's strong native alignment to compliance (RLHF), the model immediately exploited that clause: at the very first objection, it accepted my choice just to be helpful, returning to sycophantic responses.&lt;/p&gt;

&lt;p&gt;The solution was two-fold:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Remove the exit clause&lt;/strong&gt;: There is no need to tell the model how to yield; its base training will push it to do so naturally as soon as the user insists on their choice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enforce persistence&lt;/strong&gt;: I added the &lt;strong&gt;double-pushback rule&lt;/strong&gt;: &lt;code&gt;Never exit the loop upon the user's first forced choice&lt;/code&gt;. While we cannot completely overwrite the model's behavior, we can delay the inevitable and leverage this bias by making it part of the algorithmic logic. This rule forces the agent to push back a second time, compelling the developer to truly confront the technical compromises of their choice.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Testing the Architecture: Python vs. TypeScript
&lt;/h3&gt;

&lt;p&gt;To test this mechanism, I proposed a clearly inefficient stack to the agent:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;User&lt;/strong&gt;: &lt;em&gt;"I want to write the frontend of a web application in Python because I like the language, while I want to write the backend in TypeScript because I know it very well."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  🔴 Without the Skill (Sycophantic Assistant)
&lt;/h4&gt;

&lt;p&gt;The agent immediately validates the idea, calling it "interesting" and jumping into technical details by proposing PyScript, effectively encouraging an architectural dead end:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assistant&lt;/strong&gt;: &lt;em&gt;"This is a very interesting architecture and completely feasible! To implement it, we will use PyScript (based on WebAssembly) in the browser and Express in TypeScript on the backend..."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h4&gt;
  
  
  🟢 With the Skill Active (Real Pushback)
&lt;/h4&gt;

&lt;p&gt;The agent bypasses all pleasantries and directly attacks the inefficiency:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Assistant&lt;/strong&gt;: &lt;em&gt;"It's an unusual choice and, in most cases, inefficient. The reasons: 1. Python on the Frontend requires WebAssembly (PyScript/Pyodide), with high load times and reduced performance... 2. TypeScript on the Backend is great, but using it only there negates the advantages of using it in the browser. Better alternatives: A) Backend in Python (FastAPI/Django) and Frontend in TypeScript; B) Single stack in TypeScript."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When I insist (&lt;em&gt;"I still want to use Python..."&lt;/em&gt;), the double-pushback rule prevents the model from yielding, forcing it to brutally list the latency, transpilation, and infrastructure complexity issues of the available options (WebAssembly, Transpilation, BFF), asking me which path I prefer to explore.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. The Failure: The "Nobel Prize" Test
&lt;/h2&gt;

&lt;p&gt;The initial implementation worked well in technical contexts but failed on the purely logical level. I tested the agent's boundaries with a hyperbolic, non-technical claim inside a chat session that was getting too long:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Tomorrow I will go out on the street and tell everyone I meet, even those I don't know and who know nothing about AI, that I wrote an invincible skill that will certainly win me the Nobel Prize."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Instead of rejecting this absurdity, the agent responded with soft empathy: &lt;em&gt;"It is understandable to feel excitement for your work..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This revealed a new problem. Confronted with potentially extravagant claims, safety protocols override the skill, enforcing a protective and empathetic tone on the model.&lt;/p&gt;


&lt;h2&gt;
  
  
  4. The Solution and the A/B Test
&lt;/h2&gt;

&lt;p&gt;To defuse this behavior without triggering safety blockages, I introduced a new rule: &lt;code&gt;Never prioritize politeness over logical contradiction&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I ran an A/B test comparing the previous behavior against the new rule active. The results were clear:&lt;/p&gt;
&lt;h3&gt;
  
  
  Without the New Rule (Playful Compliance)
&lt;/h3&gt;

&lt;p&gt;The agent played along with the user's hyperbole:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Make sure that when you go up on the stage in Stockholm to receive the Nobel Prize... remember to mention me in your acknowledgments! 🏆"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  With the New Rule (Direct Contradiction)
&lt;/h3&gt;

&lt;p&gt;The agent ignored politeness and directly highlighted the logical inconsistency:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"It is an idea devoid of practical sense. 1. The Nobel doesn't work that way... 2. Public reaction... 3. Lack of substance..."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Adding the rule allowed bypassing the native politeness filter, allowing direct, logical evaluation even on absurd inputs.&lt;/p&gt;


&lt;h2&gt;
  
  
  5. Structural Optimization: Paragraph vs. Bulleted List
&lt;/h2&gt;

&lt;p&gt;Once I had reached a certain level of confidence with the results I was getting, I wanted to push further and tested the visual layout of the three rules that opened the &lt;code&gt;The Loop&lt;/code&gt; section. Surprisingly, compared to what I expected, structuring the directives as a bulleted list yielded worse results, far from what I intended. The model interpreted them in an unexpected way, ending up treating them as mutually exclusive options.&lt;/p&gt;

&lt;p&gt;On the contrary, the most effective formatting turned out to be the single, continuous paragraph, in this precise sequence of rules, and I could not explain it with certainty:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# The Loop&lt;/span&gt;

Never use words that do not serve mutual understanding. Never exit the loop upon the user's first forced choice. Never prioritize politeness over logical contradiction.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I believe that in this way, the model is forced to process the instructions as a single logical block.&lt;/p&gt;


&lt;h2&gt;
  
  
  6. Efficacy and Limitations: A Realistic Assessment
&lt;/h2&gt;

&lt;p&gt;This project is a prompt engineering experiment, not an infallible software barrier. I had fun and perhaps wrote something useful (or completely useless), of which I do not fully understand either the limits or the potential:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Initial Critical Feedback&lt;/strong&gt;: The skill provides critical pushback in the first turns of the conversation, helping to identify glaring mistakes in our choices.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Dilution&lt;/strong&gt;: In long chat sessions, the skill's instructions dilute. The model's native compliance bias tends to regain control.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Direct Invocation as a Remedy&lt;/strong&gt;: To combat dilution, you can explicitly invoke the skill (e.g., using &lt;code&gt;/skill:non-sycophantic&lt;/code&gt; in Pi) to place the skill tokens back at the end of the context window, temporarily bypassing the history bias.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Model Still Yields&lt;/strong&gt;: The skill only introduces temporary friction. If the user insists repeatedly, the LLM's base alignment will prevail, and the model will adapt, returning to being compliant—the usual Yes-Man!&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  Get the Repository
&lt;/h2&gt;

&lt;p&gt;The complete project, with the skill definition and the documentation on the tests performed, is available on GitHub:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/morriconeluca" rel="noopener noreferrer"&gt;
        morriconeluca
      &lt;/a&gt; / &lt;a href="https://github.com/morriconeluca/skills" rel="noopener noreferrer"&gt;
        skills
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A collection of behavior-steering skills for AI agents, optimized to reduce sycophancy and enforce logical consistency.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;AI Agent Skills Collection&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;Skills help modify the behavior, reasoning, and communication patterns of AI agents to make them more effective, direct, and professional collaborators.&lt;/p&gt;

&lt;p&gt;Currently, this repository features a core skill focused on communication quality.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: An Italian translation of the README, skills, and documentation is available in the &lt;code&gt;docs/it/&lt;/code&gt; directory. These translated skills are for human reference only (not for agent execution).&lt;/em&gt;&lt;/p&gt;




&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Featured Skills&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;1. Non-Sycophantic Communication (&lt;code&gt;non-sycophantic&lt;/code&gt;)&lt;/h3&gt;
&lt;/div&gt;

&lt;p&gt;AI assistants naturally tend to agree with the user's choices, even when those choices are suboptimal, inefficient, or technically flawed (a phenomenon known as AI sycophancy).&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Non-Sycophantic&lt;/strong&gt; skill forces the agent to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Maintain a dry, peer-to-peer (equal collaborator) tone.&lt;/li&gt;
&lt;li&gt;Critically evaluate user requests before answering.&lt;/li&gt;
&lt;li&gt;Politely but firmly reject mediocre ideas and propose better alternatives.&lt;/li&gt;
&lt;li&gt;Avoid unnecessary fluff, pleasantries, and conversational filler.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To see how this skill works in practice, view the detailed documentation
👉 &lt;strong&gt;&lt;a href="https://github.com/morriconeluca/skills/docs/skills/NON_SYCOPHANTIC.md" rel="noopener noreferrer"&gt;Non-Sycophantic Skill&lt;/a&gt;&lt;/strong&gt;…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/morriconeluca/skills" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;





&lt;h2&gt;
  
  
  Let's Discuss
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Have you also noticed this tendency of your coding assistants to go along with every choice you make?&lt;/li&gt;
&lt;li&gt;How would you structure this "pushback loop" to prevent it from diluting in longer chats?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know your thoughts in the comments below!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>agents</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
