<?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: rifzankhan</title>
    <description>The latest articles on DEV Community by rifzankhan (@rifzankhan).</description>
    <link>https://dev.to/rifzankhan</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3823484%2Fe2507019-bf3b-487b-bc4f-8767e290ccd0.png</url>
      <title>DEV Community: rifzankhan</title>
      <link>https://dev.to/rifzankhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rifzankhan"/>
    <language>en</language>
    <item>
      <title>Stop your AI agents from doing stupid things (I open-sourced a React UI for Human-in-the-Loop)</title>
      <dc:creator>rifzankhan</dc:creator>
      <pubDate>Sat, 14 Mar 2026 07:34:13 +0000</pubDate>
      <link>https://dev.to/rifzankhan/stop-your-ai-agents-from-doing-stupid-things-i-open-sourced-a-react-ui-for-human-in-the-loop-5eek</link>
      <guid>https://dev.to/rifzankhan/stop-your-ai-agents-from-doing-stupid-things-i-open-sourced-a-react-ui-for-human-in-the-loop-5eek</guid>
      <description>&lt;p&gt;If you are building AI applications right now, you’ve probably hit the exact same wall I did: giving AI agents access to real-world tools is terrifying.&lt;/p&gt;

&lt;p&gt;When an agent is just summarizing text, hallucinations are annoying. When an agent has the tool-call ability to delete_invoice or refund_customer, a hallucination is a catastrophic business failure.&lt;/p&gt;

&lt;p&gt;Backend frameworks like LangGraph and CopilotKit are great at handling the "pause" state for Human-in-the-Loop (HITL) workflows. But they leave the frontend completely up to you. I got tired of building custom JSON editors, state machines, and validation logic just to let a human operator say "Yes" or "No" to an AI.&lt;/p&gt;

&lt;p&gt;So, I built and open-sourced Agent Approval Card.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0mb55nz2hnzpw4pauh8.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq0mb55nz2hnzpw4pauh8.gif" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What it is&lt;br&gt;
It’s a completely stateless, drop-in React component (). You pass it the proposed action and arguments, and it gives the operator a clean UI to approve, reject, or inline-edit the parameters before executing.&lt;/p&gt;

&lt;p&gt;I specifically kept it scoped to the UI layer. It doesn't force you into any specific backend protocol, queue manager, or state-management library. You own the async logic; the component just handles the UX.&lt;/p&gt;

&lt;p&gt;Features&lt;br&gt;
🔴 Risk Levels: Dynamically renders danger buttons and warnings for "high" or "destructive" actions.&lt;/p&gt;

&lt;p&gt;📝 Inline Editing: Operators can tweak the raw JSON payload before approving (perfect for fixing a slightly hallucinated argument without scrapping the whole run).&lt;/p&gt;

&lt;p&gt;🛡️ Frictionless Rejection: Operators can slam the "Reject" button instantly without being forced to type out a reason.&lt;/p&gt;

&lt;p&gt;💅 Customizable: Ships with a clean default CSS variable theme that looks at home in modern dashboards (Stripe, Vercel, etc.).&lt;/p&gt;

&lt;p&gt;How to use it&lt;br&gt;
Bash&lt;br&gt;
npm install agent-approval-card&lt;/p&gt;

&lt;p&gt;The Repo&lt;br&gt;
You can check out the source code, the complete prop API, and the Storybook documentation here:&lt;br&gt;


&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/rifzankhan" rel="noopener noreferrer"&gt;
        rifzankhan
      &lt;/a&gt; / &lt;a href="https://github.com/rifzankhan/agent-approval-card" rel="noopener noreferrer"&gt;
        agent-approval-card
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &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;Agent Approval Card&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;A React component for human-in-the-loop approval flows in AI apps.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;AgentApproval&lt;/code&gt; is built for the frontend gap most agent frameworks leave behind: the moment when an agent wants to do something risky, expensive, or irreversible, and a human needs to review it before it happens.&lt;/p&gt;
&lt;p&gt;It gives you a clean approval UI without forcing a queue system, backend protocol, or orchestration model.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Why this exists&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Most agent frameworks help with backend pause-and-resume logic. Very few give you a reusable approval interface that is good enough to drop into a real product.&lt;/p&gt;
&lt;p&gt;This package focuses on that missing layer:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;explain what the agent wants to do&lt;/li&gt;
&lt;li&gt;show the exact parameters it plans to use&lt;/li&gt;
&lt;li&gt;let a human approve, reject, or edit those parameters&lt;/li&gt;
&lt;li&gt;surface risk clearly for destructive actions&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;What you get&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;A polished &lt;code&gt;&amp;lt;AgentApproval /&amp;gt;&lt;/code&gt; React component&lt;/li&gt;
&lt;li&gt;Controlled async workflow owned by the host app&lt;/li&gt;
&lt;li&gt;Explicit rationale…&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/rifzankhan/agent-approval-card" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;




&lt;p&gt;If you are building agentic workflows, I'd love to hear how you are currently handling operator approvals, or if there are any specific UI states I missed for your use case!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
