{"record":{"id":"3a58a2edf9d3eae5","repo":"HKUDS/nanobot","slug":"blocked-unsafe-generated-image-url-error","errorCode":null,"errorMessage":"blocked unsafe generated image URL: {error}","messagePattern":"blocked unsafe generated image URL: (.+?)","errorType":"exception","errorClass":"ImageGenerationError","httpStatus":null,"severity":"error","filePath":"nanobot/providers/image_generation.py","lineNumber":182,"sourceCode":"            \"trust_env\": False,\n        }\n        if proxy:\n            # An explicit provider proxy is a user-selected trusted egress boundary.\n            # Validate each URL locally, while the proxy owns final DNS resolution.\n            client_kwargs[\"proxy\"] = proxy\n        else:\n            client_kwargs[\"transport\"] = PinnedDNSAsyncTransport(inner=transport)\n\n        async with httpx.AsyncClient(**client_kwargs) as client:\n            current_url = url\n            for _ in range(_IMAGE_DOWNLOAD_MAX_REDIRECTS + 1):\n                if proxy:\n                    ok, error, _ = resolve_url_target(\n                        current_url,\n                        trust_remote_dns=True,\n                    )\n                    if not ok:\n                        raise ImageGenerationError(\n                            f\"blocked unsafe generated image URL: {error}\"\n                        )\n                async with client.stream(\"GET\", current_url) as response:\n                    if response.is_redirect:\n                        location = response.headers.get(\"location\")\n                        if not location:\n                            raise ImageGenerationError(\n                                \"generated image URL redirected without a location\"\n                            )\n                        current_url = urljoin(str(response.url), location)\n                        continue\n\n                    try:\n                        response.raise_for_status()\n                    except httpx.HTTPStatusError as exc:\n                        raise ImageGenerationError(\n                            f\"failed to download generated image (HTTP {response.status_code})\"\n                        ) from exc","sourceCodeStart":164,"sourceCodeEnd":200,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/providers/image_generation.py#L164-L200","documentation":"Error \"blocked unsafe generated image URL: {error}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/providers/image_generation.py:182 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}