<?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: Prakash Thapa</title>
    <description>The latest articles on DEV Community by Prakash Thapa (@pt67).</description>
    <link>https://dev.to/pt67</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%2F818612%2F826b6d75-e233-4de5-b1df-8dd07b88cb75.jpeg</url>
      <title>DEV Community: Prakash Thapa</title>
      <link>https://dev.to/pt67</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pt67"/>
    <language>en</language>
    <item>
      <title>Auth0 for AI Agents Challenge</title>
      <dc:creator>Prakash Thapa</dc:creator>
      <pubDate>Thu, 16 Oct 2025 16:02:01 +0000</pubDate>
      <link>https://dev.to/pt67/auth0-for-ai-agents-challenge-fhi</link>
      <guid>https://dev.to/pt67/auth0-for-ai-agents-challenge-fhi</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/auth0-2025-10-08"&gt;Auth0 for AI Agents Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;This application is a sophisticated AI Agent Assistant that demonstrates how to build secure, trustworthy, and controllable AI agents. At its core, it's a chat interface where a user can interact with an AI powered by the Gemini API.&lt;br&gt;
However, its unique value lies in the simulation of a robust permissions layer, conceptually powered by Auth0 for AI Agents. This layer allows end-users to have granular control over the AI's capabilities.&lt;br&gt;
The Problem It Solves&lt;br&gt;
As AI agents become more integrated into our digital lives, they require access to personal data and the ability to perform actions on our behalf (e.g., read emails, book meetings, query databases). This creates a significant security and privacy challenge: How do you ensure an AI agent only does what it's explicitly allowed to do and only accesses the information it's permitted to see?&lt;br&gt;
This application directly addresses this problem by providing a clear model for:&lt;br&gt;
Secure Scoping: The AI's abilities are not limitless. They are strictly defined by the "Tools" (actions it can take) and "Knowledge Sources" (information it can access) that the user grants it.&lt;br&gt;
User-Centric Control: The user, after authenticating via Auth0, acts as an administrator for their own AI agent. They can dynamically connect tools or grant access to knowledge through a simple and intuitive UI.&lt;br&gt;
Enforced Boundaries: The application uses Gemini's systemInstruction feature to create a secure operational boundary for the AI. The agent is explicitly instructed to adhere to its given permissions, refuse requests that fall outside those permissions, and be transparent about which tools or knowledge sources it's using.&lt;br&gt;
In essence, this application provides a blueprint for building agentic AI systems that are not only powerful but also secure, transparent, and trustworthy. It moves beyond simple chatbots to showcase a future where users can confidently delegate tasks to AI assistants, knowing they have full control over their digital footprint.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/pt67/agent_auth" rel="noopener noreferrer"&gt;https://github.com/pt67/agent_auth&lt;/a&gt;&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%2Fcc0c3q70chpy6worihrn.png" 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%2Fcc0c3q70chpy6worihrn.png" alt=" "&gt;&lt;/a&gt;&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%2Fem13els7b1ggey2ji551.png" 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%2Fem13els7b1ggey2ji551.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;

  &lt;iframe src="https://www.youtube.com/embed/NoA8_eonxFM"&gt;
  &lt;/iframe&gt;


&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Auth0 for AI Agents
&lt;/h2&gt;

&lt;p&gt;This application simulates a secure, user-controlled AI assistant by integrating Auth0 for AI Agents in the following ways:&lt;/p&gt;

&lt;p&gt;User Authentication &amp;amp; Agent Ownership Auth0 handles user login and identity verification, ensuring that each AI agent session is tied to a specific authenticated user. This establishes clear ownership and accountability for agent actions.&lt;/p&gt;

&lt;p&gt;Granular Permission Scoping After authentication, users can selectively grant access to tools (e.g., calendar, email, database) and knowledge sources. These permissions are scoped and stored per session, mimicking OAuth-style delegation.&lt;/p&gt;

&lt;p&gt;Dynamic Capability Management The frontend UI allows users to toggle tools and data access dynamically. Auth0 ensures that only authenticated users can modify these scopes, and the agent reflects these changes in real time.&lt;/p&gt;

&lt;p&gt;System-Level Boundaries via Gemini The Gemini API is configured with systemInstruction prompts that enforce the agent’s operational boundaries. These instructions explicitly tell the AI to:&lt;/p&gt;

&lt;p&gt;Refuse actions outside its granted permissions&lt;/p&gt;

&lt;p&gt;Disclose what tools or data it's using&lt;/p&gt;

&lt;p&gt;Respect user-defined limits at all times&lt;/p&gt;

&lt;p&gt;Security-First Design The architecture models a future-proof approach to agentic systems: one where users remain in control, agents are transparent, and access is always intentional.&lt;/p&gt;

&lt;p&gt;This setup demonstrates how Auth0 can be used not just for login, but as a foundation for secure, trustworthy AI delegation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned and Takeaways
&lt;/h2&gt;

&lt;p&gt;Building this project was both challenging and rewarding. Here are some key reflections:&lt;/p&gt;

&lt;p&gt;Challenge: Simulating Real Agent Boundaries Designing a realistic permissions model for an AI agent required careful thought. It wasn't just about toggling features—it was about enforcing boundaries the agent would respect.&lt;/p&gt;

&lt;p&gt;Challenge: Aligning UX with Security Creating a UI that felt intuitive while still communicating the gravity of access control was tricky. I learned how important it is to make permission management feel empowering, not burdensome.&lt;/p&gt;

&lt;p&gt;Lesson: System Instructions Matter Gemini's systemInstruction feature was pivotal. It taught me how much influence prompt engineering has over agent behavior, especially when simulating secure delegation.&lt;/p&gt;

&lt;p&gt;Lesson: Auth0 Is More Than Login Auth0's flexibility allowed me to model agent ownership, permission scoping, and dynamic session control. It reinforced that authentication is the foundation of trustworthy AI.&lt;/p&gt;

&lt;p&gt;Advice for Developers If you're building AI agents, treat them like collaborators with boundaries. Use authentication not just to verify users, but to define what agents can do. And always make those boundaries visible to users.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>auth0challenge</category>
      <category>ai</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Google AI Studio Challenge Submission Template</title>
      <dc:creator>Prakash Thapa</dc:creator>
      <pubDate>Fri, 05 Sep 2025 12:48:00 +0000</pubDate>
      <link>https://dev.to/pt67/google-ai-studio-challenge-submission-template-250e</link>
      <guid>https://dev.to/pt67/google-ai-studio-challenge-submission-template-250e</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/google-ai-studio-2025-09-03"&gt;Google AI Studio Multimodal Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;The Problem It Solves&lt;br&gt;
Many people face the daily challenge of looking at a collection of ingredients in their fridge or pantry and feeling uninspired or unsure of what to make. This often leads to food waste or repetitive meals. Traditional recipe searches require users to manually type in ingredients, which can be tedious and may not capture everything available.&lt;br&gt;
The Experience It Creates&lt;br&gt;
The Visual Recipe Assistant creates a seamless and intuitive experience to combat this problem:&lt;br&gt;
Effortless Inspiration: Instead of typing, you simply snap a photo of your ingredients. The app takes this visual input and instantly provides you with complete, ready-to-make recipes. This removes the mental friction of meal planning and makes cooking more spontaneous and fun.&lt;br&gt;
AI-Powered Culinary Creativity: The applet showcases the power of the Gemini API's multimodal understanding. It intelligently identifies various food items from an image and generates creative, relevant recipes complete with instructions, serving sizes, and even estimated nutritional information.&lt;br&gt;
Reduces Food Waste: By suggesting recipes based on what you actually have, the app encourages you to use up ingredients before they spoil, promoting a more sustainable kitchen.&lt;br&gt;
A Personalized Digital Cookbook: With the ability to save your favorite generated recipes, the app becomes a personal, ever-growing cookbook. The "Saved Recipes" feature ensures that you can easily revisit meals you enjoyed, building a curated collection tailored to your tastes and pantry staples.&lt;br&gt;
In essence, the Visual Recipe Assistant transforms your phone's camera into a smart culinary partner, making meal discovery effortless, reducing food waste, and empowering you to be more creative in the kitchen.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&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%2Fn8ua2wsr8gt3j3qn9g7u.png" 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%2Fn8ua2wsr8gt3j3qn9g7u.png" alt=" " width="800" height="377"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://youtu.be/nXbO-m_aLus" rel="noopener noreferrer"&gt;https://youtu.be/nXbO-m_aLus&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Used Google AI Studio
&lt;/h2&gt;

&lt;p&gt;This application is a prime example of leveraging the powerful multimodal capabilities of the Google Gemini API, the same technology that powers Google AI Studio. Here’s a breakdown of how it was implemented:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Core Multimodal Capability: Fusing Image and Text Input
The central feature of this app is its ability to understand and reason from two different types of input simultaneously: an image and a text prompt. This is a core strength of the Gemini models.
Image Input (ImagePart): The user provides a photograph of their ingredients. This is the visual context. The gemini-2.5-flash model doesn't just see pixels; it performs sophisticated object recognition to identify the items as "tomatoes," "onions," "pasta," "herbs," etc. This is the "what do I have?" part of the equation.
Text Input (TextPart): The image alone isn't enough. I pair the visual data with a carefully crafted text prompt:
"Based on the ingredients in this image, suggest up to 3 simple recipes. For each recipe, provide the recipe name, a list of ingredients with quantities, step-by-step instructions, the serving size, and estimated nutritional information (calories, protein, carbohydrates, and fats)."
This prompt gives the model its instructions—the "what should I do with this information?" part. It directs the model to act as a creative chef and to structure its response in a very specific way.
The synergy of these two modalities allows the model to perform a complex task: it looks at the image, identifies the ingredients, and then uses that list as the basis for a creative text-generation task defined by the prompt.&lt;/li&gt;
&lt;li&gt;Leveraging an Advanced AI Studio Feature: Structured Output (JSON Schema)
A major challenge when working with large language models is getting consistently formatted output that can be easily used in an application. Getting back a plain block of text would require fragile and error-prone string parsing.
To solve this, I leveraged one of the most powerful features available through the Gemini API, which you can also configure in AI Studio: Structured Output.
responseMimeType: 'application/json': This tells the model that I expect the final output to be a valid JSON string.
responseSchema: This is the most critical part. I provide the model with a detailed JSON schema that defines the exact structure of the data I want. I specified that the output should be an ARRAY of OBJECTs, where each object must contain:
recipeName (a STRING)
ingredients (an ARRAY of STRINGs)
instructions (an ARRAY of STRINGs)
servingSize (a STRING)
nutritionalInfo (an OBJECT with specific string properties for calories, protein, etc.)
By defining this schema, I force the model to organize its creative output into a predictable, machine-readable format. This eliminates the need for manual parsing and makes the integration between the AI response and the user interface seamless and robust. The application can directly take the JSON response, parse it, and render the recipe cards.
In summary, this applet uses multimodal input (image + text) to understand a user's real-world context and leverages structured output (JSON schema) to transform the AI's creative response into reliable data that powers a dynamic and user-friendly experience.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Multimodal Features
&lt;/h2&gt;

&lt;p&gt;The specific multimodal functionality I built is the core of this application: it fuses visual input (an image of ingredients) with a detailed text prompt to generate structured JSON data (recipes). This is a powerful combination that significantly enhances the user experience in several ways.&lt;br&gt;
The Multimodal Functionality Breakdown:&lt;br&gt;
Visual Understanding (Image Input): The user provides a photo of their available ingredients. The gemini-2.5-flash model leverages its sophisticated computer vision capabilities to identify the individual food items in the image. It doesn't just see a picture; it understands "these are tomatoes, that's an onion, I see a box of pasta." This acts as the factual, real-world context for the request.&lt;br&gt;
Instructional Context (Text Input): The image alone is just data. The user's intent is provided through a carefully crafted text prompt that is sent simultaneously with the image. The prompt instructs the model to act as a recipe generator, specifying the desired output: "suggest up to 3 simple recipes... provide the recipe name, a list of ingredients with quantities, step-by-step instructions, serving size, and estimated nutritional information."&lt;br&gt;
Structured Output (JSON): A key part of the implementation is forcing the model's response into a specific modality—structured application/json. By providing a responseSchema, the AI's creative text and numerical data are organized into a clean, predictable format that the application can immediately parse and render into UI components.&lt;br&gt;
Why It Enhances the User Experience:&lt;br&gt;
Intuitive and Effortless Interaction: The primary benefit is a massive reduction in friction. Instead of the tedious task of manually typing out a list of ingredients, the user performs a simple, natural action: taking a photo. This mimics asking a friend, "What can I make with this?" It's faster, more engaging, and feels almost magical.&lt;br&gt;
Solves a Practical, Real-World Problem: This functionality directly addresses the common "what's for dinner?" dilemma. By starting with the user's actual inventory, the generated recipes are immediately actionable and relevant. This helps reduce food waste and encourages creativity with ingredients that might otherwise be overlooked.&lt;br&gt;
Creates a Reliable and Polished UI: By combining the multimodal input with a strict JSON output schema, the application avoids the pitfalls of parsing messy, unstructured text. This ensures that the generated recipes are always displayed in a clean, consistent, and easy-to-read format. The UI is robust and professional because the AI's output is tailored to its specific needs, which is a superior user experience compared to displaying a raw block of text.&lt;br&gt;
In essence, this multimodal approach transforms the user's phone camera from a simple image-capture device into a powerful culinary assistant, turning a snapshot of their kitchen counter into a personalized, actionable meal plan.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>googleaichallenge</category>
      <category>ai</category>
      <category>gemini</category>
    </item>
    <item>
      <title>I made a simple click winner game with javascript.</title>
      <dc:creator>Prakash Thapa</dc:creator>
      <pubDate>Sat, 25 Jun 2022 17:07:28 +0000</pubDate>
      <link>https://dev.to/pt67/i-made-a-simple-click-winner-game-b5c</link>
      <guid>https://dev.to/pt67/i-made-a-simple-click-winner-game-b5c</guid>
      <description>&lt;p&gt;This game is very simple and easy to understand. I have build just now and posted here. If you are beginner on HTML, CSS and Javascript this game will teach you a lot. &lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Lets create html file now:
&lt;/h2&gt;

&lt;p&gt;click_winner/index.html&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Shooter Ball&amp;lt;/title&amp;gt;

&amp;lt;link rel="stylesheet" href="css/style.css"/&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;

&amp;lt;div class="floor"&amp;gt;
&amp;lt;div id="time"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div id="score-box"&amp;gt;Score: &amp;lt;strong id="score"&amp;gt;0&amp;lt;/strong&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;div id="plane" disabled&amp;gt;Click Me&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;script src="js/script.js"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2:
&lt;/h2&gt;

&lt;p&gt;Create CSS file on css folder now&lt;br&gt;
click_winner/css/style.css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  width:500px;
  margin:auto;
  background:green;
  height:100vh;
}

#time, #score-box{
color:#fff;
padding:5px 10px;
} 

#plane{
border-radius: 50%;
padding: 10px;
height:50px;
width: 50px;
background:red;
text-align:center;
color:#fff;
box-shadow: 10px 10px 60px 0px rgba(0,0,0,0.75);
-webkit-box-shadow: 10px 10px 60px 0px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 60px 0px rgba(0,0,0,0.75);

 -webkit-user-select: none;  
  -moz-user-select: none;    
  -ms-user-select: none;      
  user-select: none;

cursor:pointer;  

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 3:
&lt;/h2&gt;

&lt;p&gt;Create a script file as well now in javascript.&lt;br&gt;
click_winner/js/script.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var pl = document.getElementById('plane');


//make a gravity for Plane;

var x =0;
var y=0;
var score = 0;


var timer_start = setInterval(makeMove, 10);

function makeMove(){
 x++;
 y++;


pl.style.transform = "translate("+ x +"px"+","+ y+"px)";


if(y &amp;gt;= 200){
  x = Math.floor(Math.random()*300);
  y = Math.floor(Math.random()*300);

 }
}



pl.onclick = ()=&amp;gt;{
score++

document.getElementById('score').innerHTML = score;
}

var time = 0;
setInterval(()=&amp;gt;{
time++;
document.getElementById('time').innerHTML = time + " Seconds left";

if(time == 60){
clearInterval(timer_start);
alert("Time Off. Restart the game again..")
}

}, 1000);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;I hope you guys enjoyed my simple game. If you learned something new today. You can check out the source code &lt;a href="https://github.com/pt67/click_winner"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
