Skip to content

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

feat(agent-vault): guided setup checklist and a sample session

Scott Wilson969a55bba921
diff --git a/frontend/AGENTS.md b/frontend/AGENTS.md
index b1db5dfe2d..940c7acfda 100644
--- a/frontend/AGENTS.md
+++ b/frontend/AGENTS.md
@@ -104,6 +104,8 @@ PAM and Agent Vault live at `/organizations/$orgId/<slug>` over a single implici
A new org-scoped product therefore needs: a `<product>ProjectId` on the `Organization` type, an entry in `ORG_SCOPED_PRODUCT_TYPES` and `getOrgScopedProductFromPath` (`helpers/project.ts`), and a layout `beforeLoad` that bootstraps the id, patches it into the cached org, and returns both `implicitProjectId` and `implicitProductType` (see `pages/agent-vault/layout.tsx`). Use `isOrgScopedProduct(type)` rather than adding another pathname check; the sidebar, navbar, project switcher and nav links all key off it.
+Agent Vault onboards admins through one progress source, `useAgentVaultSetupProgress` (`components/agent-vault/SetupChecklist`): proxy connected, access bundle, service, session. The sidebar checklist and the product's index route (`redirects/agent-vault-index-redirect.tsx`, which opens on the first unfinished step) both read it, so link into Agent Vault through `/organizations/$orgId/agent-vault`, not straight to a page. A checklist step only navigates; the page it lands on opens its own create dialog or sheet through `useAgentVaultCreateIntent` and a `?create=true` flag the page clears, so give any new step's page that hook rather than a dialog in the checklist. The Sessions page shows a hard-coded sample session (`SampleSessionSheet`) until the org has a real one.
+
Certificate Manager is org-scoped too (`/organizations/$orgId/cert-manager/...`), but legacy orgs can hold several instances, so its layout resolves the project from instance state instead of an org field, through `resolveCertManagerProjectId` (`helpers/certManagerActiveProject.ts`): the `infisical-cm-active-project-<orgId>` cookie while the user is a member of that instance, else the active instance. The product switcher and the 403 page use the same helper. The layout writes the resolved id back to the cookie, because `inject-cert-manager-project-id.ts` resolves requests that name no project from it, and reloads the page when the resolved instance changes within one page load, since several cert-manager queries are not keyed by project. Consequences: anything that sends someone into a *specific* instance (the instance picker, a project-scoped identity row, a gateway's discovery row) sets that cookie first, since the URL can't say which; old `/projects/cert-manager/$projectId/...` URLs (emails and alerts sent before the move, bookmarks; the backend now links to `/cert-manager/...`, except legacy PKI Alerts V2 and the legacy-deprecation email) go through `redirects/cert-manager-project-url-redirect.tsx`, which pins the named instance and strips the id. In multi-instance orgs each tab also tags its Certificate Manager API requests with the instance it shows (`setTabCertManagerProjectId`, read by the `apiRequest` interceptor), because the cookie is shared across tabs; single-instance orgs send no project id. Shared views that pick project vs org scope from the URL use `useRouteProjectId()`, which also returns Certificate Manager's implicit project.
### Single-project products
diff --git a/frontend/src/components/agent-vault/AccessBundleFormDialog.tsx b/frontend/src/components/agent-vault/AccessBundleFormDialog.tsx
index 6b889d742c..20a0ff0a99 100644
--- a/frontend/src/components/agent-vault/AccessBundleFormDialog.tsx
+++ b/frontend/src/components/agent-vault/AccessBundleFormDialog.tsx
@@ -38,9 +38,15 @@ type Props = {
isOpen: boolean;
onOpenChange: (isOpen: boolean) => void;
accessBundle?: TAgentVaultAccessBundle;
+ onCreated?: (accessBundle: TAgentVaultAccessBundle) => void;
};
-export const AccessBundleFormDialog = ({ isOpen, onOpenChange, accessBundle }: Props) => {
+export const AccessBundleFormDialog = ({
+ isOpen,
+ onOpenChange,
+ accessBundle,
+ onCreated
+}: Props) => {
const createAccessBundle = useCreateAgentVaultAccessBundle();
const updateAccessBundle = useUpdateAgentVaultAccessBundle();
const isUpdate = Boolean(accessBundle);
@@ -60,6 +66,7 @@ export const AccessBundleFormDialog = ({ isOpen, onOpenChange, accessBundle }: P
const onSubmit = async ({ name, description }: FormData) => {
try {
+ let createdAccessBundle: TAgentVaultAccessBundle | undefined;
if (accessBundle) {
await updateAccessBundle.mutateAsync({
accessBundleId: accessBundle.id,
@@ -67,7 +74,10 @@ export const AccessBundleFormDialog = ({ isOpen, onOpenChange, accessBundle }: P
description: description || null
});
} else {
- await createAccessBundle.mutateAsync({ name, description: description || undefined });
+ createdAccessBundle = await createAccessBundle.mutateAsync({
+ name,
+ description: description || undefined
+ });
}
createNotification({
@@ -75,6 +85,7 @@ export const AccessBundleFormDialog = ({ isOpen, onOpenChange, accessBundle }: P
type: "success"
});
onOpenChange(false);
+ if (createdAccessBundle) onCreated?.(createdAccessBundle);
} catch {
// A failed request returns a 4xx that the global request handler surfaces as a toast
}
diff --git a/frontend/src/components/agent-vault/SetupChecklist/SetupChecklist.tsx b/frontend/src/components/agent-vault/SetupChecklist/SetupChecklist.tsx
new file mode 100644
index 0000000000..f74a0f5fc8
--- /dev/null
+++ b/frontend/src/components/agent-vault/SetupChecklist/SetupChecklist.tsx
@@ -0,0 +1,166 @@
+import { useLocation, useNavigate } from "@tanstack/react-router";
+import { CheckIcon, XIcon } from "lucide-react";
+import { twMerge } from "tailwind-merge";
+
+import { IconButton, Tooltip, TooltipContent, TooltipTrigger } from "@app/components/v3";
+import { useOrganization } from "@app/context";
+
+import { useAgentVaultSetupProgress } from "./useAgentVaultSetupProgress";
+
+type Step = {
+ title: string;
+ description: string;
+ isComplete: boolean;
+ isBlocked?: boolean;
+ pathSuffix: string;
+ opensCreate?: boolean;
+};
+
+type Props = {
+ progress: ReturnType<typeof useAgentVaultSetupProgress>;
+};
+
+// Each step takes the admin to the page that owns the action and opens it there, so the page behind the
+// dialog is always the one they are setting up.
+export const SetupChecklist = ({ progress }: Props) => {
+ const navigate = useNavigate();
+ const { pathname } = useLocation();
+ const { currentOrg } = useOrganization();
+
+ const { hasProxy, hasConnectedProxy, newestBundle, hasService, hasSession, completedCount } =
+ progress;
+
+ const basePath = `/organizations/${currentOrg.id}/agent-vault`;
+ const isOn = (pathSuffix: string) => pathname === `${basePath}/${pathSuffix}`;
+
+ const steps: Step[] = [
+ {
+ title: "Set Up a Proxy",
+ description:
+ hasProxy && !hasConnectedProxy
+ ? "Waiting for your proxy to connect. Start it with its proxy token where agent traffic leaves your network."
+ : "Agents send requests through a proxy, which attaches the credentials.",
+ isComplete: hasConnectedProxy,
+ pathSuffix: "proxies",
+ opensCreate: !hasProxy
+ },
+ {
+ title: "Create an Access Bundle",
+ description: "A bundle groups the services an agent can reach.",
+ isComplete: Boolean(newestBundle),
+ pathSuffix: "access-bundles",
+ opensCreate: true
+ },
+ {
+ title: "Add a Service",
+ description: "Name an API the agent can call and the credential to attach.",
+ isComplete: hasService,
+ isBlocked: !newestBundle,
+ pathSuffix: newestBundle ? `access-bundles/${newestBundle.id}` : "access-bundles",
+ opensCreate: true
+ },
+ {
+ title: "Create a Session",
+ description: "Get a token an agent runs with.",
+ isComplete: hasSession,
+ isBlocked: !newestBundle,
+ pathSuffix: "sessions",
+ opensCreate: true
+ }
+ ];
+
+ // Replacing rather than pushing when already there, since the same URL again would duplicate the
+ // history entry.
+ const goTo = (step: Step) => {
+ const isHere = isOn(step.pathSuffix);
+ if (isHere && !step.opensCreate) return;
+ navigate({
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ to: `${basePath}/${step.pathSuffix}` as any,
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search: (step.opensCreate ? { create: true } : {}) as any,
+ replace: isHere
+ });
+ };
+
+ const nextIndex = steps.findIndex((step) => !step.isComplete && !step.isBlocked);
+
+ if (!progress.isVisible) return null;
+
+ return (
+ <div className="mx-2 mb-1 rounded-md border border-border bg-container p-3 group-data-[collapsible=icon]:hidden">
+ <div className="flex items-center gap-2">
+ <span className="flex-1 text-sm font-medium">Get Started</span>
+ <span className="text-xs text-muted">
+ {completedCount} of {steps.length}
+ </span>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <IconButton
+ variant="ghost"
+ size="xs"
+ className="-mr-1"
+ aria-label="Hide setup steps"
+ onClick={progress.dismiss}
+ >
+ <XIcon />
+ </IconButton>
+ </TooltipTrigger>
+ <TooltipContent side="right">Hide Setup Steps</TooltipContent>
+ </Tooltip>
+ </div>
+ <div
+ role="progressbar"
+ aria-label="Setup progress"
+ aria-valuemin={0}
+ aria-valuemax={steps.length}
+ aria-valuenow={completedCount}
+ className="mt-2 h-1 overflow-hidden rounded-full bg-border"
+ >
+ <div
+ className="h-full rounded-full bg-product-av transition-[width] duration-300"
+ style={{ width: `${(completedCount / steps.length) * 100}%` }}
+ />
+ </div>
+ <ol className="-mx-1.5 mt-2 flex flex-col">
+ {steps.map((step, index) => {
+ const isNext = index === nextIndex;
+ return (
+ <li key={step.title}>
+ <button
+ type="button"
+ disabled={step.isComplete || step.isBlocked}
+ onClick={() => goTo(step)}
+ className="flex w-full cursor-pointer items-start gap-2 rounded-sm px-1.5 py-1.5 text-left outline-none hover:bg-container-hover focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-default disabled:hover:bg-transparent"
+ >
+ <span
+ aria-hidden
+ className={twMerge(
+ "mt-px flex size-4 shrink-0 items-center justify-center rounded-full border text-[10px] leading-none [&_svg]:size-2.5",
+ step.isComplete && "border-success bg-success/10 text-success",
+ !step.isComplete && isNext && "border-product-av bg-product-av/15",
+ !step.isComplete && !isNext && "border-border text-muted"
+ )}
+ >
+ {step.isComplete ? <CheckIcon strokeWidth={3} /> : index + 1}
+ </span>
+ <span className="flex min-w-0 flex-col gap-0.5">
+ <span
+ className={twMerge(
+ "text-xs",
+ isNext ? "font-medium text-foreground" : "text-muted"
+ )}
+ >
+ <span className="sr-only">{step.isComplete ? "Done: " : "To do: "}</span>
+ {step.title}
+ </span>
+ {isNext && <span className="text-2xs text-muted">{step.description}</span>}
+ </span>
+ </button>
+ </li>
+ );
+ })}
+ </ol>
+ </div>
+ );
+};
diff --git a/frontend/src/components/agent-vault/SetupChecklist/index.ts b/frontend/src/components/agent-vault/SetupChecklist/index.ts
new file mode 100644
index 0000000000..7e7c87d957
--- /dev/null
+++ b/frontend/src/components/agent-vault/SetupChecklist/index.ts
@@ -0,0 +1,2 @@
+export { SetupChecklist } from "./SetupChecklist";
+export { useAgentVaultSetupProgress } from "./useAgentVaultSetupProgress";
diff --git a/frontend/src/components/agent-vault/SetupChecklist/useAgentVaultSetupProgress.ts b/frontend/src/components/agent-vault/SetupChecklist/useAgentVaultSetupProgress.ts
new file mode 100644
index 0000000000..bdb1702ec6
--- /dev/null
+++ b/frontend/src/components/agent-vault/SetupChecklist/useAgentVaultSetupProgress.ts
@@ -0,0 +1,66 @@
+import { useOrganization, useProjectPermission } from "@app/context";
+import { useLocalStorageState } from "@app/hooks";
+import {
+ AgentVaultSessionScope,
+ useListAgentVaultAccessBundles,
+ useListAgentVaultProxies,
+ useListAgentVaultSessions
+} from "@app/hooks/api/agentVault";
+import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+
+const DISMISSED_STORAGE_KEY = "agentVaultSetupChecklistDismissed";
+
+// Stable identity: useLocalStorageState re-runs its seeding effect whenever this changes.
+const NOTHING_DISMISSED: Record<string, boolean | undefined> = {};
+
+export const useAgentVaultSetupProgress = () => {
+ const { currentOrg } = useOrganization();
+ const { hasProjectRole } = useProjectPermission();
+ const isAdmin = hasProjectRole(ProjectMembershipRole.Admin);
+
+ const { data: proxies } = useListAgentVaultProxies({ limit: 20 });
+ const { data: newestBundles } = useListAgentVaultAccessBundles({
+ orderBy: "createdAt",
+ orderDirection: "desc",
+ limit: 1
+ });
+ const { data: fullestBundles } = useListAgentVaultAccessBundles({
+ orderBy: "serviceCount",
+ orderDirection: "desc",
+ limit: 1
+ });
+ const { data: sessions } = useListAgentVaultSessions({
+ scope: AgentVaultSessionScope.All,
+ limit: 1
+ });
+
+ const [dismissed, setDismissed] = useLocalStorageState(DISMISSED_STORAGE_KEY, NOTHING_DISMISSED);
+ const isDismissed = Boolean(dismissed?.[currentOrg.id]);
+
+ const isLoaded = Boolean(proxies && newestBundles && fullestBundles && sessions);
+ const hasProxy = (proxies?.totalCount ?? 0) > 0;
+ const hasConnectedProxy = Boolean(proxies?.proxies.some((proxy) => proxy.heartbeat));
+ const newestBundle = newestBundles?.accessBundles[0];
+ const hasService = (fullestBundles?.accessBundles[0]?.serviceCount ?? 0) > 0;
+ const hasSession = (sessions?.totalCount ?? 0) > 0;
+ const completedCount = [hasConnectedProxy, Boolean(newestBundle), hasService, hasSession].filter(
+ Boolean
+ ).length;
+
+ const isIncomplete = isAdmin && isLoaded && completedCount < 4;
+
+ return {
+ isAdmin,
+ isLoaded,
+ isVisible: isIncomplete && !isDismissed,
+ canRestore: isIncomplete && isDismissed,
+ dismiss: () => setDismissed((current) => ({ ...current, [currentOrg.id]: true })),
+ restore: () => setDismissed((current) => ({ ...current, [currentOrg.id]: undefined })),
+ hasProxy,
+ hasConnectedProxy,
+ newestBundle,
+ hasService,
+ hasSession,
+ completedCount
+ };
+};
diff --git a/frontend/src/components/auth/SignupCompleteStep.tsx b/frontend/src/components/auth/SignupCompleteStep.tsx
index c760d18268..947f82712b 100644
--- a/frontend/src/components/auth/SignupCompleteStep.tsx
+++ b/frontend/src/components/auth/SignupCompleteStep.tsx
@@ -84,7 +84,7 @@ export default function SignupCompleteStep({
return { to: "/organizations/$orgId/pam/access" as const, params: { orgId } };
}
if (target === ProjectType.AgentVault) {
- return { to: "/organizations/$orgId/agent-vault/sessions" as const, params: { orgId } };
+ return { to: "/organizations/$orgId/agent-vault" as const, params: { orgId } };
}
if (target !== ORG_OVERVIEW) {
const project = projects[target];
diff --git a/frontend/src/components/v3/platform/RootCommandMenu/RootCommandMenu.tsx b/frontend/src/components/v3/platform/RootCommandMenu/RootCommandMenu.tsx
index 8a6f90d20e..bb6cc7035a 100644
--- a/frontend/src/components/v3/platform/RootCommandMenu/RootCommandMenu.tsx
+++ b/frontend/src/components/v3/platform/RootCommandMenu/RootCommandMenu.tsx
@@ -194,7 +194,7 @@ const navigateToProject = (
});
case ProjectType.AgentVault:
return navigate({
- to: "/organizations/$orgId/agent-vault/sessions",
+ to: "/organizations/$orgId/agent-vault",
params: { orgId: project.orgId }
});
case ProjectType.KMS:
diff --git a/frontend/src/helpers/project.ts b/frontend/src/helpers/project.ts
index a20eb1215b..603943164f 100644
--- a/frontend/src/helpers/project.ts
+++ b/frontend/src/helpers/project.ts
@@ -210,7 +210,7 @@ export const getProjectHomePage = (type: ProjectType, environments: ProjectEnv[]
case ProjectType.PAM:
return "/organizations/$orgId/pam/access" as const;
case ProjectType.AgentVault:
- return "/organizations/$orgId/agent-vault/sessions" as const;
+ return "/organizations/$orgId/agent-vault" as const;
default:
return `/organizations/$orgId/projects/${type}/$projectId/overview` as const;
}
diff --git a/frontend/src/hooks/useAgentVaultCreateIntent.ts b/frontend/src/hooks/useAgentVaultCreateIntent.ts
new file mode 100644
index 0000000000..eb05ce7231
--- /dev/null
+++ b/frontend/src/hooks/useAgentVaultCreateIntent.ts
@@ -0,0 +1,34 @@
+import { useEffect } from "react";
+import { useNavigate, useSearch } from "@tanstack/react-router";
+import { z } from "zod";
+
+export const agentVaultCreateIntentSearchParams = z.object({
+ create: z.boolean().optional().catch(undefined)
+});
+
+// Long enough for the page to paint first, so the dialog doesn't land on top of a page nobody saw.
+const OPEN_DELAY_MS = 350;
+
+// Opens a page's create flow when a link asked for it with `?create=true`, then drops the flag so a
+// reload or a back navigation doesn't open it again.
+export const useAgentVaultCreateIntent = (open: () => void, isReady = true) => {
+ const navigate = useNavigate();
+ const shouldCreate = useSearch({
+ strict: false,
+ select: (search) => Boolean((search as { create?: boolean }).create)
+ });
+
+ useEffect(() => {
+ if (!shouldCreate || !isReady) return undefined;
+ const timer = setTimeout(() => {
+ open();
+ navigate({
+ to: ".",
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ search: ((prev: Record<string, unknown>) => ({ ...prev, create: undefined })) as any,
+ replace: true
+ });
+ }, OPEN_DELAY_MS);
+ return () => clearTimeout(timer);
+ }, [shouldCreate, isReady]);
+};
diff --git a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
index 5a97c6a3e8..c2dd17826c 100644
--- a/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
+++ b/frontend/src/layouts/OrganizationLayout/components/OrgSidebar/AgentVaultNav.tsx
@@ -1,6 +1,20 @@
-import { Braces, FileText, IdCard, Info, Package, Server, Settings, Shield } from "lucide-react";
+import {
+ Braces,
+ FileText,
+ IdCard,
+ Info,
+ ListChecks,
+ Package,
+ Server,
+ Settings,
+ Shield
+} from "lucide-react";
import { useAgentVaultIntro } from "@app/components/agent-vault/AgentVaultIntro";
+import {
+ SetupChecklist,
+ useAgentVaultSetupProgress
+} from "@app/components/agent-vault/SetupChecklist";
import {
SidebarCollapsibleGroup,
SidebarMenu,
@@ -30,6 +44,7 @@ export const AgentVaultNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Subm
// An admin can use any bundle, but the nav only nags about the ones granted to them.
const { data: grantedRequiringSetup } = useListGrantedAgentVaultAccessBundlesRequiringSetup();
const needsSetup = Boolean(grantedRequiringSetup?.totalCount);
+ const setupProgress = useAgentVaultSetupProgress();
const accessItems: NavItem[] = [
{ label: "Sessions", icon: IdCard, pathSuffix: "sessions" },
@@ -78,7 +93,22 @@ export const AgentVaultNav = ({ onSubmenuOpen }: { onSubmenuOpen: (submenu: Subm
<ProjectNavList items={administrationItems} onSubmenuOpen={onSubmenuOpen} />
</SidebarCollapsibleGroup>
)}
- <SidebarMenu className="mt-auto">
+ <div className="mt-auto" />
+ <SetupChecklist progress={setupProgress} />
+ <SidebarMenu>
+ {setupProgress.canRestore && (
+ <SidebarMenuItem>
+ <SidebarMenuButton
+ size="lg"
+ tooltip="Setup Steps"
+ className="text-xs text-muted [&_svg]:size-3.5"
+ onClick={setupProgress.restore}
+ >
+ <ListChecks className="mb-px" />
+ <span>Setup Steps</span>
+ </SidebarMenuButton>
+ </SidebarMenuItem>
+ )}
<SidebarMenuItem>
<SidebarMenuButton
size="lg"
diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/AgentVaultAccessBundleDetailPage.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/AgentVaultAccessBundleDetailPage.tsx
index 4801a52ca1..4ecf4ad3fc 100644
--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/AgentVaultAccessBundleDetailPage.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/AgentVaultAccessBundleDetailPage.tsx
@@ -5,6 +5,7 @@ import { Link, useNavigate, useParams } from "@tanstack/react-router";
import {
ChevronLeftIcon,
EllipsisIcon,
+ IdCardIcon,
PackageIcon,
PencilIcon,
TrashIcon,
@@ -33,10 +34,15 @@ import {
PageLoader
} from "@app/components/v3";
import { useOrganization, useProjectPermission } from "@app/context";
-import { useGetAgentVaultAccessBundle } from "@app/hooks/api/agentVault";
+import {
+ AgentVaultSessionScope,
+ useGetAgentVaultAccessBundle,
+ useListAgentVaultSessions
+} from "@app/hooks/api/agentVault";
import { TAgentVaultService } from "@app/hooks/api/agentVault/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+import { useAgentVaultCreateIntent } from "@app/hooks/useAgentVaultCreateIntent";
import { DeleteAccessBundleDialog } from "@app/pages/agent-vault/AgentVaultAccessBundlesPage/components/DeleteAccessBundleDialog";
import { ServicesCard } from "./components/ServicesCard";
@@ -58,12 +64,23 @@ export const AgentVaultAccessBundleDetailPage = () => {
const needsSetup = (accessBundle?.services ?? []).filter(
(service) => service.personalValues && !service.personalValues.isConfigured
);
+ const { data: sessions } = useListAgentVaultSessions({
+ scope: AgentVaultSessionScope.All,
+ limit: 1
+ });
const [isEditOpen, setIsEditOpen] = useState(false);
const [isManageAccessOpen, setIsManageAccessOpen] = useState(false);
const [isDeleteOpen, setIsDeleteOpen] = useState(false);
const [isServiceSheetOpen, setIsServiceSheetOpen] = useState(false);
const [serviceToEdit, setServiceToEdit] = useState<TAgentVaultService | null>(null);
+ useAgentVaultCreateIntent(
+ () => {
+ setServiceToEdit(null);
+ setIsServiceSheetOpen(true);
+ },
+ isAdmin && Boolean(accessBundle)
+ );
if (isPending) return <PageLoader />;
if (!accessBundle) {
@@ -154,6 +171,25 @@ export const AgentVaultAccessBundleDetailPage = () => {
</Alert>
)}
+ {isAdmin && accessBundle.services.length > 0 && sessions?.totalCount === 0 && (
+ <Alert variant="info" className="mb-6">
+ <IdCardIcon />
+ <AlertDescription>
+ <p>This bundle is ready. Create a session with it to give an agent access.</p>
+ <AlertAction>
+ <Button variant="outline" size="sm" asChild>
+ <Link
+ to="/organizations/$orgId/agent-vault/sessions"
+ params={{ orgId: currentOrg.id }}
+ >
+ Go to Sessions
+ </Link>
+ </Button>
+ </AlertAction>
+ </AlertDescription>
+ </Alert>
+ )}
+
<ServicesCard
accessBundleId={accessBundle.id}
onSetUp={setServiceToSetUp}
diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/ServicesCard.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/ServicesCard.tsx
index 2e9b89c3d4..727a1980f3 100644
--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/ServicesCard.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/ServicesCard.tsx
@@ -210,6 +210,12 @@ export const ServicesCard = ({
: "Try a different search term."}
</EmptyDescription>
</EmptyHeader>
+ {canManage && services.length === 0 && (
+ <Button variant="av" onClick={onAdd}>
+ <PlusIcon />
+ Add Service
+ </Button>
+ )}
</Empty>
</CardContent>
) : (
diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/route.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/route.tsx
index 42aa7d1118..ff1cc88daf 100644
--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/route.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/route.tsx
@@ -1,4 +1,7 @@
import { createFileRoute, linkOptions } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+
+import { agentVaultCreateIntentSearchParams } from "@app/hooks/useAgentVaultCreateIntent";
import { AgentVaultAccessBundleDetailPage } from "./AgentVaultAccessBundleDetailPage";
@@ -6,6 +9,7 @@ export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/agent-vault/_agent-vault-layout/access-bundles/$accessBundleId"
)({
component: AgentVaultAccessBundleDetailPage,
+ validateSearch: zodValidator(agentVaultCreateIntentSearchParams),
beforeLoad: ({ context, params }) => {
return {
breadcrumbs: [
diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/AgentVaultAccessBundlesPage.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/AgentVaultAccessBundlesPage.tsx
index b26c00e24a..49df7dac2f 100644
--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/AgentVaultAccessBundlesPage.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/AgentVaultAccessBundlesPage.tsx
@@ -72,6 +72,7 @@ import {
import { TAgentVaultAccessBundleListItem } from "@app/hooks/api/agentVault/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+import { useAgentVaultCreateIntent } from "@app/hooks/useAgentVaultCreateIntent";
import { AgentVaultDocsUrls } from "../agent-vault-docs-urls";
import { DeleteAccessBundleDialog } from "./components/DeleteAccessBundleDialog";
@@ -98,6 +99,7 @@ export const AgentVaultAccessBundlesPage = () => {
getUserTablePreference("agentVaultAccessBundlesTable", PreferenceKey.PerPage, 20)
);
const [isCreateOpen, setIsCreateOpen] = useState(false);
+ useAgentVaultCreateIntent(() => setIsCreateOpen(true), isAdmin);
const [bundleToEdit, setBundleToEdit] = useState<TAgentVaultAccessBundleListItem | null>(null);
const [bundleToDelete, setBundleToDelete] = useState<TAgentVaultAccessBundleListItem | null>(
null
@@ -240,6 +242,12 @@ export const AgentVaultAccessBundlesPage = () => {
<EmptyTitle>{emptyTitle}</EmptyTitle>
<EmptyDescription>{emptyDescription}</EmptyDescription>
</EmptyHeader>
+ {!isFiltered && isAdmin && (
+ <Button variant="av" onClick={() => setIsCreateOpen(true)}>
+ <PlusIcon />
+ Create Access Bundle
+ </Button>
+ )}
</Empty>
</CardContent>
) : (
@@ -440,7 +448,16 @@ export const AgentVaultAccessBundlesPage = () => {
)}
</Card>
- <AccessBundleFormDialog isOpen={isCreateOpen} onOpenChange={setIsCreateOpen} />
+ <AccessBundleFormDialog
+ isOpen={isCreateOpen}
+ onOpenChange={setIsCreateOpen}
+ onCreated={(accessBundle) =>
+ navigate({
+ to: "/organizations/$orgId/agent-vault/access-bundles/$accessBundleId",
+ params: { orgId: currentOrg.id, accessBundleId: accessBundle.id }
+ })
+ }
+ />
<AccessBundleFormDialog
isOpen={Boolean(bundleToEdit)}
onOpenChange={(isOpen) => {
diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/route.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/route.tsx
index 13a3e30833..a2afd779e2 100644
--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/route.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundlesPage/route.tsx
@@ -1,4 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+
+import { agentVaultCreateIntentSearchParams } from "@app/hooks/useAgentVaultCreateIntent";
import { AgentVaultAccessBundlesPage } from "./AgentVaultAccessBundlesPage";
@@ -6,6 +9,7 @@ export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/agent-vault/_agent-vault-layout/access-bundles/"
)({
component: AgentVaultAccessBundlesPage,
+ validateSearch: zodValidator(agentVaultCreateIntentSearchParams),
beforeLoad: ({ context }) => {
return { breadcrumbs: [...context.breadcrumbs, { label: "Access Bundles" }] };
}
diff --git a/frontend/src/pages/agent-vault/AgentVaultProxiesPage/AgentVaultProxiesPage.tsx b/frontend/src/pages/agent-vault/AgentVaultProxiesPage/AgentVaultProxiesPage.tsx
index b14c9c9c12..9363112e58 100644
--- a/frontend/src/pages/agent-vault/AgentVaultProxiesPage/AgentVaultProxiesPage.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultProxiesPage/AgentVaultProxiesPage.tsx
@@ -75,6 +75,7 @@ import {
import { TAgentVaultProxy, TAgentVaultProxyToken } from "@app/hooks/api/agentVault/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+import { useAgentVaultCreateIntent } from "@app/hooks/useAgentVaultCreateIntent";
import { AgentVaultDocsUrls } from "../agent-vault-docs-urls";
import { ProxyFormDialog } from "./components/ProxyFormDialog";
@@ -163,6 +164,7 @@ export const AgentVaultProxiesPage = () => {
const rotateProxyToken = useRotateAgentVaultProxyToken();
const [isCreateOpen, setIsCreateOpen] = useState(false);
+ useAgentVaultCreateIntent(() => setIsCreateOpen(true), isAdmin);
const [proxyToEdit, setProxyToEdit] = useState<TAgentVaultProxy | null>(null);
const [proxyToDelete, setProxyToDelete] = useState<TAgentVaultProxy | null>(null);
const [proxyToRevoke, setProxyToRevoke] = useState<TAgentVaultProxy | null>(null);
diff --git a/frontend/src/pages/agent-vault/AgentVaultProxiesPage/route.tsx b/frontend/src/pages/agent-vault/AgentVaultProxiesPage/route.tsx
index 4a4878db00..a48bf8761d 100644
--- a/frontend/src/pages/agent-vault/AgentVaultProxiesPage/route.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultProxiesPage/route.tsx
@@ -1,4 +1,7 @@
import { createFileRoute } from "@tanstack/react-router";
+import { zodValidator } from "@tanstack/zod-adapter";
+
+import { agentVaultCreateIntentSearchParams } from "@app/hooks/useAgentVaultCreateIntent";
import { AgentVaultProxiesPage } from "./AgentVaultProxiesPage";
@@ -6,6 +9,7 @@ export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/agent-vault/_agent-vault-layout/proxies"
)({
component: AgentVaultProxiesPage,
+ validateSearch: zodValidator(agentVaultCreateIntentSearchParams),
beforeLoad: ({ context }) => {
return { breadcrumbs: [...context.breadcrumbs, { label: "Proxies" }] };
}
diff --git a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/AgentVaultSessionsPage.tsx b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/AgentVaultSessionsPage.tsx
index a9a9ee948a..6ea7fd6ab3 100644
--- a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/AgentVaultSessionsPage.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/AgentVaultSessionsPage.tsx
@@ -85,12 +85,14 @@ import { AgentVaultSessionLogStorageType } from "@app/hooks/api/agentVault/enums
import { TAgentVaultMintedSession, TAgentVaultSession } from "@app/hooks/api/agentVault/types";
import { ProjectType } from "@app/hooks/api/projects/types";
import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+import { useAgentVaultCreateIntent } from "@app/hooks/useAgentVaultCreateIntent";
import { useAgentVaultSheetState } from "@app/hooks/useAgentVaultSheetState";
import { SessionLogReadAccessAlert } from "@app/pages/agent-vault/AgentVaultSettingsPage/components/SessionLogReadAccessAlert";
import { AgentVaultDocsUrls } from "../agent-vault-docs-urls";
import { CreateSessionDialog } from "./components/CreateSessionDialog";
import { RevokeSessionDialog } from "./components/RevokeSessionDialog";
+import { SampleSessionSheet, SampleSessionTable } from "./components/SampleSessionSheet";
import { SessionCreatedDialog } from "./components/SessionCreatedDialog";
import { SessionDetailSheet } from "./components/SessionDetailSheet";
import { SessionExpiry } from "./components/SessionExpiry";
@@ -128,6 +130,7 @@ export const AgentVaultSessionsPage = () => {
const [sessionToRevoke, setSessionToRevoke] = useState<TAgentVaultSession | null>(null);
const [isCreateDialogOpen, setIsCreateDialogOpen] = useState(false);
const [mintedSession, setMintedSession] = useState<TAgentVaultMintedSession | null>(null);
+ const [isSampleOpen, setIsSampleOpen] = useState(false);
const { sessionId: openSessionId, openSheet } = useAgentVaultSheetState();
const { data, isPending } = useListAgentVaultSessions({
@@ -164,6 +167,7 @@ export const AgentVaultSessionsPage = () => {
// off the live input would caption a stale result set.
const isFiltered = Boolean(debouncedSearch.trim()) || statuses.length > 0;
const hasReachableBundles = (accessBundles?.totalCount ?? 0) > 0;
+ useAgentVaultCreateIntent(() => setIsCreateDialogOpen(true), hasReachableBundles);
let emptyTitle: string;
let emptyDescription: string;
@@ -180,6 +184,47 @@ export const AgentVaultSessionsPage = () => {
emptyDescription = "Create a session to get a token an agent can run with.";
}
+ // Until there is anything to list, a sample session shows what one records.
+ const emptyState = isFiltered ? (
+ <CardContent>
+ <Empty className="border">
+ <EmptyHeader>
+ <EmptyTitle>{emptyTitle}</EmptyTitle>
+ <EmptyDescription>{emptyDescription}</EmptyDescription>
+ </EmptyHeader>
+ {!hasReachableBundles && isAdmin && (
+ <Button variant="av" asChild>
+ <Link
+ to="/organizations/$orgId/agent-vault/access-bundles"
+ params={{ orgId: currentOrg.id }}
+ >
+ Go to Access Bundles
+ </Link>
+ </Button>
+ )}
+ </Empty>
+ </CardContent>
+ ) : (
+ <>
+ <SampleSessionTable onOpen={() => setIsSampleOpen(true)} />
+ <CardContent className="flex items-center justify-between gap-4">
+ <span className="text-sm text-muted">
+ {emptyDescription} Open the sample to see what a session records.
+ </span>
+ {!hasReachableBundles && isAdmin && (
+ <Button variant="av" size="sm" asChild>
+ <Link
+ to="/organizations/$orgId/agent-vault/access-bundles"
+ params={{ orgId: currentOrg.id }}
+ >
+ Go to Access Bundles
+ </Link>
+ </Button>
+ )}
+ </CardContent>
+ </>
+ );
+
return (
<div className="mx-auto mb-6 flex w-full max-w-8xl flex-col">
<Helmet>
@@ -347,24 +392,7 @@ export const AgentVaultSessionsPage = () => {
</CardContent>
{!isPending && sessions.length === 0 ? (
- <CardContent>
- <Empty className="border">
- <EmptyHeader>
- <EmptyTitle>{emptyTitle}</EmptyTitle>
- <EmptyDescription>{emptyDescription}</EmptyDescription>
- </EmptyHeader>
- {!isFiltered && !hasReachableBundles && isAdmin && (
- <Button variant="av" asChild>
- <Link
- to="/organizations/$orgId/agent-vault/access-bundles"
- params={{ orgId: currentOrg.id }}
- >
- Go to Access Bundles
- </Link>
- </Button>
- )}
- </Empty>
- </CardContent>
+ emptyState
) : (
<Table>
<TableHeader>
@@ -545,6 +573,8 @@ export const AgentVaultSessionsPage = () => {
}}
/>
+ <SampleSessionSheet isOpen={isSampleOpen} onOpenChange={setIsSampleOpen} />
+
<SessionDetailSheet
session={openSession}
isPending={isOpenSessionPending}
diff --git a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/SampleSessionSheet.tsx b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/SampleSessionSheet.tsx
new file mode 100644
index 0000000000..05563a7f4f
--- /dev/null
+++ b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/components/SampleSessionSheet.tsx
@@ -0,0 +1,395 @@
+import { useEffect, useMemo, useState } from "react";
+import { useNavigate } from "@tanstack/react-router";
+import { ArrowRightIcon, BotIcon, PackageIcon, SparklesIcon } from "lucide-react";
+
+import {
+ Badge,
+ Button,
+ Detail,
+ DetailLabel,
+ DetailValue,
+ Empty,
+ EmptyDescription,
+ EmptyHeader,
+ EmptyTitle,
+ Sheet,
+ SheetContent,
+ SheetDescription,
+ SheetFooter,
+ SheetHeader,
+ SheetTitle,
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow
+} from "@app/components/v3";
+import { useOrganization, useProjectPermission } from "@app/context";
+import { AgentVaultSessionLogDecision, AgentVaultSessionStatus } from "@app/hooks/api/agentVault";
+import { TAgentVaultSessionLogRecord } from "@app/hooks/api/agentVault/types";
+import { ProjectMembershipRole } from "@app/hooks/api/roles/types";
+
+import { LiveStateBadge } from "./LiveStatusRow";
+import { SessionLogRow } from "./SessionLogRow";
+import { SessionStatusBadge } from "./SessionStatusBadge";
+
+// The empty state holds long enough to read as waiting, not flicker past.
+const FIRST_REQUEST_DELAY_MS = 1400;
+const STREAM_INTERVAL_MS = 650;
+
+type SampleRequest = Omit<TAgentVaultSessionLogRecord, "ts" | "seq" | "proxyId" | "accessBundle">;
+
+const SAMPLE_REQUESTS: SampleRequest[] = [
+ {
+ method: "POST",
+ host: "api.openai.com",
+ port: "443",
+ path: "/v1/chat/completions",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "openai"
+ },
+ {
+ method: "GET",
+ host: "api.github.com",
+ port: "443",
+ path: "/repos/halcyon/api/pulls?state=open",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "github"
+ },
+ {
+ method: "GET",
+ host: "api.github.com",
+ port: "443",
+ path: "/repos/halcyon/api/pulls/482/files",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "github"
+ },
+ {
+ method: "POST",
+ host: "api.openai.com",
+ port: "443",
+ path: "/v1/chat/completions",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "openai"
+ },
+ {
+ method: "POST",
+ host: "api.github.com",
+ port: "443",
+ path: "/repos/halcyon/api/issues/482/comments",
+ status: 201,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "github"
+ },
+ {
+ method: "DELETE",
+ host: "api.github.com",
+ port: "443",
+ path: "/repos/halcyon/api/git/refs/heads/main",
+ status: 403,
+ decision: AgentVaultSessionLogDecision.Blocked,
+ service: "github"
+ },
+ {
+ method: "GET",
+ host: "registry.npmjs.org",
+ port: "443",
+ path: "/left-pad",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Passthrough,
+ service: null
+ },
+ {
+ method: "POST",
+ host: "paste.example.net",
+ port: "443",
+ path: "/api/new",
+ status: 403,
+ decision: AgentVaultSessionLogDecision.Blocked,
+ service: null
+ },
+ {
+ method: "POST",
+ host: "slack.com",
+ port: "443",
+ path: "/api/chat.postMessage",
+ status: 200,
+ decision: AgentVaultSessionLogDecision.Brokered,
+ service: "slack"
+ }
+];
+
+const buildSampleRecords = (now: number): TAgentVaultSessionLogRecord[] =>
+ SAMPLE_REQUESTS.map((request, index) => ({
+ ...request,
+ ts: new Date(now - (SAMPLE_REQUESTS.length - index) * 4000).toISOString(),
+ seq: index,
+ proxyId: "sample",
+ accessBundle: "release-agents"
+ })).reverse();
+
+const HeaderPanel = ({
+ title,
+ lines,
+ tone
+}: {
+ title: string;
+ lines: { name: string; value: string; isAdded?: boolean }[];
+ tone: "muted" | "success";
+}) => (
+ <div className="flex min-w-0 flex-1 flex-col gap-2 rounded-md border border-border bg-container p-3">
+ <span className="text-xs text-accent">{title}</span>
+ <div className="flex flex-col gap-1 font-mono text-xs">
+ {lines.map((line) => (
+ <div key={line.name} className="flex min-w-0 gap-2">
+ <span className="shrink-0 text-muted">{line.name}:</span>
+ <span
+ className={
+ line.isAdded && tone === "success"
+ ? "truncate text-success"
+ : "truncate text-foreground"
+ }
+ >
+ {line.value}
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+);
+
+type Props = {
+ isOpen: boolean;
+ onOpenChange: (isOpen: boolean) => void;
+};
+
+export const SampleSessionSheet = ({ isOpen, onOpenChange }: Props) => {
+ const navigate = useNavigate();
+ const { currentOrg } = useOrganization();
+ const { hasProjectRole } = useProjectPermission();
+ const isAdmin = hasProjectRole(ProjectMembershipRole.Admin);
+
+ const [openedAt, setOpenedAt] = useState(() => Date.now());
+ const [visibleCount, setVisibleCount] = useState(0);
+ const records = useMemo(() => buildSampleRecords(openedAt), [openedAt]);
+
+ useEffect(() => {
+ if (!isOpen) return undefined;
+ setOpenedAt(Date.now());
+ setVisibleCount(0);
+ let interval: ReturnType<typeof setInterval> | undefined;
+ const start = setTimeout(() => {
+ setVisibleCount(1);
+ interval = setInterval(() => {
+ setVisibleCount((count) => {
+ if (count + 1 >= SAMPLE_REQUESTS.length) clearInterval(interval);
+ return Math.min(count + 1, SAMPLE_REQUESTS.length);
+ });
+ }, STREAM_INTERVAL_MS);
+ }, FIRST_REQUEST_DELAY_MS);
+ return () => {
+ clearTimeout(start);
+ clearInterval(interval);
+ };
+ }, [isOpen]);
+
+ // Records are newest first, so the stream reveals them from the bottom of the list upwards.
+ const visible = records.slice(records.length - visibleCount);
+
+ return (
+ <Sheet open={isOpen} onOpenChange={onOpenChange}>
+ <SheetContent
+ size="workspace"
+ className="flex h-full max-h-full flex-col gap-y-0"
+ onOpenAutoFocus={(event) => event.preventDefault()}
+ >
+ <SheetHeader>
+ <SheetTitle className="flex items-center gap-2">
+ Sample Session
+ <Badge variant="info">
+ <SparklesIcon />
+ Sample Data
+ </Badge>
+ </SheetTitle>
+ <SheetDescription>
+ An example of the requests a session records. This data is not from your organization.
+ </SheetDescription>
+ </SheetHeader>
+
+ <div className="flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-4">
+ <div className="flex shrink-0 items-center gap-4 overflow-hidden rounded-md border border-border bg-container py-3 pr-4">
+ <div className="-ml-px flex min-w-0 flex-1 flex-wrap gap-y-3 *:border-l *:border-border *:px-4">
+ <Detail className="min-w-0">
+ <DetailLabel>Machine Identity</DetailLabel>
+ <DetailValue className="flex items-center gap-2">
+ <BotIcon className="size-4 shrink-0 text-muted" />
+ <span className="truncate">release-bot</span>
+ </DetailValue>
+ </Detail>
+ <Detail className="min-w-0">
+ <DetailLabel>Access Bundle</DetailLabel>
+ <DetailValue className="flex items-center gap-2">
+ <PackageIcon className="size-4 shrink-0 text-muted" />
+ <span className="truncate">release-agents</span>
+ </DetailValue>
+ </Detail>
+ <Detail>
+ <DetailLabel>Expires</DetailLabel>
+ <DetailValue>In 8 hours</DetailValue>
+ </Detail>
+ <Detail className="items-start">
+ <DetailLabel>Status</DetailLabel>
+ <SessionStatusBadge status={AgentVaultSessionStatus.Active} />
+ </Detail>
+ </div>
+ </div>
+
+ <div className="flex shrink-0 flex-col gap-2">
+ <span className="text-sm font-medium">How the first request was brokered</span>
+ <div className="flex flex-col items-stretch gap-2 md:flex-row md:items-center">
+ <HeaderPanel
+ title="Request from the agent"
+ tone="muted"
+ lines={[
+ { name: "POST", value: "https://api.openai.com/v1/chat/completions" },
+ { name: "Authorization", value: "(not set)" }
+ ]}
+ />
+ <ArrowRightIcon className="mx-auto size-4 shrink-0 rotate-90 text-muted md:rotate-0" />
+ <HeaderPanel
+ title="Request forwarded by the proxy"
+ tone="success"
+ lines={[
+ { name: "POST", value: "https://api.openai.com/v1/chat/completions" },
+ { name: "Authorization", value: "Bearer sk-proj-••••••••••••", isAdded: true }
+ ]}
+ />
+ </div>
+ <span className="text-xs text-muted">
+ The credential is stored in the access bundle and attached by the proxy. The agent has
+ only a session token, so no credential is present in its environment.
+ </span>
+ </div>
+
+ <div className="flex min-h-64 flex-1 flex-col">
+ {visible.length === 0 ? (
+ <Empty className="flex-1 border">
+ <EmptyHeader>
+ <LiveStateBadge state="live" />
+ <EmptyTitle>Waiting for requests</EmptyTitle>
+ <EmptyDescription>Requests made through a proxy show up here.</EmptyDescription>
+ </EmptyHeader>
+ </Empty>
+ ) : (
+ <Table
+ className="w-full min-w-240 table-fixed"
+ containerClassName="min-h-0 thin-scrollbar overflow-auto"
+ >
+ <TableHeader sticky>
+ <TableRow>
+ <TableHead className="w-48">Time</TableHead>
+ <TableHead className="w-24">Method</TableHead>
+ <TableHead>Host</TableHead>
+ <TableHead>Path</TableHead>
+ <TableHead className="w-24">Upstream</TableHead>
+ <TableHead className="w-36">Outcome</TableHead>
+ <TableHead variant="action" className="w-12" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {visible.map((record) => (
+ <SessionLogRow
+ key={record.seq}
+ record={record}
+ arrivedAt={
+ openedAt + FIRST_REQUEST_DELAY_MS + record.seq * STREAM_INTERVAL_MS
+ }
+ />
+ ))}
+ </TableBody>
+ </Table>
+ )}
+ </div>
+ </div>
+
+ <SheetFooter className="flex-row items-center justify-between border-t border-border">
+ <span className="text-xs text-muted">
+ The proxy attached a credential to each brokered request. Blocked requests were not
+ forwarded.
+ </span>
+ {isAdmin && (
+ <Button
+ variant="av"
+ onClick={() => {
+ onOpenChange(false);
+ navigate({
+ to: "/organizations/$orgId/agent-vault",
+ params: { orgId: currentOrg.id }
+ });
+ }}
+ >
+ Set Up Your Own
+ </Button>
+ )}
+ </SheetFooter>
+ </SheetContent>
+ </Sheet>
+ );
+};
+
+export const SampleSessionTable = ({ onOpen }: { onOpen: () => void }) => (
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>Identity</TableHead>
+ <TableHead>Access Bundle</TableHead>
+ <TableHead>Created</TableHead>
+ <TableHead>Expires</TableHead>
+ <TableHead>Status</TableHead>
+ <TableHead variant="action" />
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ <TableRow onClick={onOpen} className="cursor-pointer">
+ <TableCell>
+ <div className="flex items-center gap-2">
+ <BotIcon className="size-4 text-muted" />
+ release-bot
+ <Badge variant="info">
+ <SparklesIcon />
+ Sample
+ </Badge>
+ </div>
+ </TableCell>
+ <TableCell>
+ <span className="flex items-center gap-2">
+ <PackageIcon className="size-4 text-muted" />
+ release-agents
+ </span>
+ </TableCell>
+ <TableCell className="text-muted">Example</TableCell>
+ <TableCell className="text-muted">In 8 hours</TableCell>
+ <TableCell>
+ <SessionStatusBadge status={AgentVaultSessionStatus.Active} />
+ </TableCell>
+ <TableCell variant="action">
+ <Button
+ variant="outline"
+ size="xs"
+ onClick={(event) => {
+ event.stopPropagation();
+ onOpen();
+ }}
+ >
+ View Sample
+ </Button>
+ </TableCell>
+ </TableRow>
+ </TableBody>
+ </Table>
+);
diff --git a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/route.tsx b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/route.tsx
index 060c59bde7..00acebd4e0 100644
--- a/frontend/src/pages/agent-vault/AgentVaultSessionsPage/route.tsx
+++ b/frontend/src/pages/agent-vault/AgentVaultSessionsPage/route.tsx
@@ -1,6 +1,7 @@
import { createFileRoute, stripSearchParams } from "@tanstack/react-router";
import { zodValidator } from "@tanstack/zod-adapter";
+import { agentVaultCreateIntentSearchParams } from "@app/hooks/useAgentVaultCreateIntent";
import { agentVaultSheetSearchParams } from "@app/hooks/useAgentVaultSheetState";
import { AgentVaultSessionsPage } from "./AgentVaultSessionsPage";
@@ -9,7 +10,9 @@ export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/agent-vault/_agent-vault-layout/sessions"
)({
component: AgentVaultSessionsPage,
- validateSearch: zodValidator(agentVaultSheetSearchParams),
+ validateSearch: zodValidator(
+ agentVaultSheetSearchParams.merge(agentVaultCreateIntentSearchParams)
+ ),
search: { middlewares: [stripSearchParams({ sessionId: undefined })] },
beforeLoad: ({ context }) => {
return { breadcrumbs: [...context.breadcrumbs, { label: "Sessions" }] };
diff --git a/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx b/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
index cb213e4440..1f3aa55ce1 100644
--- a/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/ProjectTypePage/ProjectTypePage.tsx
@@ -298,7 +298,7 @@ export const ProjectTypePage = () => {
useEffect(() => {
if (projectType === ProjectType.AgentVault) {
navigate({
- to: "/organizations/$orgId/agent-vault/sessions",
+ to: "/organizations/$orgId/agent-vault",
params: { orgId }
});
}
diff --git a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
index 1addd656f1..3115a35b6d 100644
--- a/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
+++ b/frontend/src/pages/organization/ProjectsPage/components/ProjectCategoryOverview.tsx
@@ -366,7 +366,7 @@ export const ProjectCategoryOverview = () => {
const navigateToAgentVault = () => {
navigate({
- to: "/organizations/$orgId/agent-vault/sessions",
+ to: "/organizations/$orgId/agent-vault",
params: { orgId: currentOrg?.id ?? "" }
});
};
diff --git a/frontend/src/pages/redirects/agent-vault-index-redirect.tsx b/frontend/src/pages/redirects/agent-vault-index-redirect.tsx
index a8171b5749..97ffa7b0da 100644
--- a/frontend/src/pages/redirects/agent-vault-index-redirect.tsx
+++ b/frontend/src/pages/redirects/agent-vault-index-redirect.tsx
@@ -1,12 +1,42 @@
-import { createFileRoute, redirect } from "@tanstack/react-router";
+import { useEffect } from "react";
+import { createFileRoute, useNavigate } from "@tanstack/react-router";
+
+import { useAgentVaultSetupProgress } from "@app/components/agent-vault/SetupChecklist";
+import { PageLoader } from "@app/components/v3";
+import { useOrganization } from "@app/context";
+
+// Until an admin finishes setup (or hides the checklist), the product opens on the first unfinished step.
+const AgentVaultIndexRedirect = () => {
+ const navigate = useNavigate();
+ const { currentOrg } = useOrganization();
+ const progress = useAgentVaultSetupProgress();
+ const { isAdmin, isLoaded, isVisible, hasConnectedProxy, newestBundle, hasService } = progress;
+ const isResolved = !isAdmin || isLoaded;
+
+ useEffect(() => {
+ if (!isResolved) return;
+ const params = { orgId: currentOrg.id };
+
+ if (isVisible && !hasConnectedProxy) {
+ navigate({ to: "/organizations/$orgId/agent-vault/proxies", params, replace: true });
+ } else if (isVisible && !newestBundle) {
+ navigate({ to: "/organizations/$orgId/agent-vault/access-bundles", params, replace: true });
+ } else if (isVisible && newestBundle && !hasService) {
+ navigate({
+ to: "/organizations/$orgId/agent-vault/access-bundles/$accessBundleId",
+ params: { ...params, accessBundleId: newestBundle.id },
+ replace: true
+ });
+ } else {
+ navigate({ to: "/organizations/$orgId/agent-vault/sessions", params, replace: true });
+ }
+ }, [isResolved]);
+
+ return <PageLoader />;
+};
export const Route = createFileRoute(
"/_authenticate/_inject-org-details/_org-layout/organizations/$orgId/agent-vault/_agent-vault-layout/"
)({
- beforeLoad: ({ params }) => {
- throw redirect({
- to: "/organizations/$orgId/agent-vault/sessions",
- params: { orgId: params.orgId }
- });
- }
+ component: AgentVaultIndexRedirect
});