Skip to content

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

Merge remote-tracking branch 'origin/main' into agent-vault-on-behalf-of

Scott Wilsona85aaea77c7a
diff --cc backend/src/@types/fastify.d.ts
index f293d7de4f,a1947f5e6c..09e0b78215
--- a/backend/src/@types/fastify.d.ts
+++ b/backend/src/@types/fastify.d.ts
@@@ -407,9 -407,9 +408,10 @@@ declare module "fastify"
agentVaultPersonalValue: TAgentVaultPersonalValueServiceFactory;
agentVaultProxy: TAgentVaultProxyServiceFactory;
agentVaultSession: TAgentVaultSessionServiceFactory;
+ agentVaultSkill: TAgentVaultSkillServiceFactory;
agentVaultSessionLog: TAgentVaultSessionLogServiceFactory;
agentVaultMembership: TAgentVaultMembershipServiceFactory;
+ agentVaultDelegation: TAgentVaultDelegationServiceFactory;
certManagerInstance: TCertManagerInstanceServiceFactory;
certManagerExport: TCertManagerExportServiceFactory;
certificateAuthority: TCertificateAuthorityServiceFactory;
diff --cc backend/src/@types/knex.d.ts
index 633e6d76f5,e1ff165e1f..4530013491
--- a/backend/src/@types/knex.d.ts
+++ b/backend/src/@types/knex.d.ts
@@@ -22,13 -22,10 +22,16 @@@ import
TAdditionalPrivilegesUpdate,
TAgentVaultAccessBundles,
TAgentVaultAccessBundlesInsert,
+ TAgentVaultAccessBundleSkills,
+ TAgentVaultAccessBundleSkillsInsert,
+ TAgentVaultAccessBundleSkillsUpdate,
TAgentVaultAccessBundlesUpdate,
+ TAgentVaultDelegations,
+ TAgentVaultDelegationsInsert,
+ TAgentVaultDelegationSubjects,
+ TAgentVaultDelegationSubjectsInsert,
+ TAgentVaultDelegationSubjectsUpdate,
+ TAgentVaultDelegationsUpdate,
TAgentVaultPersonalValueReferences,
TAgentVaultPersonalValueReferencesInsert,
TAgentVaultPersonalValueReferencesUpdate,
diff --cc backend/src/db/schemas/index.ts
index 89894f06b3,e759e97bed..36843026fb
--- a/backend/src/db/schemas/index.ts
+++ b/backend/src/db/schemas/index.ts
@@@ -4,9 -4,8 +4,10 @@@ export * from "./access-approval-polici
export * from "./access-approval-requests";
export * from "./access-approval-requests-reviewers";
export * from "./additional-privileges";
+ export * from "./agent-vault-access-bundle-skills";
export * from "./agent-vault-access-bundles";
+export * from "./agent-vault-delegation-subjects";
+export * from "./agent-vault-delegations";
export * from "./agent-vault-personal-value-references";
export * from "./agent-vault-personal-values";
export * from "./agent-vault-proxies";
diff --cc backend/src/db/schemas/models.ts
index d92a6695f7,19ea19118a..c4e055deef
--- a/backend/src/db/schemas/models.ts
+++ b/backend/src/db/schemas/models.ts
@@@ -285,10 -285,11 +285,13 @@@ export enum TableName
AgentVaultPersonalValueReference = "agent_vault_personal_value_references",
AgentVaultSession = "agent_vault_sessions",
AgentVaultSessionAccessBundle = "agent_vault_session_access_bundles",
+ AgentVaultDelegation = "agent_vault_delegations",
+ AgentVaultDelegationSubject = "agent_vault_delegation_subjects",
AgentVaultProxy = "agent_vault_proxies",
AgentVaultSessionLogConfig = "agent_vault_session_log_configs",
+ AgentVaultSkill = "agent_vault_skills",
+ AgentVaultSkillVersion = "agent_vault_skill_versions",
+ AgentVaultAccessBundleSkill = "agent_vault_access_bundle_skills",
// Dropped; kept only for the migrations that create and drop it.
AgentVaultSessionLogChunk = "agent_vault_session_log_chunks",
diff --cc backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.test.ts
index 3aa06bbbfe,7856a06150..50b62e6b51
--- a/backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.test.ts
+++ b/backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.test.ts
@@@ -293,133 -294,3 +295,135 @@@ describe("resolve's lazy refresh", () =
});
});
});
+
+describe("resolve for a session on a user's behalf", () => {
+ const USER_ID = "user-1";
+ const IDENTITY_ID = "identity-1";
+ type TActorSetup = { isAdmin?: boolean; grants?: string[]; isActive?: boolean };
+
+ // Each actor gets its own org status, role and bundle grants, and resolve's reach is read off the bundles it asks for.
+ const setupOnBehalfOf = ({
+ user = {},
+ identity = {},
+ delegationCoversUser = true,
+ isUserDeleted = false
+ }: {
+ user?: TActorSetup;
+ identity?: TActorSetup;
+ delegationCoversUser?: boolean;
+ isUserDeleted?: boolean;
+ }) => {
+ const actor = (actorId: string) => (actorId === IDENTITY_ID ? identity : user);
+ const findResolvableServices = vi.fn(async () => [] as TResolveServiceRow[]);
+ const service = agentVaultProxyServiceFactory({
+ agentVaultProxyDAL: {
+ findByIdWithOrg: async () => ({ projectId: PROJECT_ID, orgId: "org-1", pollInterval: 60 })
+ } as never,
- agentVaultResolveDAL: { findResolvableServices },
++ agentVaultResolveDAL: { findResolvableServices, findSessionSkills: async () => [] },
+ agentVaultServiceCustomHeaderDAL: { findByServiceIds: async () => [] },
+ agentVaultServiceSubstitutionDAL: { findByServiceIds: async () => [] },
+ agentVaultVariableDAL: { findValuesForResolve: async () => [] },
+ agentVaultPersonalValueDAL: { findForResolve: async () => [] },
+ agentVaultSessionDAL: {
+ findByTokenHash: async () =>
+ ({
+ id: "session-1",
+ projectId: PROJECT_ID,
+ userId: null,
+ identityId: IDENTITY_ID,
+ onBehalfOfUserId: isUserDeleted ? null : USER_ID,
+ onBehalfOfUserName: "Alice Nguyen",
+ revokedAt: null,
+ expiresAt: null
+ }) as never
+ },
+ agentVaultDelegationDAL: { identityCoversUser: async () => delegationCoversUser },
+ agentVaultSessionLogConfigDAL: {
+ findOne: async () => sessionLogConfig,
+ findByProjectIdFromPrimary: async () => sessionLogConfig
+ },
+ membershipDAL: {
+ findResourceMembershipsForActor: async ({ actorId }: { actorId: string }) =>
+ (actor(actorId).grants ?? []).map((scopeResourceId) => ({
+ isActive: true,
+ actorGroupId: null,
+ scopeResourceId
+ }))
+ } as never,
+ orgDAL: {
+ findEffectiveOrgMembership: async ({ actorId }: { actorId: string }) =>
+ ({ isActive: actor(actorId).isActive ?? true }) as never
+ },
+ permissionService: {
+ getProjectPermission: async ({ actorId }: { actorId: string }) =>
+ ({
+ permission: createMongoAbility([
+ {
+ action: ProjectPermissionAgentVaultSessionActions.Read,
+ subject: ProjectPermissionSub.AgentVaultSessions
+ }
+ ]),
+ hasRole: () => Boolean(actor(actorId).isAdmin),
+ memberships: []
+ }) as never
+ },
+ kmsService: {
+ createCipherPairWithDataKey: async () =>
+ ({ decryptor: ({ cipherTextBlob }: { cipherTextBlob: Buffer }) => cipherTextBlob }) as never
+ },
+ licenseService: {} as never,
+ resourceAuthMethodService: {} as never,
+ agentVaultOauthService: {
+ refreshServiceToken: vi.fn() as never,
+ reportMissingScopes: vi.fn() as never
- }
++ },
++ projectDAL: { findById: async () => ({ id: PROJECT_ID, orgId: "org-1" }) as never },
++ userDAL: { findById: async () => undefined as never }
+ });
+ const resolve = () =>
+ service.resolveSession({ proxyId: "proxy-1", orgId: "org-1", sessionToken: "token", hasSessionLogKey: false });
+ const reachedBundles = () =>
+ (findResolvableServices.mock.calls[0] as unknown as [{ accessBundleIds: string[] | null }])[0].accessBundleIds;
+ return { resolve, reachedBundles };
+ };
+
+ test("a non-admin user's reach is narrowed to the bundles the identity reaches too", async () => {
+ const { resolve, reachedBundles } = setupOnBehalfOf({
+ user: { grants: ["bundle-a", "bundle-b"] },
+ identity: { grants: ["bundle-b", "bundle-c"] }
+ });
+ await resolve();
+ expect(reachedBundles()).toEqual(["bundle-b"]);
+ });
+
+ test("an admin on either side leaves the other side's reach", async () => {
+ const adminIdentity = setupOnBehalfOf({ user: { grants: ["bundle-a"] }, identity: { isAdmin: true } });
+ await adminIdentity.resolve();
+ expect(adminIdentity.reachedBundles()).toEqual(["bundle-a"]);
+
+ const adminUser = setupOnBehalfOf({ user: { isAdmin: true }, identity: { grants: ["bundle-c"] } });
+ await adminUser.resolve();
+ expect(adminUser.reachedBundles()).toEqual(["bundle-c"]);
+ });
+
+ test("a delegation that no longer covers the user is a 401", async () => {
+ const { resolve } = setupOnBehalfOf({ user: { grants: ["bundle-a"] }, delegationCoversUser: false });
+ await expect(resolve()).rejects.toThrow(UnauthorizedError);
+ });
+
+ test("an identity deactivated in the org is a 401", async () => {
+ const { resolve } = setupOnBehalfOf({ user: { grants: ["bundle-a"] }, identity: { isActive: false } });
+ await expect(resolve()).rejects.toThrow(UnauthorizedError);
+ });
+
+ test("a user deactivated in the org is a 401", async () => {
+ const { resolve } = setupOnBehalfOf({ user: { grants: ["bundle-a"], isActive: false } });
+ await expect(resolve()).rejects.toThrow(UnauthorizedError);
+ });
+
+ // The name is left behind, so the session must not fall back to resolving as the identity's own.
+ test("a session whose user was deleted is a 401, not the identity's own session", async () => {
+ const { resolve } = setupOnBehalfOf({ identity: { isAdmin: true }, isUserDeleted: true });
+ await expect(resolve()).rejects.toThrow(UnauthorizedError);
+ });
+});
diff --cc backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.ts
index 523ef657bc,8239b3387a..2046fad832
--- a/backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.ts
+++ b/backend/src/ee/services/agent-vault-proxy/agent-vault-proxy-service.ts
@@@ -673,83 -665,9 +682,72 @@@ export const agentVaultProxyServiceFact
return resolved;
};
+ // The user a session was started on behalf of has to still be in the org and in Agent Vault, and the delegation of the
+ // identity that owns the session has to still cover them. Read on every resolve, so taking any of them away ends the
+ // session on the proxy's next poll. Returns the bundles the user reaches (null for every bundle), since the session
+ // reaches only what both the identity and the user reach.
+ const $getOnBehalfOfUserReach = async ({
+ projectId,
+ orgId,
+ identityId,
+ userId
+ }: {
+ projectId: string;
+ orgId: string;
+ identityId: string | null;
+ userId: string | null;
+ }): Promise<string[] | null> => {
+ const refused = () =>
+ new UnauthorizedError({
+ message: "The machine identity that owns this session is no longer allowed to act on behalf of its user"
+ });
+ if (!identityId || !userId) throw refused();
+
+ const orgMembership = await orgDAL.findEffectiveOrgMembership({
+ actorType: ActorType.USER,
+ actorId: userId,
+ orgId,
+ status: OrgMembershipStatus.Accepted
+ });
+ if (!orgMembership?.isActive) throw refused();
+
+ let isAdmin: boolean;
+ let liveGroupIds: string[];
+ try {
+ const { permission, hasRole, memberships } = await permissionService.getProjectPermission({
+ actor: ActorType.USER,
+ actorId: userId,
+ projectId,
+ actorAuthMethod: null,
+ actorOrgId: orgId,
+ actionProjectType: ActionProjectType.AgentVault
+ });
+ if (!permission.can(ProjectPermissionAgentVaultSessionActions.Read, ProjectPermissionSub.AgentVaultSessions)) {
+ throw refused();
+ }
+ isAdmin = hasRole(ProjectMembershipRole.Admin);
+ liveGroupIds = liveGroupIdsFrom(memberships);
+ } catch (error) {
+ if (error instanceof ForbiddenRequestError && error.name === "ProjectMembershipNotFound") throw refused();
+ throw error;
+ }
+
+ if (!(await agentVaultDelegationDAL.identityCoversUser({ projectId, identityId, userId }))) {
+ throw refused();
+ }
+
+ if (isAdmin) return null;
+ return findReachableAccessBundleIds(membershipDAL, {
+ projectId,
+ actor: { type: ActorType.USER, id: userId },
+ groupIds: liveGroupIds
+ });
+ };
+
- // Shared by resolve and credential refresh, so a refresh can never reach a service resolve would not.
- const $authorizeSession = async ({
- proxyId,
- orgId,
- sessionToken
- }: Pick<TResolveSessionDTO, "proxyId" | "orgId" | "sessionToken">) => {
- const session = await agentVaultSessionDAL.findByTokenHash(hashSessionToken(sessionToken));
- if (!session) throw new NotFoundError({ message: "Session not found" });
-
- // A mismatch is 404, not 403, so a proxy cannot probe another tenant for session ids.
- const proxy = await agentVaultProxyDAL.findByIdWithOrg(proxyId);
- if (!proxy || proxy.projectId !== session.projectId || proxy.orgId !== orgId) {
- throw new NotFoundError({ message: "Session not found" });
- }
-
+ // Shared by the proxy's session routes and the CLI's skills fetch, so none of them can reach a bundle resolve
- // would not. Returns the bundles the session's owner reaches now, null for an admin.
++ // would not. Returns the bundles the session reaches now, null for every bundle: its owner's, and on a user's behalf
++ // only those the user reaches too.
+ const $authorizeSessionOwner = async (session: TAgentVaultSessions, orgId: string) => {
if (session.revokedAt) throw new UnauthorizedError({ message: "This session has been revoked" });
if (session.expiresAt && session.expiresAt <= new Date()) {
throw new UnauthorizedError({ message: "This session has expired" });
@@@ -825,8 -731,19 +823,20 @@@
actor,
groupIds: liveGroupIds
});
- const accessBundleIds = onBehalfOf ? intersectAccessBundleIds(actorReach, onBehalfOf.reach) : actorReach;
++ return onBehalfOf ? intersectAccessBundleIds(actorReach, onBehalfOf.reach) : actorReach;
+ };
+ const $authorizeSession = async ({ proxyId, orgId, sessionToken }: TAuthorizeSessionDTO) => {
+ const session = await agentVaultSessionDAL.findByTokenHash(hashSessionToken(sessionToken));
+ if (!session) throw new NotFoundError({ message: "Session not found" });
+
+ // A mismatch is 404, not 403, so a proxy cannot probe another tenant for session ids.
+ const proxy = await agentVaultProxyDAL.findByIdWithOrg(proxyId);
+ if (!proxy || proxy.projectId !== session.projectId || proxy.orgId !== orgId) {
+ throw new NotFoundError({ message: "Session not found" });
+ }
+
+ const accessBundleIds = await $authorizeSessionOwner(session, orgId);
return { session, proxy, accessBundleIds };
};
diff --cc backend/src/ee/services/agent-vault/AGENTS.md
index 3804912e2c,5721d03150..f5259f802a
--- a/backend/src/ee/services/agent-vault/AGENTS.md
+++ b/backend/src/ee/services/agent-vault/AGENTS.md
@@@ -20,11 -20,11 +20,12 @@@ agent-vault/ shared: en
agent-vault-access-bundle/ bundles, services, credential encryption, grants
agent-vault-variable/ global and personal variables and the reads behind Used By
agent-vault-member/ product membership (list, add, role, remove)
+agent-vault-delegation/ which users a machine identity may start sessions on behalf of
agent-vault-personal-value/ each actor's own values for the fields a service leaves to members
+ agent-vault-skill/ the skill library, versions, bundle links, file validation and hashing
agent-vault-session/ mint, revoke, list, get, edit label
agent-vault-project/ the per-org project's lazy bootstrap and resolver
- agent-vault-proxy/ create/rotate (proxy token + CA), bootstrap, heartbeat, resolve, credential refresh
+ agent-vault-proxy/ create/rotate (proxy token + CA), bootstrap, heartbeat, resolve, credential refresh, session skills
agent-vault-oauth/ OAuth for MCP services: discovery, client registration, authorizations, refresh
agent-vault-session-log/ storage settings, chunk ingest, playback
```
@@@ -119,80 -119,9 +120,82 @@@ and `packages/agentvault/` in the CLI r
actor id reads as revoked in the list and the status filter, so they agree with resolve refusing it. Expiry
is enforced against the clock on every resolve; there is no expiry audit event, matching every other product.
- **Sessions are never deleted**, so the Sessions page is a full history and a session's row keeps the key its
- logs need. Settled with the product owner.
+ logs need.
+ - Anyone with a session token can download its skills from Infisical with only the token (`GET /session/skills`).
+## Sessions on behalf of users
+
+A machine identity with a **delegation** can mint a session on behalf of a user (`onBehalfOf` on mint). The session
+belongs to the identity: `identityId` is the identity, so only it and Agent Vault admins can list, read, label or revoke
+the session or read its session logs, and the user never sees it. The user is kept as
+`onBehalfOfUserId`, with `onBehalfOfUserName` and `onBehalfOfUserEmail` snapshotted like `actorName` and `actorEmail`;
+resolve uses the user's personal values, and the user's reach narrows the identity's. A delegation
+is one `agent_vault_delegations` row per identity, with a scope of `all-members` or `selected`, plus
+`agent_vault_delegation_subjects` rows naming users and groups. Both reference an Agent Vault membership (`membershipId`,
+`ON DELETE CASCADE`): the delegation its identity's, and each subject the user's or group's.
+
+- **Never put the user in `userId`.** Ownership is `userId` or `identityId` alone (`isSessionOwnedBy`, the list's actor
+ filter), so a user in `userId` would see the session and its logs. The DB check
+ `agent_vault_sessions_on_behalf_of_check` keeps an on-behalf-of session an identity's.
+- **`onBehalfOfUserName` is what marks the session on-behalf-of** once deleting the user sets the id to NULL, the
+ same lesson as `actorType`. A session with the name and no id is orphaned: it reads as revoked
+ (`isOrphanedSession`) and resolve refuses it, rather than resolving as the identity's own session with the
+ identity's personal values.
+- **Resolve re-checks the user every time**: active in the org, a live Agent Vault role, and a delegation of the owning
- identity that still covers them (`$getOnBehalfOfUserReach`). The identity gets the checks every owner gets. Any miss
++ identity that still covers them (`$getOnBehalfOfUserReach`, from `$authorizeSessionOwner`, which the skills fetch
++ shares, so neither can reach a bundle the other wouldn't). The identity gets the checks every owner gets. Any miss
+ is a 401, like an actor removed from Agent Vault. Removing a delegation revokes nothing, so its sessions work again
+ if it comes back; revoking is what ends one. Settled the same way as removal from Agent Vault.
+- **Reach is the intersection of the identity's and the user's** (`intersectAccessBundleIds`): a bundle needs both,
+ through the admin role or a grant, at mint and on every resolve. The user losing
+ a grant drops the bundle's services like an owner's lost grant, with no 401.
+- **Listing access bundles with `onBehalfOfUserId` or `onBehalfOfUserEmail` runs mint's delegation and user checks**
+ (`agent-vault-on-behalf-of-fns.ts`, shared by both), then returns the bundles the user and the identity both reach,
+ with setup state from the user's personal values, so an orchestrator can choose a bundle before it mints.
+- **Mint checks the delegation, then the identity's own bundles, then the user**, so an identity learns nothing about
+ who is in the org until an admin has delegated it and granted it the bundle, and an unknown user gets the same message
+ as an uncovered one. Only a machine identity may send `onBehalfOf`. The user must be an active, accepted org member,
+ as resolve requires.
+- **The delegation read and write return `missingAccessBundles`**, per user and group and in total: the bundles they
+ can use and the identity can't. Users and the identity go through `getAgentVaultReachability`, the function mint
+ uses, so the view can't disagree with mint; a group's reach is its own live role and grants, read directly since a
+ group never holds a session. The list leaves it out, because it reads every covered user's access. The write works
+ it out after its transaction commits and after the router writes the audit event, so a failure there can't leave a
+ committed save unaudited.
+- **Mint runs `getProjectPermission` for the user, then once more for the caller.** The permission service leaves
+ the last actor it ran for in the request context, where the audit log reads the caller's permission metadata. The
+ second call is memoized, so it costs no query; dropping it attributes the user's metadata to the identity.
+- **The user's session permission is checked with `can()`, not thrown through CASL**, since a CASL denial would be
+ recorded against the identity making the request.
+- **TTL defaults to 1h, with no maximum for now**: the user didn't start the session and may not know it exists, so a
+ cap probably belongs here too, but any TTL is allowed for now, `never` included. The route's `ttl` is optional rather
+ than defaulted because the default depends on `onBehalfOf`.
+- **The user can't see a session started on their behalf**: their list leaves it out, and get, label, revoke and
+ session log reads answer 404, as for any session someone else owns. An admin finds it by either name, since search
+ matches the on-behalf-of user too.
+- **Coverage reads group membership without `isPending`**, the way the permission engine grants access through a
+ group. Filtering it would refuse accepted users, since the flag is no longer cleared.
+- **A subject is named by its own Agent Vault membership**, the rule bundle grants use: a user who reaches Agent
+ Vault only through a group is covered by naming the group. Coverage itself is read live, so leaving the group
+ ends it.
+- **Leaving Agent Vault by any path deletes the delegation rows**, through the membership FK cascade: Agent Vault's own
+ removal, the generic project membership routes, leaving the org, SCIM delete, and deleting the actor. So adding the
+ identity, user or group back restores nothing. Deactivating (SCIM or org) deletes nothing; mint and resolve refuse
+ through the `isActive` check. Membership rows keep their id while the actor stays a member (role changes only touch
+ `membership_roles`), so a one-off migration that rewrites membership rows has to repoint these keys.
+- **The dashboard changes a delegation one user or group at a time** (`POST` and `DELETE .../subjects`, candidates from
+ `.../subjects/available`), never through the whole-list `PUT`, so two admins editing at once, or a page holding an
+ old list, can't undo each other's changes. `PUT` stays for API callers that set the whole list, and for scope.
+- **A selected delegation whose subjects have all left reads as none** (404, left out of the list, refused at mint), and
+ the next save replaces the row instead of reviving it.
+- **A save locks parent rows, then memberships, then the delegation**, in the order deleting or removing them does:
+ `FOR KEY SHARE` on the identity, users and groups, then the memberships `FOR SHARE` in id order. Changing the order
+ brings back deadlocks with identity deletion and with removal from Agent Vault. A remove or delete, which names no
+ new subjects, still takes the identity's membership before the delegation row for the same reason. Every write locks
+ the delegation row before reading or replacing it, and `updatedAt` moves only on a save or a real add or remove.
+- **Delegation routes take no `AuthMode.OAUTH`.** The admin check reads the role, which a delegated token's scopes
+ don't narrow, and a delegation lets an identity act as other users.
+
## Proxies
- There is no enrollment. Create and rotate return a proxy token (the non-expiring access JWT) and every proxy
diff --cc backend/src/server/routes/index.ts
index 112a1f3afa,c5f582dfcb..38cf70e767
--- a/backend/src/server/routes/index.ts
+++ b/backend/src/server/routes/index.ts
@@@ -2066,8 -2065,9 +2070,11 @@@ export const registerRoutes = async
const agentVaultProxyDAL = agentVaultProxyDALFactory(db);
const agentVaultResolveDAL = agentVaultResolveDALFactory(db);
const agentVaultSessionLogConfigDAL = agentVaultSessionLogConfigDALFactory(db);
+ const agentVaultDelegationDAL = agentVaultDelegationDALFactory(db);
+ const agentVaultDelegationSubjectDAL = agentVaultDelegationSubjectDALFactory(db);
+ const agentVaultSkillDAL = agentVaultSkillDALFactory(db);
+ const agentVaultSkillVersionDAL = agentVaultSkillVersionDALFactory(db);
+ const agentVaultSkillBundleDAL = agentVaultSkillBundleDALFactory(db);
const agentVaultOauthService = agentVaultOauthServiceFactory({
keyStore,
diff --cc backend/src/services/telemetry/telemetry-types.ts
index 89f456555e,5086cdbe52..2f5e37ed75
--- a/backend/src/services/telemetry/telemetry-types.ts
+++ b/backend/src/services/telemetry/telemetry-types.ts
@@@ -2649,11 -2687,12 +2701,14 @@@ export type TAgentVaultPostHogEvent
| TAgentVaultSessionLogChunkAcceptedEvent
| TAgentVaultProductMemberAddedEvent
| TAgentVaultProductMemberUpdatedEvent
- | TAgentVaultProductMemberRemovedEvent;
+ | TAgentVaultProductMemberRemovedEvent
+ | TAgentVaultDelegationSetEvent
+ | TAgentVaultDelegationDeletedEvent;
- export type TAgentVaultActorPostHogEvent = Exclude<TAgentVaultPostHogEvent, TAgentVaultSessionLogChunkAcceptedEvent>;
+ export type TAgentVaultActorPostHogEvent = Exclude<
+ TAgentVaultPostHogEvent,
+ TAgentVaultSessionLogChunkAcceptedEvent | TAgentVaultSkillsDeliveredEvent
+ >;
// A trial is burned per PRODUCT, not per (product, plan): the trial-history gate discards plan_key
// (see licenseV2Service.getOverview), and the license server 409s a repeat. So TrialStarted fires at
diff --cc docs/documentation/platform/agent-vault/access-control.mdx
index 0a94681023,2852fc278d..4ed976e318
--- a/docs/documentation/platform/agent-vault/access-control.mdx
+++ b/docs/documentation/platform/agent-vault/access-control.mdx
@@@ -25,8 -25,8 +25,8 @@@ Agent Vault has one member list for you
| Role | What they can do |
|------|------------------|
- | **Admin** | <ul><li>Create and manage access bundles, services, variables, and proxies</li><li>Grant access bundles</li><li>Manage membership</li><li>Let machine identities [create sessions on behalf of users](/documentation/platform/agent-vault/sessions-on-behalf-of-users)</li><li>Read audit logs</li></ul> |
- | **Member** | <ul><li>Create sessions with the access bundles granted to them</li><li>Revoke their own sessions</li><li>Set up their [personal values](/documentation/platform/agent-vault/access-bundles#set-up-your-personal-values) and keep [personal variables](/documentation/platform/agent-vault/variables#personal-variables)</li></ul> |
-| **Admin** | <ul><li>Create and manage access bundles, services, variables, skills, and proxies</li><li>Grant access bundles</li><li>Manage membership</li><li>Read audit logs</li></ul> |
++| **Admin** | <ul><li>Create and manage access bundles, services, variables, skills, and proxies</li><li>Grant access bundles</li><li>Manage membership</li><li>Let machine identities [create sessions on behalf of users](/documentation/platform/agent-vault/sessions-on-behalf-of-users)</li><li>Read audit logs</li></ul> |
+ | **Member** | <ul><li>Create sessions with the access bundles granted to them</li><li>Revoke their own sessions</li><li>Set up their [personal values](/documentation/platform/agent-vault/access-bundles#set-up-your-personal-values) and keep [personal variables](/documentation/platform/agent-vault/variables#personal-variables)</li><li>View the latest version of the skills in the access bundles granted to them</li></ul> |
An admin can use every access bundle without a grant. A member can't use an access bundle until an admin grants it, and only sees the bundles granted to them. On the **Sessions** page, members see their own sessions, and admins can switch between **All Sessions** and **My Sessions**.
diff --cc docs/documentation/platform/agent-vault/sessions.mdx
index 6e46665d08,45688757c3..eadf04152e
--- a/docs/documentation/platform/agent-vault/sessions.mdx
+++ b/docs/documentation/platform/agent-vault/sessions.mdx
@@@ -12,7 -12,7 +12,7 @@@ Every session is scoped to one access b
Anyone granted at least one access bundle can create a session. Admins can create one with any access bundle.
<Tip>
- If you want to create sessions programmatically, you can have a [machine identity](/documentation/platform/identities/machine-identities) create a new session for each run using [the CLI](/documentation/platform/agent-vault/sessions-cli) or [the API](/documentation/platform/agent-vault/sessions-api). A machine identity can also create sessions [on behalf of users](/documentation/platform/agent-vault/sessions-on-behalf-of-users), so that each agent uses the personal values of the person it runs for and gets no more access than that person.
- If you want to create sessions programmatically, you can have a [machine identity](/documentation/platform/identities/machine-identities) create a new session for each run using [the CLI](/documentation/platform/agent-vault/sessions-cli), [the API](/documentation/platform/agent-vault/sessions-api), or [the Python SDK](/sdks/languages/python#agent_vault-sessions).
++ If you want to create sessions programmatically, you can have a [machine identity](/documentation/platform/identities/machine-identities) create a new session for each run using [the CLI](/documentation/platform/agent-vault/sessions-cli), [the API](/documentation/platform/agent-vault/sessions-api), or [the Python SDK](/sdks/languages/python#agent_vault-sessions). A machine identity can also create sessions [on behalf of users](/documentation/platform/agent-vault/sessions-on-behalf-of-users), so that each agent uses the personal values of the person it runs for and gets no more access than that person.
</Tip>
<Tabs>
diff --cc frontend/src/hooks/api/agentVault/mutations.tsx
index 89d687f211,39c91ce6cf..3e121e72e9
--- a/frontend/src/hooks/api/agentVault/mutations.tsx
+++ b/frontend/src/hooks/api/agentVault/mutations.tsx
@@@ -12,8 -12,7 +12,9 @@@ import
TAgentVaultAccessBundle,
TAgentVaultActorIdsDTO,
TAgentVaultActorRef,
+ TAgentVaultBundleSkill,
+ TAgentVaultDelegation,
+ TAgentVaultDelegationDetail,
TAgentVaultGrantedMember,
TAgentVaultMemberWriteResult,
TAgentVaultMintedSession,
@@@ -25,18 -24,19 +26,21 @@@
TAgentVaultService,
TAgentVaultSession,
TAgentVaultSessionLogSettingsState,
+ TAgentVaultSkillSummary,
+ TAgentVaultSkillVersion,
TAgentVaultVariable,
TAgentVaultWrittenMember,
+ TChangeAgentVaultDelegationSubjectsDTO,
TCompleteAgentVaultOauthAuthorizationDTO,
TCreateAgentVaultAccessBundleDTO,
TCreateAgentVaultOauthAuthorizationDTO,
TCreateAgentVaultOauthAuthorizationResponse,
TCreateAgentVaultServiceDTO,
TCreateAgentVaultSessionDTO,
+ TCreateAgentVaultSkillDTO,
TCreateAgentVaultVariableDTO,
TDeleteAgentVaultPersonalValuesDTO,
+ TSetAgentVaultDelegationDTO,
TSetAgentVaultPersonalValuesDTO,
TUpdateAgentVaultAccessBundleDTO,
TUpdateAgentVaultMemberRolesDTO,
diff --cc frontend/src/hooks/api/agentVault/queries.tsx
index acc66b1d51,693faac81d..76638795c2
--- a/frontend/src/hooks/api/agentVault/queries.tsx
+++ b/frontend/src/hooks/api/agentVault/queries.tsx
@@@ -31,8 -31,8 +31,9 @@@ import
import {
TAgentVaultAccessBundleDetails,
TAgentVaultAccessBundleListItem,
+ TAgentVaultBundleSkill,
TAgentVaultDecryptedSessionLogPage,
+ TAgentVaultDelegationDetail,
TAgentVaultMember,
TAgentVaultOauthAuthorization,
TAgentVaultProductActor,
diff --cc frontend/src/pages/agent-vault/agent-vault-docs-urls.ts
index c4f3575e44,23b91a6fbb..aa52d23d7e
--- a/frontend/src/pages/agent-vault/agent-vault-docs-urls.ts
+++ b/frontend/src/pages/agent-vault/agent-vault-docs-urls.ts
@@@ -7,8 -7,8 +7,9 @@@ export const AgentVaultDocsUrls =
services: `${AGENT_VAULT_DOCS_BASE_URL}/services`,
memberProvidedValues: `${AGENT_VAULT_DOCS_BASE_URL}/http-apis#member-provided-values`,
variables: `${AGENT_VAULT_DOCS_BASE_URL}/variables`,
+ skills: `${AGENT_VAULT_DOCS_BASE_URL}/skills`,
sessions: `${AGENT_VAULT_DOCS_BASE_URL}/sessions`,
+ sessionsOnBehalfOfUsers: `${AGENT_VAULT_DOCS_BASE_URL}/sessions-on-behalf-of-users`,
proxies: `${AGENT_VAULT_DOCS_BASE_URL}/proxies`,
sessionLogs: `${AGENT_VAULT_DOCS_BASE_URL}/session-logs`
} as const;