Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

feat(agent-vault): add product intro modal (#8141)

Saif Ur Rahman792db4694c0c
diff --git a/frontend/src/assets/images/agent-vault-intro.png b/frontend/src/assets/images/agent-vault-intro.png
new file mode 100644
index 0000000000..5b9479242d
Binary files /dev/null and b/frontend/src/assets/images/agent-vault-intro.png differ
diff --git a/frontend/src/components/agent-vault/AgentVaultIntro/AgentVaultIntroModal.tsx b/frontend/src/components/agent-vault/AgentVaultIntro/AgentVaultIntroModal.tsx
new file mode 100644
index 0000000000..5afa1363a6
--- /dev/null
+++ b/frontend/src/components/agent-vault/AgentVaultIntro/AgentVaultIntroModal.tsx
@@ -0,0 +1,85 @@
+import { ExternalLink, XIcon } from "lucide-react";
+
+import introDiagram from "@app/assets/images/agent-vault-intro.png";
+import { PreviewBadge } from "@app/components/agent-vault/PreviewBadge";
+import {
+ Dialog,
+ DialogClose,
+ DialogContent,
+ DialogDescription,
+ DialogHeader,
+ DialogTitle,
+ IconButton
+} from "@app/components/v3";
+import { ProjectType } from "@app/hooks/api/projects/types";
+import { AgentVaultDocsUrls } from "@app/pages/agent-vault/agent-vault-docs-urls";
+
+const PARAGRAPHS = [
+ "Run AI agents with the access, context, and capabilities they need to do work. Today that means secure access to the services they call: LLM providers, GitHub, Slack, and more.",
+ "You describe what an agent may reach in an access bundle and grant it to whoever runs agents. They create a session to launch with, and a proxy in your network attaches the real credential on the way out, only for the services you allowed and only until the session expires."
+];
+
+const LINKS = [
+ { label: "Documentation", href: AgentVaultDocsUrls.overview },
+ { label: "Quickstart", href: AgentVaultDocsUrls.quickstart }
+];
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
+};
+
+export const AgentVaultIntroModal = ({ isOpen, onOpenChange }: Props) => (
+ <Dialog open={isOpen} onOpenChange={onOpenChange}>
+ <DialogContent
+ className="max-w-xl gap-0 p-0"
+ showCloseButton={false}
+ onOpenAutoFocus={(event) => {
+ // PreviewBadge is focusable so keyboard users can reach its tooltip, which also makes it
+ // the first focusable child here. Radix would autofocus it on open and the tooltip would
+ // appear with nobody hovering, so hold focus on the dialog itself.
+ event.preventDefault();
+ (event.currentTarget as HTMLElement).focus({ preventScroll: true });
+ }}
+ >
+ <img
+ src={introDiagram}
+ alt="An agent picks up a request from Slack and calls out through the Agent Proxy, which checks policy, brokers the credential from Agent Vault, and forwards the call to Anthropic, Sentry and GitHub."
+ className="aspect-video w-full border-b border-border bg-black object-contain"
+ />
+ <div className="flex flex-col gap-4 p-6">
+ <DialogHeader className="flex-row items-center gap-2">
+ <DialogTitle>Introducing Agent Vault</DialogTitle>
+ <PreviewBadge type={ProjectType.AgentVault} />
+ </DialogHeader>
+ <DialogDescription className="whitespace-pre-line">
+ {PARAGRAPHS.join("\n\n")}
+ </DialogDescription>
+ <div className="flex flex-wrap items-center gap-x-6 gap-y-2">
+ {LINKS.map(({ label, href }) => (
+ <a
+ key={label}
+ href={href}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="inline-flex items-center gap-1.5 text-sm text-foreground underline outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {label}
+ <ExternalLink className="size-3.5 shrink-0" />
+ </a>
+ ))}
+ </div>
+ </div>
+ <DialogClose asChild>
+ <IconButton
+ aria-label="Close"
+ variant="ghost"
+ size="xs"
+ className="absolute top-3 right-3 bg-popover/80 backdrop-blur-sm hover:bg-container-hover"
+ >
+ <XIcon />
+ </IconButton>
+ </DialogClose>
+ </DialogContent>
+ </Dialog>
+);
diff --git a/frontend/src/components/agent-vault/AgentVaultIntro/index.ts b/frontend/src/components/agent-vault/AgentVaultIntro/index.ts
new file mode 100644
index 0000000000..803d74ee46
--- /dev/null
+++ b/frontend/src/components/agent-vault/AgentVaultIntro/index.ts
@@ -0,0 +1,2 @@
+export { AgentVaultIntroModal } from "./AgentVaultIntroModal";
+export { useAgentVaultIntro } from "./useAgentVaultIntro";
diff --git a/frontend/src/components/agent-vault/AgentVaultIntro/useAgentVaultIntro.ts b/frontend/src/components/agent-vault/AgentVaultIntro/useAgentVaultIntro.ts
new file mode 100644
index 0000000000..feed0b4efd
--- /dev/null
+++ b/frontend/src/components/agent-vault/AgentVaultIntro/useAgentVaultIntro.ts
@@ -0,0 +1,32 @@
+import { useCallback } from "react";
+
+import { useLocalStorageState } from "@app/hooks";
+
+// Bump after a rewrite worth putting back in front of people who already dismissed the old one.
+const INTRO_VERSION = "agent-vault-v1";
+
+const STORAGE_KEY = "seenProductIntros";
+const PRODUCT_KEY = "agent-vault";
+
+type TSeenProductIntros = Record<string, string | undefined>;
+
+// Stable identity: useLocalStorageState re-runs its seeding effect whenever this changes.
+const NOTHING_SEEN: TSeenProductIntros = {};
+
+// Dismissal is the only state there is: reopening is forgetting it, which is how the sidebar and
+// the layout drive one dialog between them without sharing anything else.
+export const useAgentVaultIntro = () => {
+ const [seen, setSeen] = useLocalStorageState<TSeenProductIntros>(STORAGE_KEY, NOTHING_SEEN);
+
+ const setOpen = useCallback(
+ (isOpen: boolean) => {
+ setSeen((current) => ({
+ ...current,
+ [PRODUCT_KEY]: isOpen ? undefined : INTRO_VERSION
+ }));
+ },
+ [setSeen]
+ );
+
+ return { isOpen: seen?.[PRODUCT_KEY] !== INTRO_VERSION, setOpen };
+};
diff --git a/frontend/src/layouts/AgentVaultLayout/AgentVaultLayout.tsx b/frontend/src/layouts/AgentVaultLayout/AgentVaultLayout.tsx
index 771ef42c97..ae5d4d5585 100644
--- a/frontend/src/layouts/AgentVaultLayout/AgentVaultLayout.tsx
+++ b/frontend/src/layouts/AgentVaultLayout/AgentVaultLayout.tsx
@@ -1,15 +1,21 @@
import { Outlet } from "@tanstack/react-router";
+import {
+ AgentVaultIntroModal,
+ useAgentVaultIntro
+} from "@app/components/agent-vault/AgentVaultIntro";
import { useProjectPermission } from "@app/context";
import { AssumePrivilegeModeBanner } from "../ProjectLayout/components/AssumePrivilegeModeBanner";
export const AgentVaultLayout = () => {
const { assumedPrivilegeDetails } = useProjectPermission();
+ const { isOpen, setOpen } = useAgentVaultIntro();
return (
<>
{assumedPrivilegeDetails && <AssumePrivilegeModeBanner />}
+ <AgentVaultIntroModal isOpen={isOpen} onOpenChange={setOpen} />
<Outlet />
</>
);
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
index c5fb4be733..7ebc849cf4 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
@@ -1,6 +1,12 @@
-import { FileText, IdCard, Package, Route, Shield } from "lucide-react";
+import { FileText, IdCard, Info, Package, Route, Shield } from "lucide-react";
-import { SidebarCollapsibleGroup } from "@app/components/v3";
+import { useAgentVaultIntro } from "@app/components/agent-vault/AgentVaultIntro";
+import {
+ SidebarCollapsibleGroup,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem
+} from "@app/components/v3";
import { useProjectPermission } from "@app/context";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
@@ -9,6 +15,7 @@ import type { NavItem, Submenu } from "./types";
export const AgentVaultNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Submenu) => void }) => {
const { hasProjectRole } = useProjectPermission();
+ const { setOpen: setIsIntroOpen } = useAgentVaultIntro();
const isAdmin = hasProjectRole(ProjectMembershipRole.Admin);
const accessItems: NavItem[] = [
@@ -41,6 +48,20 @@ export const AgentVaultNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Subm
<SidebarCollapsibleGroup label="Infrastructure">
<ProjectNavList items={infrastructureItems} onSubmenuOpen={onSubmenuOpen} />
</SidebarCollapsibleGroup>
+ <SidebarMenu className="mt-auto">
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ size="lg"
+ closeOnMobile
+ tooltip="About Agent Vault"
+ className="text-xs text-muted [&_svg]:size-3.5"
+ onClick={() => setIsIntroOpen(true)}
+ >
+ <Info className="mb-px" />
+ <span>About Agent Vault</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ </SidebarMenu>
</>
);
};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
index b85015e012..d50ab97fbd 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/ProjectNav.tsx
@@ -137,12 +137,13 @@ export const ProjectNav = () => {
) : (
<motion.div
key="main"
+ className="flex flex-1 flex-col"
initial={{ x: -30, opacity: 0 }}
animate={{ x: 0, opacity: 1 }}
exit={{ x: -30, opacity: 0 }}
transition={{ duration: 0.11, ease: "easeOut" }}
>
- <SidebarGroup>
+ <SidebarGroup className="flex-1">
<SidebarGroupLabel asChild>
<button
className="cursor-pointer hover:bg-foreground/[0.025]"