Intent Agent is a highly secure, Next.js-based AI assistant that acts as a broker for external SaaS applications (like Gmail, GitHub, and Slack).
Traditionally, AI agents require raw, long-lived API keys to interact with third-party services—a massive security risk. Intent Agent solves this by utilizing the Auth0 Token Vault to manage scoped, time-limited tokens, and implements a rigorous Step-Up Authentication engine to explicitly gate destructive actions.
The agent never sees raw credentials or refresh tokens. Users connect their third-party accounts via Auth0. When a specific tool needs to be executed, the backend securely exchanges the user's Auth0 session for a temporary, scoped provider token using @auth0/ai-vercel.
Not all AI actions carry the same risk. Reading an email is safe; sending an email or deleting a repository is dangerous.
- The Engine: We built a custom interception engine in the backend API.
- The Flow: If the AI attempts a destructive action, execution is immediately paused. A cryptographic request is saved to a local SQLite database (
data/intent-agent.db), and the frontend is notified. - The UI: The user is prompted with a Step-Up Authentication Modal to explicitly approve or deny the action before the backend consumes the database ticket and allows the tool to execute.
Before any action is taken, the user's vague prompt is compiled into a structured specification. The UI displays exactly which OAuth scopes and services the agent intends to use, allowing the user to catch misunderstandings before execution.
- Indirect Prompt Injection Mitigation: Aggressive sanitization of external API responses. LLM control tokens are stripped out to prevent malicious data (e.g., a malicious email) from hijacking the agent's instructions.
- Auth0 Bypass Protection: API routes strictly validate the Auth0 session, preventing unauthorized users from abusing the server's LLM API keys.
A built-in toggle allowing developers and reviewers to safely test the UI, AI chat capabilities, and simulated tool calls without needing to configure complex Auth0 tenants or expose production API keys.
- Frontend: React, Next.js (App Router), Tailwind CSS
- Authentication:
@auth0/nextjs-auth0 - AI Engine: Vercel AI SDK (
ai),@ai-sdk/groq(Llama 3) - Security Broker:
@auth0/ai-vercel(Token Vault) - Database (Step-Up tracking): SQLite via
better-sqlite3
Follow these steps to run the Intent Agent locally on your machine.
git clone https://github.com/AliZafar780/intent-agent.git
cd intent-agentnpm install
# or
yarn installCopy the example environment file:
cp .env.example .env.localOpen .env.local and configure your keys.
For Demo Mode (Quickstart): You only need an LLM API key to test the UI and chat functionality.
DEMO_MODE=true
GROQ_API_KEY=gsk_your_groq_api_keyFor Production Mode (Full Auth0 Setup):
Set DEMO_MODE=false and configure your Auth0 application:
AUTH0_DOMAIN=your-tenant.auth0.com
AUTH0_CLIENT_ID=your-client-id
AUTH0_CLIENT_SECRET=your-client-secret
AUTH0_SECRET=a-32-character-random-string
AUTH0_AUDIENCE=https://your-api-audience
AUTH0_CUSTOM_API_CLIENT_ID=your-m2m-client-id
AUTH0_CUSTOM_API_CLIENT_SECRET=your-m2m-client-secret
GROQ_API_KEY=gsk_your_groq_api_keynpm run dev
# or
yarn devOpen http://localhost:3000 in your browser.
The easiest way to deploy this application is using Vercel:
- Go to Vercel.com and log in.
- Click Add New... > Project.
- Import your
intent-agentrepository from GitHub. - Open the Environment Variables section and add all the required variables from your
.env.localfile. - Click Deploy.
(Note: For production, ensure your Auth0 dashboard Callback URLs and Logout URLs are updated to point to your new Vercel domain).
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License.