{
  "slug": "railway-delete-commands-accept-2fa-code-for-non-interactive-verification-6986d9a6d39d",
  "title": "railway delete commands accept --2fa-code for non-interactive verification",
  "tools": [
    "railway"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-01-26T04:32:32.000Z",
  "announced_at": "2026-01-26T04:32:32.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When 2FA is enabled and deletion runs non-interactively, provide a verification code with `--2fa-code`. Use the matching delete command and `--yes` to skip confirmation.",
    "examples": [
      "railway delete --project <project-name-or-id> --yes --2fa-code <CODE>",
      "railway environment delete <environment> --yes --2fa-code <CODE>",
      "railway volume delete --volume <volume-name-or-id> --yes --2fa-code <CODE>"
    ],
    "gotchas": [
      "Version: v4.27.2",
      "--2fa-code <CODE>: 2FA verification code; required when 2FA is enabled and running non-interactively.",
      "--yes: Skip the confirmation dialog; needed to avoid a confirmation prompt in non-interactive mode.",
      "--project <project-name-or-id>: Project ID or name to delete; required when project deletion runs without a terminal.",
      "<environment> (required): Environment name or ID to delete.",
      "--volume <volume-name-or-id>: Volume ID or name to delete; command uses the linked project and environment when not otherwise specified.",
      "Prerequisite: Authenticate the Railway CLI with a Railway account before use.",
      "Prerequisite: For volume deletion, the CLI requires a linked project and environment.",
      "Applies to destructive operations when 2FA is enabled on a Railway account.",
      "The flag supports deleting projects, environments, and volumes."
    ]
  },
  "why_it_matters": "When deleting a project, environment, or volume in a Railway account with 2FA enabled, run the delete command non-interactively with a verification code.",
  "before": "With 2FA enabled, non-interactive destructive commands failed with “2FA is enabled. This operation requires interactive mode.”",
  "sources": [
    "https://github.com/railwayapp/cli/releases/tag/v4.27.2",
    "https://github.com/railwayapp/cli/pull/773",
    "https://github.com/railwayapp/cli/blob/v4.27.2/src/commands/delete.rs",
    "https://github.com/railwayapp/cli/blob/v4.27.2/src/commands/environment/delete.rs",
    "https://github.com/railwayapp/cli/blob/v4.27.2/src/commands/volume.rs",
    "https://docs.railway.com/cli/environment",
    "https://docs.railway.com/cli"
  ],
  "rank": 0.95012,
  "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": "wave1b-20261016",
    "verdict_id": "wave1b-20261016:wave1b-20261016-9a7fbc56171555ae-0:gate",
    "evidence_hash": "58babc853b20822d6d773acd0ae7df6ba78e60b630cb6fe9519b7eafa539352b"
  },
  "review": {
    "draft_hash": "6d5755720248c69e36a586449712cef55f30d47a4bd15b99f3763368686220f0",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-20261016:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.95 >= 0.9; 2 needed) and Jev gave 0.64 (>= 0.6 needed)."
  }
}
