Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
title: Secure Human-in-the-Loop Approvals
description: Learn how Auth0 for AI Agents enables AI agents to asynchronously authorize users.
sidebarTitle: Secure HITL Approvals
tocs: true
---

import UsingAI from "/snippets/common/using-ai.mdx";
import { AIContainer } from "/snippets/common/ai-container.jsx";
import { DownloadQuickstartButton } from "/snippets/download-quickstart/DownloadQuickstartButton.jsx";

{/* `GettingStartedTocs` requires `CustomTocs` to be imported */}
import { CustomTocs } from "/snippets/common/tocs.mdx";
import { GettingStartedTocs } from "/snippets/common/getting-started-tocs.mdx";

{/* `Prerequisites` requires `AccountAndAppSteps` to be imported */}
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
import { Prerequisites } from "/snippets/get-started/prerequisites/call-your-api.jsx";

import LangChainAsyncAuth from "/snippets/get-started/langchain-next-js/async-auth.mdx";
import LangChainFastAPIAsyncAuth from "/snippets/get-started/langchain-fastapi-py/async-auth.mdx";

Auth0 for AI Agents enables AI agents to asynchronously authorize users using the [Client-Initiated Backchannel Authentication Flow (CIBA)](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow). AI agents can work in the background, only notifying the user when needed for critical actions.

When you add secure [human-in-the-loop approvals](https://sdk.vercel.ai/cookbook/next/human-in-the-loop) to your AI agent workflows, you can use Auth0 to request the user's permission to complete an authorization request. The AI agent can render [rich authorization data](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba) in the consent prompt so the user knows exactly what they're authorizing.

By the end of this quickstart, you should have an AI agent integrated with the [Auth0 AI SDK](https://github.com/auth0-lab/auth0-ai-js) that can request to buy products from an online shop on the user's behalf.

<Card
title="What you’ll learn"
>
- **Async Authorization**: Use CIBA to let AI agents get user consent securely in the background.
- **User Approvals**: Add Auth0 AI SDK for clear, human-in-the-loop authorization.
</Card>

<Prerequisites />

<Tabs>
<Tab
title="Next.js"
icon="/img/nextjs-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="asynchronous-authorization"
framework="langchain-next-js"
/>
<UsingAI />
</AIContainer>
<LangChainAsyncAuth />
</Tab>
<Tab
title="FastAPI"
icon="/img/fastapi-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="asynchronous-authorization"
framework="langchain-fastapi-py"
/>
<UsingAI />
</AIContainer>
<LangChainFastAPIAsyncAuth />
</Tab>
</Tabs>

<Panel>
<GettingStartedTocs
sections={[
{
title: "SDKs",
links: [
{ label: "Auth0-AI / LangChain / JS", href: "https://www.npmjs.com/package/@auth0/ai-langchain" },
{ label: "Auth0-AI / LangChain / Python", href: "https://github.com/auth0-lab/auth0-ai-python/tree/main/packages/auth0-ai-langchain" },
{ label: "NextJS-Auth0", href: "https://github.com/auth0/nextjs-auth0" }
]
},
{
title: "GitHub Samples",
links: [
{ label: "LangChain + NextJS", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/async-authorization/langchain-next-js" },
{ label: "LangChain + FastAPI", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/async-authorization/langchain-fastapi-py" }
]
},
{
title: "Learn more",
links: [
{ label: "User Authorization with CIBA", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba" },
{ label: "CIBA Flow", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow" },
{ label: "Configure RAR", href: "https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests" },
{ label: "Auth0 Guardian Android SDK", href: "https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk" },
{ label: "Auth0 Guardian iOS SDK", href: "https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk" }
]
}
]}
/>
</Panel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Asynchronous Authorization
description: 'Asynchronous Authorization provides a secure "human-in-the-loop" mechanism, allowing agents to work autonomously in the background and seek user consent for sensitive or critical actions only when necessary.'
toc: true
---

import Intro from "/snippets/intros/asynchronous-authorization.mdx";
import { CustomTocs } from "/snippets/common/tocs.mdx";
import { OverviewTocs } from "/snippets/common/overview-tocs.mdx";

<Intro />

<Panel>
<OverviewTocs
sections={[
{
title: "SDKs",
links: [
{ label: "Auth0-AI / LangChain / JS", href: "https://www.npmjs.com/package/@auth0/ai-langchain" },
{ label: "Auth0-AI / LangChain / Python", href: "https://github.com/auth0-lab/auth0-ai-python/tree/main/packages/auth0-ai-langchain" },
]
},
{
title: "Learn more",
links: [
{ label: "User Authorization with CIBA", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba" },
{ label: "CIBA Flow", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow" },
{ label: "Configure RAR", href: "https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests" }
]
}
]}
/>
</Panel>
10 changes: 10 additions & 0 deletions auth4genai/async-authorization/langgraph/intro/ciba-rar.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Understanding CIBA & RAR
description: This article explains how Auth0 supports asynchronous authorization using the Client-Initiated Backchannel Authentication (CIBA) standard, enhanced with Rich Authorization Requests (RAR)
sidebarTitle: CIBA & RAR Overview
toc: true
---

import Intro from "/snippets/intros/ciba-rar.mdx";

<Intro />
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
title: Secure Human-in-the-Loop Approvals
description: Learn how Auth0 for AI Agents enables AI agents to asynchronously authorize users.
sidebarTitle: Secure HITL Approvals
tocs: true
---

import UsingAI from "/snippets/common/using-ai.mdx";
import { AIContainer } from "/snippets/common/ai-container.jsx";
import { DownloadQuickstartButton } from "/snippets/download-quickstart/DownloadQuickstartButton.jsx";

{/* `GettingStartedTocs` requires `CustomTocs` to be imported */}
import { CustomTocs } from "/snippets/common/tocs.mdx";
import { GettingStartedTocs } from "/snippets/common/getting-started-tocs.mdx";

{/* `Prerequisites` requires `AccountAndAppSteps` to be imported */}
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
import { Prerequisites } from "/snippets/get-started/prerequisites/call-your-api.jsx";

import VercelAsyncAuth from "/snippets/get-started/vercel-ai-next-js/async-auth.mdx";
import VercelNodeAsyncAuth from "/snippets/get-started/vercel-ai-node-js/async-auth.mdx";

Auth0 for AI Agents enables AI agents to asynchronously authorize users using the [Client-Initiated Backchannel Authentication Flow (CIBA)](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow). AI agents can work in the background, only notifying the user when needed for critical actions.

When you add secure [human-in-the-loop approvals](https://sdk.vercel.ai/cookbook/next/human-in-the-loop) to your AI agent workflows, you can use Auth0 to request the user's permission to complete an authorization request. The AI agent can render [rich authorization data](https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba) in the consent prompt so the user knows exactly what they're authorizing.

By the end of this quickstart, you should have an AI agent integrated with the [Auth0 AI SDK](https://github.com/auth0-lab/auth0-ai-js) that can request to buy products from an online shop on the user's behalf.

<Card
title="What you’ll learn"
>
- **Async Authorization**: Use CIBA to let AI agents get user consent securely in the background.
- **User Approvals**: Add Auth0 AI SDK for clear, human-in-the-loop authorization.
</Card>

<Prerequisites />

<Tabs>
<Tab
title="Next.js"
icon="/img/nextjs-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="asynchronous-authorization"
framework="vercel-ai-next-js"
/>
<UsingAI />
</AIContainer>
<VercelAsyncAuth />
</Tab>
<Tab
title="Node.js"
icon="/img/node-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="asynchronous-authorization"
framework="vercel-ai-node-js"
/>
<UsingAI />
</AIContainer>
<VercelNodeAsyncAuth />
</Tab>
</Tabs>

<Panel>
<GettingStartedTocs
sections={[
{
title: "SDKs",
links: [
{ label: "Auth0-AI / AI SDK", href: "https://www.npmjs.com/package/@auth0/ai-vercel" },
{ label: "NextJS-Auth0", href: "https://github.com/auth0/nextjs-auth0" }
]
},
{
title: "GitHub Samples",
links: [
{ label: "AI SDK + NextJS", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/asynchronous-authorization/vercel-ai-next-js" },
{ label: "AI SDK + Node", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/asynchronous-authorization/vercel-ai-node-js" }
]
},
{
title: "Learn more",
links: [
{ label: "User Authorization with CIBA", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba" },
{ label: "CIBA Flow", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow" },
{ label: "Configure RAR", href: "https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests" },
{ label: "Auth0 Guardian Android SDK", href: "https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-android-sdk" },
{ label: "Auth0 Guardian iOS SDK", href: "https://auth0.com/docs/secure/multi-factor-authentication/auth0-guardian/guardian-for-ios-sdk" }
]
}
]}
/>
</Panel>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Asynchronous Authorization
description: 'Asynchronous Authorization provides a secure "human-in-the-loop" mechanism, allowing agents to work autonomously in the background and seek user consent for sensitive or critical actions only when necessary.'
toc: true
---

import Intro from "/snippets/intros/asynchronous-authorization.mdx";
import { CustomTocs } from "/snippets/common/tocs.mdx";
import { OverviewTocs } from "/snippets/common/overview-tocs.mdx";


<Intro />

<Panel>
<OverviewTocs
sections={[
{
title: "SDKs",
links: [
{ label: "Auth0 AI / AI SDK", href: "https://www.npmjs.com/package/@auth0/ai-vercel" }
]
},
{
title: "Learn more",
links: [
{ label: "User Authorization with CIBA", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow/user-authorization-with-ciba" },
{ label: "CIBA Flow", href: "https://auth0.com/docs/get-started/authentication-and-authorization-flow/client-initiated-backchannel-authentication-flow" },
{ label: "Configure RAR", href: "https://auth0.com/docs/get-started/apis/configure-rich-authorization-requests" }
]
}
]}
/>
</Panel>
10 changes: 10 additions & 0 deletions auth4genai/async-authorization/vercel-ai/intro/ciba-rar.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Understanding CIBA & RAR
description: This article explains how Auth0 supports asynchronous authorization using the Client-Initiated Backchannel Authentication (CIBA) standard, enhanced with Rich Authorization Requests (RAR)
sidebarTitle: CIBA & RAR Overview
toc: true
---

import Intro from "/snippets/intros/ciba-rar.mdx";

<Intro />
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
title: Authorization for RAG
description: "Learn how Auth0 for AI Agents enables AI agents to implement fine-grained authorization for Retrieval Augmented Generation (RAG)."
toc: true
---

import UsingAI from "/snippets/common/using-ai.mdx";
import { AIContainer } from "/snippets/common/ai-container.jsx";
import { DownloadQuickstartButton } from "/snippets/download-quickstart/DownloadQuickstartButton.jsx";

{/* `GettingStartedTocs` requires `CustomTocs` to be imported */}
import { CustomTocs } from "/snippets/common/tocs.mdx";
import { GettingStartedTocs } from "/snippets/common/getting-started-tocs.mdx";

{/* `Prerequisites` requires `AccountAndAppSteps` to be imported */}
import { AccountAndAppSteps } from "/snippets/get-started/prerequisites/account-app-steps.jsx";
import { Prerequisites } from "/snippets/get-started/prerequisites/call-your-api.jsx";


import LangChainNextjsAuthForRag from "/snippets/get-started/langchain-next-js/auth-for-rag.mdx";
import LangChainNodejsAuthForRag from "/snippets/get-started/langchain-node-js/auth-for-rag.mdx";
import LangChainFastapiAuthForRag from "/snippets/get-started/langchain-fastapi-py/auth-for-rag.mdx";
import LangChainPythonAuthForRag from "/snippets/get-started/langchain-py/auth-for-rag.mdx";

Auth0 for AI Agents leverages [Auth0 FGA](https://auth0.com/fine-grained-authorization) to provide fine-grained authorization control for AI agents. As a result, when AI agents use Retrieval Augmented Generation (RAG) to provide sophisticated, relevant responses to user queries, they only have access to authorized data.

<Card
title="What you’ll learn"
>
- **Auth Control**: Apply FGA for precise data access in RAG.
- **Secure Retrieval**: Limit AI to authorized data only.
</Card>

<Prerequisites />

<Tabs>
<Tab
title="Next.js"
icon="/img/nextjs-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="authorization-for-rag"
framework="langchain-next-js"
/>
<UsingAI />
</AIContainer>
<LangChainNextjsAuthForRag />
</Tab>
<Tab
title="FastAPI"
icon="/img/fastapi-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="authorization-for-rag"
framework="langchain-fastapi-py"
/>
<UsingAI />
</AIContainer>
<LangChainFastapiAuthForRag />
</Tab>
<Tab
title="Node.js"
icon="/img/node-light.svg"
>
<AIContainer>
<DownloadQuickstartButton
category="authorization-for-rag"
framework="langgraph-agentic-js"
/>
<UsingAI />
</AIContainer>
<LangChainNodejsAuthForRag />
</Tab>
<Tab
title="Python"
icon="/img/python-light.svg"
>
<LangChainPythonAuthForRag />
</Tab>
</Tabs>

<Panel>
<GettingStartedTocs
sections={[
{
title: "SDKs",
links: [
{ label: "Auth0-AI / LangChain / JS", href: "https://www.npmjs.com/package/@auth0/ai-langchain" },
{ label: "Auth0-AI / LangChain / Python", href: "https://github.com/auth0-lab/auth0-ai-python/tree/main/packages/auth0-ai-langchain" },
]
},
{
title: "GitHub Samples",
links: [
{ label: "LangChain + NextJS", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/authorization-for-rag/langchain-next-js" },
{ label: "LangChain + FastAPI", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/authorization-for-rag/langchain-fastapi-py" },
{ label: "LangChain + Node", href: "https://github.com/auth0-samples/auth0-ai-samples/tree/main/authorization-for-rag/langgraph-agentic-js" }
]
},
{
title: "Learn more",
links: [
{ label: "Auth0 FGA Documentation", href: "https://docs.fga.dev/" },
{ label: "Auth0 FGA Getting Started", href: "https://docs.fga.dev/getting-started" },
{ label: "OpenFGA Documentation", href: "https://openfga.dev/" }
]
}
]}
/>
</Panel>
Loading