Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
breaking(agent-vault): make every variable secret
Scott Wilson3ce29a833297
diff --git a/backend/e2e-test/routes/v1/agent-vault.spec.ts b/backend/e2e-test/routes/v1/agent-vault.spec.tsindex 79edc4c08e..71c527b734 100644--- a/backend/e2e-test/routes/v1/agent-vault.spec.ts+++ b/backend/e2e-test/routes/v1/agent-vault.spec.ts@@ -769,7 +769,7 @@ describe("Agent Vault V1 Router", async () => {substitutionId?: string;};- const createVariable = async (accessBundleId: string, body: { key: string; value: string; isSecret?: boolean }) => {+ const createVariable = async (accessBundleId: string, body: { key: string; value: string }) => {const res = await inject("POST", variablesUrl(accessBundleId), body);expect(res.statusCode).toBe(200);return (JSON.parse(res.payload) as { variable: { id: string; key: string } }).variable;@@ -953,7 +953,7 @@ describe("Agent Vault V1 Router", async () => {test("a service uses a variable by key, and resolve puts the value in its place", async () => {const bundle = await createAccessBundle("variables-resolve");const token = await createVariable(bundle.id, { key: "GITHUB_TOKEN", value: "ghp_from_variable" });- const org = await createVariable(bundle.id, { key: "ORG_ID", value: "org-42", isSecret: false });+ const org = await createVariable(bundle.id, { key: "ORG_ID", value: "org-42" });const created = await inject("POST", servicesUrl(bundle.id), {name: "github",@@ -1079,11 +1079,7 @@ describe("Agent Vault V1 Router", async () => {const renamed = await inject("PATCH", `${variablesUrl(bundle.id)}/${variable.id}`, { key: "NEW_NAME" });expect(renamed.statusCode).toBe(200);- expect(JSON.parse(renamed.payload).variable).toMatchObject({- key: "NEW_NAME",- value: null,- serviceIds: [serviceId]- });+ expect(JSON.parse(renamed.payload).variable).toMatchObject({ key: "NEW_NAME", serviceIds: [serviceId] });const detail = JSON.parse((await inject("GET", `/api/v1/agent-vault/access-bundles/${bundle.id}`)).payload) as {accessBundle: { services: { variableReferences: TReference[] }[] };@@ -1132,7 +1128,7 @@ describe("Agent Vault V1 Router", async () => {const removed = await inject("DELETE", `${variablesUrl(bundle.id)}/${variable.id}`);expect(removed.statusCode).toBe(200);- expect(JSON.parse(removed.payload).variable).toMatchObject({ id: variable.id, key: "API_KEY", value: null });+ expect(JSON.parse(removed.payload).variable).toMatchObject({ id: variable.id, key: "API_KEY" });});test("an unknown key fails the save by name, and a malformed reference fails validation unquoted", async () => {@@ -1206,30 +1202,41 @@ describe("Agent Vault V1 Router", async () => {expect(services.map((service) => service.name)).toEqual(["at-limit"]);});- test("the list carries only values that are not secret, and the value route returns either uncached", async () => {+ test("no response but the value route carries a value, and that route returns it uncached", async () => {const bundle = await createAccessBundle("variables-visibility");- const hidden = await createVariable(bundle.id, { key: "HIDDEN", value: "hidden_value" });- await createVariable(bundle.id, { key: "SHOWN", value: "shown_value", isSecret: false });+ // A client from before every value was secret may still send isSecret: false. It is stripped, not honoured.+ const createdRes = await inject("POST", variablesUrl(bundle.id), {+ key: "HIDDEN",+ value: "hidden_value",+ isSecret: false+ });+ expect(createdRes.statusCode).toBe(200);+ expect(createdRes.payload).not.toContain("hidden_value");+ const hidden = (JSON.parse(createdRes.payload) as { variable: { id: string } }).variable;const listed = await inject("GET", variablesUrl(bundle.id));expect(listed.statusCode).toBe(200);expect(listed.payload).not.toContain("hidden_value");- expect(JSON.parse(listed.payload).variables).toEqual([- expect.objectContaining({ key: "HIDDEN", isSecret: true, value: null, serviceIds: [] }),- expect.objectContaining({ key: "SHOWN", isSecret: false, value: "shown_value", serviceIds: [] })- ]);+ const [listedVariable] = JSON.parse(listed.payload).variables;+ expect(listedVariable).toMatchObject({ key: "HIDDEN", serviceIds: [] });+ expect(listedVariable).not.toHaveProperty("value");+ expect(listedVariable).not.toHaveProperty("isSecret");++ const updated = await inject("PATCH", `${variablesUrl(bundle.id)}/${hidden.id}`, { value: "new_hidden_value" });+ expect(updated.statusCode).toBe(200);+ expect(updated.payload).not.toContain("new_hidden_value");const revealed = await inject("GET", `${variablesUrl(bundle.id)}/${hidden.id}/value`);expect(revealed.statusCode).toBe(200);- expect(JSON.parse(revealed.payload)).toEqual({ value: "hidden_value" });+ expect(JSON.parse(revealed.payload)).toEqual({ value: "new_hidden_value" });expect(revealed.headers["cache-control"]).toContain("no-store");- const flipped = await inject("PATCH", `${variablesUrl(bundle.id)}/${hidden.id}`, { isSecret: false });- expect(flipped.statusCode).toBe(200);- expect(JSON.parse(flipped.payload).variable).toMatchObject({ isSecret: false, value: "hidden_value" });-const row = await testDb("agent_vault_variables").where({ id: hidden.id }).first();- expect(row.encryptedValue.toString("utf-8")).not.toContain("hidden_value");+ expect(row.encryptedValue.toString("utf-8")).not.toContain("new_hidden_value");++ const removed = await inject("DELETE", `${variablesUrl(bundle.id)}/${hidden.id}`);+ expect(removed.statusCode).toBe(200);+ expect(removed.payload).not.toContain("new_hidden_value");});test("a value can't be only spaces, and one with spaces around it is kept as typed", async () => {@@ -1238,10 +1245,9 @@ describe("Agent Vault V1 Router", async () => {expect(blank.statusCode).toBe(422);expect(blank.payload).toContain("A value can't be only spaces.");- const padded = await createVariable(bundle.id, { key: "PADDED", value: " kept ", isSecret: false });- expect(JSON.parse((await inject("GET", variablesUrl(bundle.id))).payload).variables).toEqual([- expect.objectContaining({ key: "PADDED", value: " kept " })- ]);+ const padded = await createVariable(bundle.id, { key: "PADDED", value: " kept " });+ const revealed = await inject("GET", `${variablesUrl(bundle.id)}/${padded.id}/value`);+ expect(JSON.parse(revealed.payload)).toEqual({ value: " kept " });expect((await inject("PATCH", `${variablesUrl(bundle.id)}/${padded.id}`, { value: " " })).statusCode).toBe(422);});@@ -1471,7 +1477,7 @@ describe("Agent Vault V1 Router", async () => {test("variables are admin only, reads included", async () => {const bundle = await createAccessBundle("variables-admin-only");- const variable = await createVariable(bundle.id, { key: "TOKEN", value: "admin_only_value", isSecret: false });+ const variable = await createVariable(bundle.id, { key: "TOKEN", value: "admin_only_value" });const created = await inject("POST", servicesUrl(bundle.id), {name: "uses-token",hostPattern: "api.example.com",diff --git a/backend/src/db/migrations/20261009145434_drop-agent-vault-variable-is-secret.ts b/backend/src/db/migrations/20261009145434_drop-agent-vault-variable-is-secret.tsnew file mode 100644index 0000000000..e9f78dd797--- /dev/null+++ b/backend/src/db/migrations/20261009145434_drop-agent-vault-variable-is-secret.ts@@ -0,0 +1,19 @@+import { Knex } from "knex";++import { TableName } from "../schemas";++export async function up(knex: Knex): Promise<void> {+ if (await knex.schema.hasColumn(TableName.AgentVaultVariable, "isSecret")) {+ await knex.schema.alterTable(TableName.AgentVaultVariable, (t) => {+ t.dropColumn("isSecret");+ });+ }+}++export async function down(knex: Knex): Promise<void> {+ if (!(await knex.schema.hasColumn(TableName.AgentVaultVariable, "isSecret"))) {+ await knex.schema.alterTable(TableName.AgentVaultVariable, (t) => {+ t.boolean("isSecret").notNullable().defaultTo(true);+ });+ }+}diff --git a/backend/src/db/sanitized-schema.yaml b/backend/src/db/sanitized-schema.yamlindex 1adb6e3f8d..6e79241173 100644--- a/backend/src/db/sanitized-schema.yaml+++ b/backend/src/db/sanitized-schema.yaml@@ -131,7 +131,6 @@ tables:columns:- id- accessBundleId- - isSecret- createdAt- updatedAtdiff --git a/backend/src/db/schemas/agent-vault-variables.ts b/backend/src/db/schemas/agent-vault-variables.tsindex 5798036445..96662c432d 100644--- a/backend/src/db/schemas/agent-vault-variables.ts+++ b/backend/src/db/schemas/agent-vault-variables.ts@@ -14,7 +14,6 @@ export const AgentVaultVariablesSchema = z.object({accessBundleId: z.string().uuid(),key: z.string(),encryptedValue: zodBuffer,- isSecret: z.boolean().default(true),createdAt: z.date(),updatedAt: z.date()});diff --git a/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-access-bundle-router.ts b/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-access-bundle-router.tsindex 3a24124058..d930738b38 100644--- a/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-access-bundle-router.ts+++ b/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-access-bundle-router.ts@@ -554,8 +554,7 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodPro}),body: z.object({key: AgentVaultVariableKeySchema.describe(AGENT_VAULT.VARIABLE.key),- value: AgentVaultVariableValueSchema.describe(AGENT_VAULT.VARIABLE.value),- isSecret: z.boolean().default(true).describe(AGENT_VAULT.VARIABLE.isSecret)+ value: AgentVaultVariableValueSchema.describe(AGENT_VAULT.VARIABLE.value)}),response: { 200: z.object({ variable: AgentVaultVariableSchema }) }},@@ -578,15 +577,14 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodProaccessBundleId: req.params.accessBundleId,accessBundleName,variableId: variable.id,- key: variable.key,- isSecret: variable.isSecret+ key: variable.key}}});emitAgentVaultTelemetry(server.services.telemetry, req, {event: PostHogEventTypes.AgentVaultVariableCreated,- properties: { accessBundleId: req.params.accessBundleId, variableId: variable.id, isSecret: variable.isSecret }+ properties: { accessBundleId: req.params.accessBundleId, variableId: variable.id }});return { variable };@@ -609,25 +607,23 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodProbody: z.object({key: AgentVaultVariableKeySchema.optional().describe(AGENT_VAULT.VARIABLE.key),- value: AgentVaultVariableValueSchema.optional().describe(AGENT_VAULT.VARIABLE.updateValue),- isSecret: z.boolean().optional().describe(AGENT_VAULT.VARIABLE.isSecret)+ value: AgentVaultVariableValueSchema.optional().describe(AGENT_VAULT.VARIABLE.updateValue)}).refine((body) => Object.values(body).some((value) => value !== undefined),- "Provide at least one of 'key', 'value' or 'isSecret' to update"+ "Provide 'key', 'value' or both to update"),response: { 200: z.object({ variable: AgentVaultVariableSchema }) }},onRequest: verifyAuth([AuthMode.JWT, AuthMode.IDENTITY_ACCESS_TOKEN, AuthMode.OAUTH]),handler: async (req) => {- const { variable, previousKey, previousIsSecret, accessBundleName } =- await server.services.agentVaultAccessBundle.updateVariable({- projectId: req.internalAgentVaultProjectId,- ctx: actorContext(req),- accessBundleId: req.params.accessBundleId,- variableId: req.params.variableId,- ...req.body- });+ const { variable, previousKey, accessBundleName } = await server.services.agentVaultAccessBundle.updateVariable({+ projectId: req.internalAgentVaultProjectId,+ ctx: actorContext(req),+ accessBundleId: req.params.accessBundleId,+ variableId: req.params.variableId,+ ...req.body+ });await server.services.auditLog.createAuditLog({...req.auditLogInfo,@@ -641,8 +637,6 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodProvariableId: variable.id,key: variable.key,previousKey: previousKey === variable.key ? undefined : previousKey,- isSecret: variable.isSecret,- previousIsSecret: previousIsSecret === variable.isSecret ? undefined : previousIsSecret,valueReplaced: req.body.value !== undefined}}@@ -653,7 +647,6 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodProproperties: {accessBundleId: req.params.accessBundleId,variableId: variable.id,- isSecret: variable.isSecret,keyChanged: previousKey !== variable.key,valueReplaced: req.body.value !== undefined,usedByServiceCount: variable.serviceIds.length@@ -719,7 +712,7 @@ export const registerAgentVaultAccessBundleRouter = async (server: FastifyZodProschema: {hide: false,operationId: "getAgentVaultVariableValue",- description: "Get the value of a variable in an Agent Vault access bundle, secret or not",+ description: "Get the value of a variable in an Agent Vault access bundle",tags: [ApiDocsTags.AgentVaultAccessBundles],params: z.object({accessBundleId: z.string().uuid().describe(AGENT_VAULT.ACCESS_BUNDLE.accessBundleId),diff --git a/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-schemas.ts b/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-schemas.tsindex 30be2a3e9d..39fab35ce1 100644--- a/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-schemas.ts+++ b/backend/src/ee/routes/v1/agent-vault-routers/agent-vault-schemas.ts@@ -252,8 +252,6 @@ export const AgentVaultVariableSchema = z.object({id: z.string().uuid().describe(AGENT_VAULT.VARIABLE.variableId),accessBundleId: z.string().uuid().describe(AGENT_VAULT.ACCESS_BUNDLE.accessBundleId),key: z.string().describe(AGENT_VAULT.VARIABLE.key),- isSecret: z.boolean().describe(AGENT_VAULT.VARIABLE.isSecret),- value: z.string().nullable().describe(AGENT_VAULT.VARIABLE.listedValue),serviceIds: z.string().uuid().array().describe(AGENT_VAULT.VARIABLE.serviceIds),createdAt: z.date().describe(AGENT_VAULT.VARIABLE.createdAt),updatedAt: z.date().describe(AGENT_VAULT.VARIABLE.updatedAt)diff --git a/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-service.ts b/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-service.tsindex a245a13722..bb8a17beaf 100644--- a/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-service.ts+++ b/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-service.ts@@ -1313,13 +1313,11 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBund};};- // The secret check sits in the projection, so no caller can put a secret value on the wire by passing one.- const projectVariable = (variable: TAgentVaultVariables, serviceIds: string[], value: string | null) => ({+ // Values never leave through this projection; only the audited value endpoint returns one.+ const projectVariable = (variable: TAgentVaultVariables, serviceIds: string[]) => ({id: variable.id,accessBundleId: variable.accessBundleId,key: variable.key,- isSecret: variable.isSecret,- value: variable.isSecret ? null : value,serviceIds,createdAt: variable.createdAt,updatedAt: variable.updatedAt@@ -1359,21 +1357,14 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBundconst bundle = await resolveVariableBundle(dto);const variables = await agentVaultVariableDAL.findByAccessBundleId(bundle.id);- const [references, cipher] = await Promise.all([- agentVaultServiceVariableReferenceDAL.findByVariableIds(variables.map((variable) => variable.id)),- variables.some((variable) => !variable.isSecret) ? getProjectCipher(dto.projectId) : null- ]);-- return variables.map((variable) =>- projectVariable(- variable,- serviceIdsUsing(references, variable.id),- cipher && !variable.isSecret ? openVariableValue(cipher.decryptor, variable.encryptedValue) : null- )+ const references = await agentVaultServiceVariableReferenceDAL.findByVariableIds(+ variables.map((variable) => variable.id));++ return variables.map((variable) => projectVariable(variable, serviceIdsUsing(references, variable.id)));};- const createVariable = async ({ accessBundleId, key, value, isSecret, ...rest }: TCreateVariableDTO) => {+ const createVariable = async ({ accessBundleId, key, value, ...rest }: TCreateVariableDTO) => {const bundle = await resolveVariableBundle({ ...rest, accessBundleId });const { encryptor } = await getProjectCipher(rest.projectId);@@ -1398,26 +1389,25 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBund});}- return agentVaultVariableDAL.create({ accessBundleId: bundle.id, key, encryptedValue, isSecret }, tx);+ return agentVaultVariableDAL.create({ accessBundleId: bundle.id, key, encryptedValue }, tx);});try {- return { variable: projectVariable(await write(), [], value), accessBundleName: bundle.name };+ return { variable: projectVariable(await write(), []), accessBundleName: bundle.name };} catch (err) {if (isUniqueViolation(err)) throw new BadRequestError({ message: duplicateVariableKeyMessage(key) });throw err;}};- const updateVariable = async ({ accessBundleId, variableId, key, value, isSecret, ...rest }: TUpdateVariableDTO) => {+ const updateVariable = async ({ accessBundleId, variableId, key, value, ...rest }: TUpdateVariableDTO) => {const bundle = await resolveVariableBundle({ ...rest, accessBundleId });const variable = await agentVaultVariableDAL.findOne({ id: variableId, accessBundleId: bundle.id });if (!variable) throw new NotFoundError({ message: `Variable with ID '${variableId}' not found` });- const cipher =- value !== undefined || !(isSecret ?? variable.isSecret) ? await getProjectCipher(rest.projectId) : null;- const encryptedValue = value === undefined ? undefined : sealVariableValue(cipher!.encryptor, value);+ const encryptedValue =+ value === undefined ? undefined : sealVariableValue((await getProjectCipher(rest.projectId)).encryptor, value);const write = () =>agentVaultVariableDAL.transaction(async (tx) => {@@ -1438,7 +1428,7 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBund// A rename is this row alone. Sealed fields name the variable by id, so nothing that uses it changes.const updated = await agentVaultVariableDAL.updateById(current.id,- { key, isSecret, ...(encryptedValue ? { encryptedValue } : {}) },+ { key, ...(encryptedValue ? { encryptedValue } : {}) },tx);const references = await agentVaultServiceVariableReferenceDAL.findByVariableIds([current.id], tx);@@ -1456,18 +1446,9 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBund}const { previous, updated, references } = result;- // The flag is re-read under the lock, so it can disagree with the replica read the cipher was chosen by.- let plainValue: string | null = null;- if (!updated.isSecret) {- plainValue =- value ??- openVariableValue((cipher ?? (await getProjectCipher(rest.projectId))).decryptor, updated.encryptedValue);- }-return {- variable: projectVariable(updated, serviceIdsUsing(references, updated.id), plainValue),+ variable: projectVariable(updated, serviceIdsUsing(references, updated.id)),previousKey: previous.key,- previousIsSecret: previous.isSecret,accessBundleName: bundle.name};};@@ -1518,10 +1499,7 @@ export const agentVaultAccessBundleServiceFactory = (deps: TAgentVaultAccessBundthrow err;}- const plainValue = deleted.isSecret- ? null- : openVariableValue((await getProjectCipher(rest.projectId)).decryptor, deleted.encryptedValue);- return { variable: projectVariable(deleted, [], plainValue), accessBundleName: bundle.name };+ return { variable: projectVariable(deleted, []), accessBundleName: bundle.name };};const getVariableValue = async ({ accessBundleId, variableId, ...rest }: TVariableByIdDTO) => {diff --git a/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-types.ts b/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-types.tsindex 1e3a3fca09..07d14ea100 100644--- a/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-types.ts+++ b/backend/src/ee/services/agent-vault-access-bundle/agent-vault-access-bundle-types.ts@@ -107,7 +107,6 @@ export type TCreateVariableDTO = TAgentVaultProjectScoped & {accessBundleId: string;key: string;value: string;- isSecret: boolean;};export type TUpdateVariableDTO = TAgentVaultProjectScoped & {@@ -115,7 +114,6 @@ export type TUpdateVariableDTO = TAgentVaultProjectScoped & {variableId: string;key?: string;value?: string;- isSecret?: boolean;};export type TVariableByIdDTO = TAgentVaultProjectScoped & { accessBundleId: string; variableId: string };diff --git a/backend/src/ee/services/agent-vault/CLAUDE.md b/backend/src/ee/services/agent-vault/CLAUDE.mdindex c8478e797b..117102aa53 100644--- a/backend/src/ee/services/agent-vault/CLAUDE.md+++ b/backend/src/ee/services/agent-vault/CLAUDE.md@@ -225,9 +225,9 @@ path decides what a service can reach, so it stays literal.Values saved before variables existed hold no id tokens, so they pass through untouched.- Admin only, reads included: every variable route checks `Edit` on access bundles, which a member lacks,and the bundle read gives a member its services without `variableReferences` (left out, not empty, since- an empty list would claim they use none). Every value is sealed;- `isSecret` only decides whether the list returns it. The value route is a GET with no-store headers and- one audit event per read.+ an empty list would claim they use none). Every value is sealed and no response but the value route returns+ one. That route is a GET with no-store headers and one audit event per read. Variables were once+ optionally plain (shown in the list); that was dropped, so every value is secret.## Credentials at restdiff --git a/backend/src/ee/services/audit-log/audit-log-types.ts b/backend/src/ee/services/audit-log/audit-log-types.tsindex 1f950fc685..bd1e983664 100644--- a/backend/src/ee/services/audit-log/audit-log-types.ts+++ b/backend/src/ee/services/audit-log/audit-log-types.ts@@ -6518,7 +6518,7 @@ interface AgentVaultServiceDeleteEvent {};}-// Keys and flags only. A variable's value never reaches an audit row, secret or not.+// Keys only. A variable's value never reaches an audit row.interface AgentVaultVariableCreateEvent {type: EventType.AGENT_VAULT_VARIABLE_CREATE;metadata: {@@ -6526,7 +6526,6 @@ interface AgentVaultVariableCreateEvent {accessBundleName: string;variableId: string;key: string;- isSecret: boolean;};}@@ -6537,10 +6536,8 @@ interface AgentVaultVariableUpdateEvent {accessBundleName: string;variableId: string;key: string;- // The previous* fields are present only when the update changed them.+ // Present only when the update changed the key.previousKey?: string;- isSecret: boolean;- previousIsSecret?: boolean;valueReplaced: boolean;};}diff --git a/backend/src/lib/api-docs/constants.ts b/backend/src/lib/api-docs/constants.tsindex f9b4406792..0d979c4db3 100644--- a/backend/src/lib/api-docs/constants.ts+++ b/backend/src/lib/api-docs/constants.ts@@ -4430,9 +4430,6 @@ export const AGENT_VAULT = {key: "The name services use to refer to the variable, as `{{KEY}}`. Starts with a letter and uses only upper case letters, numbers and underscores.",value: "The value the proxy puts in place of each `{{KEY}}`.",updateValue: "The value the proxy puts in place of each `{{KEY}}`. Omit to keep the stored value.",- isSecret: "Whether the value is hidden once saved. A secret value is only returned by the value endpoint.",- listedValue:- "The value, for a variable that is not secret. Null for a secret one: read it from the value endpoint.",revealedValue: "The variable's value.",serviceIds:"The IDs of the services in the access bundle that use this variable. A variable in use can't be deleted.",diff --git a/backend/src/services/telemetry/telemetry-types.ts b/backend/src/services/telemetry/telemetry-types.tsindex 92db46cb28..1277e34dc1 100644--- a/backend/src/services/telemetry/telemetry-types.ts+++ b/backend/src/services/telemetry/telemetry-types.ts@@ -2480,7 +2480,7 @@ export type TAgentVaultServiceDeletedEvent = {export type TAgentVaultVariableCreatedEvent = {event: PostHogEventTypes.AgentVaultVariableCreated;- properties: TAgentVaultEventBase & { accessBundleId: string; variableId: string; isSecret: boolean };+ properties: TAgentVaultEventBase & { accessBundleId: string; variableId: string };};export type TAgentVaultVariableUpdatedEvent = {@@ -2488,7 +2488,6 @@ export type TAgentVaultVariableUpdatedEvent = {properties: TAgentVaultEventBase & {accessBundleId: string;variableId: string;- isSecret: boolean;keyChanged: boolean;valueReplaced: boolean;usedByServiceCount: number;diff --git a/docs/documentation/platform/agent-vault/variables.mdx b/docs/documentation/platform/agent-vault/variables.mdxindex b6d237b323..565a7f6fe9 100644--- a/docs/documentation/platform/agent-vault/variables.mdx+++ b/docs/documentation/platform/agent-vault/variables.mdx@@ -28,21 +28,18 @@ To add a variable to an access bundle:Under **Variables**, select **Add Variable**.<Frame>- <img src="/images/platform/agent-vault/variable-create.png" alt="The Add Variable dialog with GITHUB_TOKEN as the key, a hidden value, and Secret selected" />+ <img src="/images/platform/agent-vault/variable-create.png" alt="The Add Variable dialog with GITHUB_TOKEN as the key and a hidden value" /></Frame></Step><Step>- Enter a **Key** and a **Value**.+ Enter a **Key** and a **Value**. The value is hidden once you save it. To view it later, select the eye icon next to it in the **Variables** list. Each time someone views or copies a value, Infisical records it in the audit log.<Note>A key must start with a letter, use only uppercase letters, numbers, and underscores, and can be up to 64 characters long. Two variables in the same access bundle can't have the same key.</Note></Step>- <Step>- Leave **Secret** selected to hide the value once you save it. If you're storing something that isn't sensitive, such as an organization ID, clear **Secret** so the value stays visible in the list.- </Step><Step>Select **Add Variable**. The variable appears in the **Variables** list.@@ -123,7 +120,7 @@ To update a variable:In the **Variables** list, open the variable's actions menu and select **Edit**.</Step><Step>- Update the key, the value, or whether the value is secret. If the variable is secret, leave **Value** blank to keep the current value.+ Update the key or the value. Leave **Value** blank to keep the current value.</Step><Step>Select **Save**.diff --git a/frontend/src/components/agent-vault/VariableFormDialog.tsx b/frontend/src/components/agent-vault/VariableFormDialog.tsxindex e5e643ad79..8afe65d335 100644--- a/frontend/src/components/agent-vault/VariableFormDialog.tsx+++ b/frontend/src/components/agent-vault/VariableFormDialog.tsx@@ -7,7 +7,6 @@ import { z } from "zod";import { createNotification } from "@app/components/notifications";import {Button,- Checkbox,Dialog,DialogContent,DialogDescription,@@ -23,8 +22,7 @@ import {InputGroup,InputGroupAddon,InputGroupButton,- InputGroupInput,- Label+ InputGroupInput} from "@app/components/v3";import {normalizeVariableKey,@@ -67,8 +65,7 @@ const buildSchema = (takenKeys: string[], isValueRequired: boolean) =>"A value can't contain line breaks or other control characters. Check for a stray newline if you pasted it.").refine((value) => !isValueRequired || value.length > 0, "Required")- .refine((value) => !value || value.trim().length > 0, "A value can't be only spaces."),- isSecret: z.boolean()+ .refine((value) => !value || value.trim().length > 0, "A value can't be only spaces.")});type FormData = z.infer<ReturnType<typeof buildSchema>>;@@ -107,7 +104,7 @@ export const VariableFormDialog = ({() =>buildSchema(existingKeys.filter((key) => key !== variable?.key),- !variable || !variable.isSecret+ !variable),[existingKeys, variable]);@@ -121,15 +118,13 @@ export const VariableFormDialog = ({} = useForm<FormData>({ resolver: zodResolver(schema) });const key = useWatch({ control, name: "key" });- const isSecret = useWatch({ control, name: "isSecret" });const isRenaming = Boolean(variable) && Boolean(key) && key !== variable?.key;useEffect(() => {if (!isOpen) return;reset({key: variable?.key ?? initialKey ?? "",- value: variable && !variable.isSecret ? (variable.value ?? "") : "",- isSecret: variable?.isSecret ?? true+ value: ""});setIsValueVisible(false);}, [isOpen, variable, initialKey, reset]);@@ -137,23 +132,18 @@ export const VariableFormDialog = ({const onSubmit = async (data: FormData) => {try {if (variable) {- const isValueChanged = variable.isSecret- ? data.value.length > 0- : data.value !== (variable.value ?? "");await updateVariable.mutateAsync({accessBundleId,variableId: variable.id,key: data.key === variable.key ? undefined : data.key,- value: isValueChanged ? data.value : undefined,- isSecret: data.isSecret === variable.isSecret ? undefined : data.isSecret+ value: data.value.length > 0 ? data.value : undefined});createNotification({ text: `Variable "${data.key}" updated`, type: "success" });} else {const created = await createVariable.mutateAsync({accessBundleId,key: data.key,- value: data.value,- isSecret: data.isSecret+ value: data.value});onCreated?.(created);createNotification({ text: `Variable "${data.key}" created`, type: "success" });@@ -164,8 +154,6 @@ export const VariableFormDialog = ({}};- const isMasked = isSecret && !isValueVisible;-return (<Dialog open={isOpen} onOpenChange={onOpenChange}><DialogContent@@ -231,51 +219,29 @@ export const VariableFormDialog = ({<InputGroup><InputGroupInput{...field}- type={isMasked ? "password" : "text"}+ type={isValueVisible ? "text" : "password"}placeholder={- variable?.isSecret- ? "Leave blank to keep the current value"- : "Enter the value"+ variable ? "Leave blank to keep the current value" : "Enter the value"}autoComplete="off"spellCheck={false}isError={Boolean(fieldState.error)}/>- {isSecret && (- <InputGroupAddon align="inline-end">- <InputGroupButton- isDisabled={!field.value}- aria-label={isValueVisible ? "Hide value" : "Show value"}- onClick={() => setIsValueVisible((prev) => !prev)}- >- {isValueVisible ? <EyeOffIcon /> : <EyeIcon />}- </InputGroupButton>- </InputGroupAddon>- )}+ <InputGroupAddon align="inline-end">+ <InputGroupButton+ isDisabled={!field.value}+ aria-label={isValueVisible ? "Hide value" : "Show value"}+ onClick={() => setIsValueVisible((prev) => !prev)}+ >+ {isValueVisible ? <EyeOffIcon /> : <EyeIcon />}+ </InputGroupButton>+ </InputGroupAddon></InputGroup><FieldError>{fieldState.error?.message}</FieldError></FieldContent></Field>)}/>- <Controller- control={control}- name="isSecret"- render={({ field }) => (- <Field orientation="horizontal">- <Checkbox- id="agent-vault-variable-secret"- variant="av"- isChecked={field.value}- onCheckedChange={(checked) => field.onChange(checked === true)}- />- <FieldContent>- <Label htmlFor="agent-vault-variable-secret">Secret</Label>- <FieldDescription>Hide the value after saving.</FieldDescription>- </FieldContent>- </Field>- )}- /><DialogFooter><Button type="button" variant="ghost" onClick={() => onOpenChange(false)}>diff --git a/frontend/src/components/agent-vault/service-sheet/VariableSuggestions.tsx b/frontend/src/components/agent-vault/service-sheet/VariableSuggestions.tsxindex 9a14813cc2..8bc4ed2225 100644--- a/frontend/src/components/agent-vault/service-sheet/VariableSuggestions.tsx+++ b/frontend/src/components/agent-vault/service-sheet/VariableSuggestions.tsx@@ -1,5 +1,5 @@import { KeyboardEvent, ReactNode, RefObject, useId, useMemo, useRef, useState } from "react";-import { LockIcon, PlusIcon } from "lucide-react";+import { PlusIcon } from "lucide-react";import { Popover, PopoverAnchor, PopoverContent } from "@app/components/v3";import { cn } from "@app/components/v3/utils";@@ -187,16 +187,7 @@ export const VariableSuggestions = ({onClick={() => choose(suggestion)}>{suggestion.type === "variable" ? (- <>- <span className="flex-1 truncate font-mono text-xs">{suggestion.variable.key}</span>- {suggestion.variable.isSecret ? (- <LockIcon className="size-3 shrink-0 text-muted" aria-label="Secret" />- ) : (- <span className="max-w-32 truncate text-xs text-muted">- {suggestion.variable.value}- </span>- )}- </>+ <span className="flex-1 truncate font-mono text-xs">{suggestion.variable.key}</span>) : (<><PlusIcon className="size-3.5 shrink-0 text-muted" />diff --git a/frontend/src/hooks/api/agentVault/types.ts b/frontend/src/hooks/api/agentVault/types.tsindex 67319e009b..588166a828 100644--- a/frontend/src/hooks/api/agentVault/types.ts+++ b/frontend/src/hooks/api/agentVault/types.ts@@ -428,9 +428,6 @@ export type TAgentVaultVariable = {id: string;accessBundleId: string;key: string;- isSecret: boolean;- /** Null for a secret variable, whose value comes only from the value route. */- value: string | null;serviceIds: string[];createdAt: string;updatedAt: string;@@ -445,11 +442,9 @@ export type TCreateAgentVaultVariableDTO = {accessBundleId: string;key: string;value: string;- isSecret: boolean;};export type TUpdateAgentVaultVariableDTO = TAgentVaultVariableRef & {key?: string;value?: string;- isSecret?: boolean;};diff --git a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/VariablesCard.tsx b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/VariablesCard.tsxindex 012ef2ae5d..bd6d6b93ea 100644--- a/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/VariablesCard.tsx+++ b/frontend/src/pages/agent-vault/AgentVaultAccessBundleDetailPage/components/VariablesCard.tsx@@ -4,7 +4,6 @@ import {CopyIcon,EyeIcon,EyeOffIcon,- LockIcon,MoreHorizontalIcon,PencilIcon,PlusIcon,@@ -168,22 +167,18 @@ export const VariablesCard = ({ accessBundleId, services }: Props) => {}};- // A secret is fetched, and so audited, each time it is copied, and it is never shown. Safari lets a page write+ // A value is fetched, and so audited, each time it is copied, and it is never shown. Safari lets a page write// the clipboard only inside the click that asked, so the value being fetched goes in as a pending ClipboardItem.// Older Firefox has no ClipboardItem, but still lets a page write text shortly after a click.const copyValue = async (variable: TAgentVaultVariable) => {let request: Promise<string> | undefined;try {- if (variable.isSecret) {- request = revealValue.mutateAsync({ accessBundleId, variableId: variable.id });- if (typeof ClipboardItem === "undefined") {- await navigator.clipboard.writeText(await request);- } else {- const fetched = request.then((value) => new Blob([value], { type: "text/plain" }));- await navigator.clipboard.write([new ClipboardItem({ "text/plain": fetched })]);- }+ request = revealValue.mutateAsync({ accessBundleId, variableId: variable.id });+ if (typeof ClipboardItem === "undefined") {+ await navigator.clipboard.writeText(await request);} else {- await navigator.clipboard.writeText(variable.value ?? "");+ const fetched = request.then((value) => new Blob([value], { type: "text/plain" }));+ await navigator.clipboard.write([new ClipboardItem({ "text/plain": fetched })]);}createNotification({ text: `Copied the value of ${variable.key}`, type: "success" });} catch {@@ -303,32 +298,27 @@ export const VariablesCard = ({ accessBundleId, services }: Props) => {<TruncatedKey value={variable.key} /></TableCell><TableCell>- {variable.isSecret ? (- <div className="flex items-center gap-1.5">- <LockIcon className="size-3.5 shrink-0 text-muted" aria-label="Secret" />- {isRevealed ? (- <span className="min-w-0 truncate font-mono text-sm">- {revealedValue}- </span>- ) : (- <span className="font-mono text-sm tracking-widest text-muted">- {MASK}- </span>- )}- <IconButton- variant="ghost"- size="xs"- className="shrink-0"- aria-label={`${isRevealed ? "Hide" : "Reveal"} ${variable.key}`}- isPending={revealingId === variable.id}- onClick={() => toggleReveal(variable)}- >- {isRevealed ? <EyeOffIcon /> : <EyeIcon />}- </IconButton>- </div>- ) : (- <span className="block truncate font-mono text-sm">{variable.value}</span>- )}+ <div className="flex items-center gap-1.5">+ {isRevealed ? (+ <span className="min-w-0 truncate font-mono text-sm">+ {revealedValue}+ </span>+ ) : (+ <span className="font-mono text-sm tracking-widest text-muted">+ {MASK}+ </span>+ )}+ <IconButton+ variant="ghost"+ size="xs"+ className="shrink-0"+ aria-label={`${isRevealed ? "Hide" : "Reveal"} ${variable.key}`}+ isPending={revealingId === variable.id}+ onClick={() => toggleReveal(variable)}+ >+ {isRevealed ? <EyeOffIcon /> : <EyeIcon />}+ </IconButton>+ </div></TableCell><TableCell><ServiceIconStack