{"record":{"id":"29e9f0e5e8f965b0","repo":"denoland/deno","slug":"permissions-were-found-in-the-config-file-did","errorCode":null,"errorMessage":"{} permissions were found in the config file. Did you mean to run with `-P` or a permission flag?\n    at {}","messagePattern":"(.+?) permissions were found in the config file\\. Did you mean to run with `-P` or a permission flag\\?\n    at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/args/mod.rs","lineNumber":1302,"sourceCode":"      if !self.flags.has_permission() {\n        let set_config_permission_name = match &self.flags.subcommand {\n          DenoSubcommand::Bench(_) => dir\n            .to_bench_permissions_config()?\n            .filter(|permissions| !permissions.permissions.is_empty())\n            .map(|permissions| (\"Bench\", &permissions.base)),\n          DenoSubcommand::Compile(_) | DenoSubcommand::Desktop(_) => dir\n            .to_compile_permissions_config()?\n            .filter(|permissions| !permissions.permissions.is_empty())\n            .map(|permissions| (\"Compile\", &permissions.base)),\n          DenoSubcommand::Test(_) => dir\n            .to_test_permissions_config()?\n            .filter(|permissions| !permissions.permissions.is_empty())\n            .map(|permissions| (\"Test\", &permissions.base)),\n          _ => None,\n        };\n        if let Some((name, config_file_url)) = set_config_permission_name {\n          // prevent people from wasting time wondering why benches/tests are failing\n          bail!(\n            \"{} permissions were found in the config file. Did you mean to run with `-P` or a permission flag?\\n    at {}\",\n            name,\n            config_file_url\n          );\n        }\n      }\n\n      None\n    };\n    Ok(config_permissions)\n  }\n\n  fn augment_import_permissions(&self, options: &mut PermissionsOptions) {\n    // do not add if the user specified --allow-all or --allow-import\n    if options.allow_import.is_none() {\n      options.allow_import = Some(self.implicit_allow_import());\n    }\n  }","sourceCodeStart":1284,"sourceCodeEnd":1320,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/cli/args/mod.rs#L1284-L1320","documentation":"For subcommands whose permissions come from flags rather than the graph (compile, test, bench, desktop), Deno refuses to silently apply a permissions block found in the config file. If such a block exists and -P / permission flags were not passed, argument parsing bails with this hint, naming the subcommand category and the config file location.","triggerScenarios":"Running deno test, deno bench, deno compile (or desktop) while deno.json contains a \"permissions\" object, without -P and without any permission flag on the command line.","commonSituations":"Sharing one deno.json between deno run (which honors config permissions) and deno test/compile (which require opt-in); CI scripts that start failing after permissions were added to the shared config; Deno upgrades that tightened this behavior.","solutions":["Pass -P / --permissions to explicitly opt into the config-file permissions for this subcommand","Or pass the needed permission flags directly (--allow-read, --allow-net, ...)","Or scope the permissions block so test/bench/compile don't see it (separate config via --config)"],"exampleFix":"# before\ndeno test\n# deno.json: { \"permissions\": { \"read\": true } }\n\n# after\ndeno test -P\n# or: deno test --allow-read","handlingStrategy":"validation","validationCode":"# Detect the conflict before running the subcommand\nif grep -q '\"permissions\"' deno.json 2>/dev/null; then\n  # test/bench/compile need explicit opt-in\n  deno test -P\nelse\n  deno test\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a separate config for test/bench/compile runs when the main config carries permissions","Make CI scripts pass -P or explicit permission flags so config edits cannot break them"],"tags":["permissions","config-file","deno-test","deno-compile","cli-flags"],"backgroundTag":"permission-config-conflict","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}