{
  "slug": "cypress-environment-access-adds-cy-env-and-deprecates-cypress-env-8e5495528e2d",
  "title": "Cypress environment access adds cy.env() and deprecates Cypress.env()",
  "tools": [
    "cypress"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-03T00:00:00.000Z",
  "announced_at": "2026-02-03T00:00:00.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When tests read Cypress environment variables, migrate those reads to `cy.env()` and request only the needed keys. After migrating all usages on Cypress 15.10.x, set `allowCypressEnv: false` in the Cypress configuration to prevent further use of `Cypress.env()`.",
    "examples": [
      "cy.env(['<key>']).then(({ <key> }) => {\n  // Use <key> here\n})",
      "const { defineConfig } = require('cypress')\n\nmodule.exports = defineConfig({\n  allowCypressEnv: false,\n})"
    ],
    "gotchas": [
      "Version: 15.10.0",
      "keys (required): Non-empty array of non-empty environment variable key strings to retrieve. Undefined values are returned for keys not set.",
      "options.log: Boolean; defaults to `true`. Displays the command and requested key names in the Command Log, never values.",
      "options.timeout: Milliseconds to wait for `cy.env()` to resolve; defaults to `4000` and does not follow `defaultCommandTimeout`.",
      "allowCypressEnv: Set to `false` in Cypress configuration to disallow the deprecated `Cypress.env()` API on Cypress ^15.10.0.",
      "Prerequisite: `cy.env()` requires Cypress 15.10.0 or newer, must be chained from `cy`, and requires a non-empty array of non-empty strings.",
      "Prerequisite: `allowCypressEnv` is available on Cypress ^15.10.0; Cypress 16.0 removes both it and `Cypress.env()`."
    ]
  },
  "why_it_matters": "Update Cypress tests that access environment variables to use the asynchronous secure API and prevent remaining use of the deprecated API.",
  "before": "Use `Cypress.env()` to access Cypress environment variables.",
  "sources": [
    "https://docs.cypress.io/app/references/changelog#15-10-0",
    "https://docs.cypress.io/api/commands/env"
  ],
  "rank": 0.97065,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-f075fc0fd9ff0859-0:gate",
    "evidence_hash": "78376832aeae10dd0f5ef0ebb74be78506305ca315bce9a6944334ed827bb5ef"
  },
  "review": {
    "draft_hash": "fa86239dddeae8fa096f16efaa165e5f309670e7dea77360ef3583e0149f3f22",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.74 (>= 0.6 needed)."
  }
}
