Skip to content

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

chore(agent-vault): fix stale test comment and notes

Saif6dc36bf8acc4
diff --git a/backend/src/ee/services/agent-vault/CLAUDE.md b/backend/src/ee/services/agent-vault/CLAUDE.md
index a304d074ac..94f10ce66d 100644
--- a/backend/src/ee/services/agent-vault/CLAUDE.md
+++ b/backend/src/ee/services/agent-vault/CLAUDE.md
@@ -55,12 +55,15 @@ and `packages/agentvault/` in the CLI repo. Frontend: `frontend/src/pages/agent-
on project removal, org removal, SCIM and every FK cascade. Do not add an Agent Vault reaper.
- `scopeResourceId` has no FK, so `deleteAccessBundle` deletes the bundle row first and then the grants in one
transaction, and `addMembers` locks the bundle row (`lockByIdInProject`) before inserting. Keep that order.
-- Granting is batch: one POST carries `{ userIds, identityIds, groupIds }`. That lock is what makes
+- Granting is batch: one POST carries `{ userIds, machineIdentityIds, groupIds }`. That lock is what makes
the dedupe read inside it authoritative, so an actor who already holds the bundle is returned in
`skipped` rather than erroring; the unique index is only the backstop.
- Member responses, for bundles and for the product, are the actor itself, flat (`type`, the actor's `id`,
its profile) plus what the membership adds (`role`, `addedAt`, `grantedAt`). There is no membership id:
every write names a member by its actor, so the id a client reads is the one it sends back.
+- Audit events name actors through `agent-vault-actor-name-fns.ts`. Resolve names before the write, so a
+ failed lookup can't leave a committed change unaudited, and attach a name only to an actor already proven
+ to be in the org: the lookup isn't org-scoped.
- Reachability has one implementation, `findReachableAccessBundleIds` over the platform's
`findResourceMembershipsForActor`, and mint, member-facing reads and resolve all call it. A group's grants
count only while the group confers a live role (`liveGroupIdsFrom`). Write no group-expansion SQL here.
diff --git a/backend/src/ee/services/agent-vault/agent-vault-actor-name-fns.test.ts b/backend/src/ee/services/agent-vault/agent-vault-actor-name-fns.test.ts
index 7496af702e..60c49d0be3 100644
--- a/backend/src/ee/services/agent-vault/agent-vault-actor-name-fns.test.ts
+++ b/backend/src/ee/services/agent-vault/agent-vault-actor-name-fns.test.ts
@@ -33,7 +33,6 @@ describe("auditActorFields", () => {
).toEqual({ groupId: "group-1", groupName: "platform" });
});
- // An actor deleted between the write and the name lookup still has to be recorded by id.
test("still records the id when the name could not be resolved", () => {
expect(auditActorFields({ type: AgentVaultMemberType.Group, id: "group-1" })).toEqual({
groupId: "group-1",