Skip to content

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

add to claude.md

Matheus Nogueira2a93d2472619
diff --git a/CLAUDE.md b/CLAUDE.md
index 73cdd10755..7c7d11f22a 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -108,6 +108,10 @@ Auth modes (JWT, IDENTITY_ACCESS_TOKEN, SCIM_TOKEN) are extracted in `backend/sr
PAM and Agent Vault are products over one implicit project per organization, not projects a user creates. Their URLs are `/organizations/$orgId/<product>/…` with no `$projectId`, the frontend resolves the project from the org (`useImplicitProjectId`), the backend bootstraps it lazily and blocks generic create and delete, their roles are admin or member only, and each has its own metered identities dimension (`pam_identities`, `agent_vault_identities`). When you add a `ProjectType.PAM` arm anywhere, add the Agent Vault arm beside it. See `backend/src/ee/services/pam/CLAUDE.md` and `backend/src/ee/services/agent-vault/CLAUDE.md`.
+### Single-Project Products
+
+Secret Scanning has one active project per organization (the newest) but keeps `$projectId` in its URLs, like Certificate Manager. It is created lazily by `GET /api/v2/secret-scanning/project`, and `projectId` is optional on its API (`inject-secret-scanning-project-id`). Do not add a project picker or a way to create more Secret Scanning projects.
+
### Service Factory + Manual DI (Backend)
No IoC container in either backend. Every service is a factory function with explicit dependencies.
diff --git a/backend/CLAUDE.md b/backend/CLAUDE.md
index 47c62670a7..e9e7399b20 100644
--- a/backend/CLAUDE.md
+++ b/backend/CLAUDE.md
@@ -1005,6 +1005,8 @@ EE routes register before community routes so they can override/extend endpoints
**Agent Vault**: the same applies to the `agent-vault-*` services and routers; the concept map is [`src/ee/services/agent-vault/CLAUDE.md`](src/ee/services/agent-vault/CLAUDE.md). PAM and Agent Vault are the two **org-scoped products**: one implicit project per org, resolved lazily, whose roles collapse to admin or member. Anything that branches on `ProjectType.PAM` (metering emits, predefined roles, the billable-project count, invite grants) almost always needs an Agent Vault arm too.
+**Secret Scanning** is single-project (see the root `CLAUDE.md`): `secret-scanning-v2-project-resolver.ts` picks and lazily creates the active project, and routes that take `projectId` read `req.internalSecretScanningProjectId`.
+
**Dynamic secret lease secrets needed at revoke time go in `dynamic_secret_leases.encryptedLeaseData`**, never in `externalEntityId` or `config` (both plaintext, and `externalEntityId` is returned by every lease route and logged in audit events). A provider opts in by listing the `create()` `data` keys in `persistedLeaseFields`; the lease service encrypts them with the project's SecretManager key and every revoke path passes them back as `metadata.leaseData`. Lease routes return `SanitizedDynamicSecretLeaseSchema` so the column never reaches a response. Secret *config* fields are listed separately in `DYNAMIC_SECRET_SECRET_FIELDS` (`providers/redact.ts`), as dotted paths so nested secrets work (`clientAuth.clientSecret`): reads strip them via `redactStoredInputs`, and an update that omits one keeps the stored value via `restoreOmittedSecretFields`, because the update merge is shallow.
**Gateways: there is only one generation.** Gateway v1 (`ee/services/gateway`, `lib/gateway`, the QUIC
diff --git a/frontend/CLAUDE.md b/frontend/CLAUDE.md
index 3feee714f8..bc41f278c1 100644
--- a/frontend/CLAUDE.md
+++ b/frontend/CLAUDE.md
@@ -105,6 +105,10 @@ 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.
+### Single-project products
+
+Secret Scanning has one active project per org (see the root `CLAUDE.md`). Members are sent straight into it, and UI for orgs with older projects is gated on `isMultiInstance` from `useGetSecretScanningInstanceState`.
+
## Conventions
- ESLint flat config (ESLint 9+) with airbnb-typescript + prettier. Double quotes enforced.