{"record":{"id":"14dcf6341abe89f0","repo":"Hmbown/CodeWhale","slug":"tool-name-was-called-with-a-network-address-but","errorCode":null,"errorMessage":"Tool {name} was called with a network address, but this agent runs with no network capability (`network_tool = false`). Local sources are still available; a remote one needs a member whose saved ceiling grants network tools.","messagePattern":"Tool (.+?) was called with a network address, but this agent runs with no network capability \\(`network_tool = false`\\)\\. Local sources are still available; a remote one needs a member whose saved ceiling grants network tools\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/subagent/mod.rs","lineNumber":18311,"sourceCode":"/// - `rlm{action:\"open\", url:...}` calls `FetchUrlTool::execute` directly.\n/// - `review{target:\"https://github.com/o/r/pull/1\"}` shells out to `gh pr\n///   diff`, which is the network by way of a subprocess.\n///\n/// Both are now unreachable by name as well (`rlm_open` is denied outright;\n/// `review`'s local forms are the ones worth keeping), so this is the layer that\n/// catches the *next* one — a tool that grows a `url` field after this list was\n/// written. It fails closed and names the posture, so the refusal reads as a\n/// contract rather than a malfunction.\nfn reject_network_reaching_input(name: &str, input: &Value) -> Result<()> {\n    let github_shell_read = matches!(name, \"bash\" | \"Bash\" | \"exec_shell\")\n        && input\n            .get(\"command\")\n            .and_then(Value::as_str)\n            .is_some_and(codewhale_execpolicy::command_safety::is_github_readonly_command);\n    if !github_shell_read && !carries_network_url(input) {\n        return Ok(());\n    }\n    Err(anyhow!(\n        \"Tool {name} was called with a network address, but this agent runs with no network \\\n         capability (`network_tool = false`). Local sources are still available; a remote one \\\n         needs a member whose saved ceiling grants network tools.\"\n    ))\n}\n\n/// Refuse the unbounded forms of the verification surface for a write-denied\n/// child.\n///\n/// A read-only member keeps `Run` / `run_tests` / `run_verifiers` on purpose:\n/// running the checks is what a verifier is *for*, and removing them would make\n/// the role useless. But both tools accept an escape hatch that is not\n/// verification at all — `run_verifiers` takes `commands`, an array of arbitrary\n/// `program` + `args` pairs, and `run_tests` takes `args`, a raw cargo argv.\n/// `{\"program\": \"bash\", \"args\": [\"-lc\", \"rm -rf src\"]}` is exactly the raw shell\n/// that [`crate::fleet::role::RAW_SHELL_DENYLIST`] just removed, re-entered\n/// through the one door that was left open for honest reasons.\n///","sourceCodeStart":18293,"sourceCodeEnd":18329,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/tools/subagent/mod.rs#L18293-L18329","documentation":"Sub-agents run under a capability model: when `network_tool = false`, the guard rejects any tool invocation that carries a network address. Only tools whose input matches a GitHub read-only shell command or carries no network URL pass. The error directs the caller to a role whose saved ceiling grants network tools.","triggerScenarios":"Calling a tool (e.g. fetch/exec-family) from a sub-agent with `network_tool = false` while the input contains a network URL, or a shell command that is not on the GitHub read-only allowlist (`codewhale_execpolicy::command_safety::is_github_readonly_command`).","commonSituations":"Spawning a researcher sub-agent without network capability and asking it to fetch a remote URL; asking a read-only agent to `git clone` from a remote; a prompt instructs the agent to download something while the saved ceiling disallows network.","solutions":["Use a role/member whose saved capability ceiling grants network tools","Switch the source to a local one (local file/path) instead of a network address","Restructure the command to a GitHub read-only command form if that suffices"],"exampleFix":"// before\nspawn_subagent(role: \"verifier\", network_tool: false)\nsubagent.call(\"exec\", { command: \"curl https://example.com/data.json\" })\n// after\nspawn_subagent(role: \"researcher\", network_tool: true)\nsubagent.call(\"exec\", { command: \"curl https://example.com/data.json\" })","handlingStrategy":"validation","validationCode":"if (!agent.networkTool && /https?:\\/\\//.test(JSON.stringify(input))) {\n  throw new Error('network tool required for remote URL');\n}","typeGuard":"const carriesNetworkUrl = (input) => JSON.stringify(input).match(/https?:\\/\\/[^\\s\"']+/) !== null;","tryCatchPattern":null,"preventionTips":["Match sub-agent roles to the task's network needs before spawning","Prefer local sources when the role has no network ceiling","Keep capability ceilings in saved role config documented"],"tags":["subagent","network","capability-guard"],"backgroundTag":"permission-denied","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}