<?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: Yu Watanabe</title>
    <description>The latest articles on DEV Community by Yu Watanabe (@yuwtennis).</description>
    <link>https://dev.to/yuwtennis</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%2F1179665%2F793db683-d71b-4537-8644-bd2a983df27e.png</url>
      <title>DEV Community: Yu Watanabe</title>
      <link>https://dev.to/yuwtennis</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yuwtennis"/>
    <language>en</language>
    <item>
      <title>Agent hardening with Auth0</title>
      <dc:creator>Yu Watanabe</dc:creator>
      <pubDate>Mon, 27 Oct 2025 01:55:04 +0000</pubDate>
      <link>https://dev.to/yuwtennis/agent-hardening-with-auth0-3pkl</link>
      <guid>https://dev.to/yuwtennis/agent-hardening-with-auth0-3pkl</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;I have built a agent that provides answer for confidential information to the right person.&lt;/p&gt;

&lt;p&gt;Before starting with the implementation, lets start with the problem I want to solve with this solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Point of View statement
&lt;/h3&gt;

&lt;p&gt;Bob works at IT team at EMarket, an online e-commerce company .&lt;br&gt;&lt;br&gt;
The company wants to provide chat services to their employee to boost productivity.&lt;br&gt;&lt;br&gt;
But the team wants to first launch the service to LIMIED person as a prototype and gather information as an usability testing.&lt;br&gt;&lt;br&gt;
Therefore, Bob needs to restrict the usage of the chat service to certain users.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://www.interaction-design.org/literature/topics/how-might-we?srsltid=AfmBOoqsb0Nc3JnWBq7bLxQ-b4jrfrA5UYnjMcFERC1sPt1hUPfij-_q" rel="noopener noreferrer"&gt;How-Might-We&lt;/a&gt; question denoted from the POV might be like,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How might we authenticate the user ?&lt;/li&gt;
&lt;li&gt;How might we restrict users to access the relative contents ?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To tackle the problem, I have came up with below solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&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%2F4uwqxe6jpx5sl23tyezw.jpg" 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%2F4uwqxe6jpx5sl23tyezw.jpg" alt="architecture" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;em&gt;User&lt;/em&gt; logs in to the app.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;App&lt;/em&gt; authenticates the user by consulting with Auth0.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;App&lt;/em&gt; loads documents into the &lt;em&gt;vector store&lt;/em&gt;. public-doc.md holds the relative info to the user.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;App&lt;/em&gt; instantiates the  &lt;em&gt;Agent&lt;/em&gt; then binds the &lt;em&gt;Retriever&lt;/em&gt; and do  &lt;a href="https://js.langchain.com/docs/concepts/tool_calling" rel="noopener noreferrer"&gt;tool calling&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Retriever&lt;/em&gt; first consults the FGA powered by Auth0 and checks relationship of the user with the file name.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Retriever&lt;/em&gt; then retrieves the relevant documents from the vector store.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Agent&lt;/em&gt; then prompts the &lt;em&gt;Model&lt;/em&gt; .&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;App&lt;/em&gt; returns the chat history rendered as HTML.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Since this architecture is aimed for this challenge, the &lt;a href="https://python.langchain.com/docs/tutorials/rag/#indexing" rel="noopener noreferrer"&gt;indexing context&lt;/a&gt; might be different from the real world. &lt;/p&gt;

&lt;p&gt;Service runs on &lt;a href="https://www.digitalocean.com/products/app-platform" rel="noopener noreferrer"&gt;Digitalocean App platform&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/yuwtennis/auth0-for-ai-agents" rel="noopener noreferrer"&gt;Github codebase&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I have prepared two entities (person)&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;User&lt;/th&gt;
&lt;th&gt;Password&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="mailto:john.doe@test.com"&gt;john.doe@test.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;john123!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href="mailto:joe.shmoe@test.com"&gt;joe.shmoe@test.com&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;joes123!&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Feel free to login from the login page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://lionfish-app-2tsho.ondigitalocean.app/login" rel="noopener noreferrer"&gt;https://lionfish-app-2tsho.ondigitalocean.app/login&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%2Fk5xx4n85s0vw2knh3jjs.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%2Fk5xx4n85s0vw2knh3jjs.png" alt="login page" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Then access the page which calls the agent.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://lionfish-app-2tsho.ondigitalocean.app/agent/call" rel="noopener noreferrer"&gt;https://lionfish-app-2tsho.ondigitalocean.app/agent/call&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will see that &lt;code&gt;john.doe&lt;/code&gt; will properly receive the answer &lt;strong&gt;including the relative information&lt;/strong&gt; from the agent.&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%2F3zsb0cetez6ntic4fi4v.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%2F3zsb0cetez6ntic4fi4v.png" alt="john.doe result" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But the &lt;code&gt;joe.smith&lt;/code&gt; will not get the right answer.&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%2Fzc3v56az5tlke91eppf5.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%2Fzc3v56az5tlke91eppf5.png" alt="joe.smith result" width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Logout from session after you are done.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://lionfish-app-2tsho.ondigitalocean.app/logout" rel="noopener noreferrer"&gt;https://lionfish-app-2tsho.ondigitalocean.app/logout&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%2F0cej5gs8qeyzem8px03s.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%2F0cej5gs8qeyzem8px03s.png" alt="logout page" width="800" height="388"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;The essence here is that to deliver &lt;strong&gt;the right user experience&lt;/strong&gt; per user , I have used &lt;strong&gt;Auth0&lt;/strong&gt; for &lt;em&gt;authentication&lt;/em&gt; and &lt;strong&gt;Auth0 FGA&lt;/strong&gt; for the &lt;em&gt;authorization&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Users are managed by the Auth0 platform.&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%2Fclofk161p0aheqbq26cq.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%2Fclofk161p0aheqbq26cq.png" alt="Auth0" width="800" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The catch here is that only &lt;code&gt;user:john.smith@test.com&lt;/code&gt; (object) has relation with the &lt;code&gt;document:public-doc&lt;/code&gt; (resource)&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%2Fd1gk3lsekg8s0xvirsfn.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%2Fd1gk3lsekg8s0xvirsfn.png" alt="FGA modeling" width="765" height="661"&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%2F7g7j3ynchsia32h85iuc.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%2F7g7j3ynchsia32h85iuc.png" alt="FGA tuples" width="749" height="246"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;This was my first time doing frontend activities for a specific problem. So I learned a lot. I would like to list few points.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The speed toward the outcome. There are excellent tools and services for both sustainability and effectiveness. e.g. terraform, full managed service, sdk, etc .&lt;/li&gt;
&lt;li&gt;Downside was took time for me to get the right package dependency. &lt;a href="https://auth0.com/ai/docs/get-started/authorization-for-rag#install-dependencies-4" rel="noopener noreferrer"&gt;The quick start&lt;/a&gt; did not work out-of-the-box for me.&lt;/li&gt;
&lt;li&gt;Learning curve might be high. My environment required explicit configuration for client for the &lt;em&gt;FGARetriever&lt;/em&gt; . I had to go all the way to &lt;a href="https://github.com/auth0/auth0-ai-js/blob/main/packages/ai-langchain/src/RAG/index.ts#L79" rel="noopener noreferrer"&gt;the codebase&lt;/a&gt; to get the right info. I could not find the API doc for &lt;code&gt;@auth0/ai-langchain&lt;/code&gt;. ChatGPT did not work for me.&lt;/li&gt;
&lt;li&gt;I would like to know the right message to notify the user for smooth UX in case of in appropriate permission.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you very much for the opportunity !&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>auth0challenge</category>
      <category>ai</category>
      <category>authentication</category>
    </item>
    <item>
      <title>Starting a continuous deployment</title>
      <dc:creator>Yu Watanabe</dc:creator>
      <pubDate>Sun, 06 Apr 2025 15:17:11 +0000</pubDate>
      <link>https://dev.to/yuwtennis/starting-a-continuous-deployment-27ng</link>
      <guid>https://dev.to/yuwtennis/starting-a-continuous-deployment-27ng</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/pulumi"&gt;Pulumi Deploy and Document Challenge&lt;/a&gt;: Shhh, It's a Secret!&lt;/em&gt;&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Live Demo Link
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Project Repo
&lt;/h2&gt;

&lt;h2&gt;
  
  
  My Journey
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Using Pulumi ESC
&lt;/h2&gt;

</description>
      <category>devchallenge</category>
      <category>pulumichallenge</category>
      <category>webdev</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
