{"record":{"id":"1074ad1fa2d80cd8","repo":"warpdotdev/warp","slug":"invalid-value-api-key","errorCode":null,"errorMessage":"invalid value 'api-key'","messagePattern":"invalid value 'api-key'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/mod.rs","lineNumber":214,"sourceCode":"                return Err(anyhow::anyhow!(\"invalid value 'federate'\"));\n            }\n            federate::run(ctx, global_options, federate_cmd)\n        }\n        CliCommand::HarnessSupport(args) => {\n            if !FeatureFlag::AgentHarness.is_enabled() {\n                return Err(anyhow::anyhow!(\"invalid value 'harness-support'\"));\n            }\n            harness_support::run(ctx, global_options, args)\n        }\n        CliCommand::Artifact(artifact_cmd) => {\n            if !FeatureFlag::ArtifactCommand.is_enabled() {\n                return Err(anyhow::anyhow!(\"invalid value 'artifact'\"));\n            }\n            artifact::run(ctx, global_options, artifact_cmd)\n        }\n        CliCommand::ApiKey(api_key_cmd) => {\n            if !FeatureFlag::APIKeyManagement.is_enabled() {\n                return Err(anyhow::anyhow!(\"invalid value 'api-key'\"));\n            }\n            api_key::run(ctx, global_options, api_key_cmd)\n        }\n        CliCommand::Runner(runner_cmd) => {\n            if !FeatureFlag::CloudAgentRunners.is_enabled() {\n                return Err(anyhow::anyhow!(\"invalid value 'runner'\"));\n            }\n            runner::run(ctx, global_options, runner_cmd)\n        }\n    }\n}\n\nfn format_skill_resolution_error(err: ResolveSkillError) -> String {\n    match err {\n        ResolveSkillError::NotFound { skill } => {\n            format!(\"Skill '{skill}' not found\")\n        }\n        ResolveSkillError::RepoNotFound { repo } => {","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/mod.rs#L196-L232","documentation":"Thrown by the dispatcher arm for CliCommand::ApiKey (mod.rs:214) when `api-key` parsed but FeatureFlag::APIKeyManagement is disabled. The clap-mimicking 'invalid value' error hides API-key management subcommands when the flag is off. Flag defaults to false; availability is launch-channel/account dependent.","triggerScenarios":"Invoking `<cli> api-key <subcmd>` (create/revoke API keys) where FeatureFlag::APIKeyManagement.is_enabled() == false.","commonSituations":"Automation trying to mint API keys for CI authentication on a build where key management is gated; users following API docs on older CLI versions; accounts not enrolled in the API-key rollout.","solutions":["Use a build/account where APIKeyManagement is enabled, or update the CLI","Create keys through the web UI if available, and use those in automation","As a Warp developer, override the flag or add FeatureFlag::APIKeyManagement to DOGFOOD_FLAGS and rebuild"],"exampleFix":"# before\n$ oz api-key create --name ci\nError: invalid value 'api-key'\n\n# after\nif FeatureFlag::APIKeyManagement.is_enabled() {\n    api_key::run(ctx, global_options, cmd)?;\n}","handlingStrategy":"validation","validationCode":"if matches!(cmd, CliCommand::ApiKey(_))\n    && !FeatureFlag::APIKeyManagement.is_enabled()\n{\n    anyhow::bail!(\"API key management is gated in this build\");\n}","typeGuard":"pub fn api_key_cmd_available() -> bool {\n    FeatureFlag::APIKeyManagement.is_enabled()\n}","tryCatchPattern":"match agent_sdk::run(ctx, opts, cmd) {\n    Err(e) if e.to_string() == \"invalid value 'api-key'\" => {\n        // create keys via web UI; do not retry here\n    }\n    result => result?,\n}","preventionTips":["Never mint credentials inside the hot path of every run; provision once, reference by name","Check APIKeyManagement before automating key rotation","Alert on gate errors in credential automation - silent skips cause expired keys"],"tags":["cli","feature-flags","api-key","rust","warp"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}