Skip to content

Shell tool allowlist network policy broken #2920

@SvenDH

Description

@SvenDH

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

I get this error when I add allowlist network policy with our production domains to an agent with a shell tool:

An error occurred while processing your request. You can retry your request, or contact us through our help center at [help.openai.com](http://help.openai.com/) if the error persists. Please include the request ID req_3b0917dca27342dda56901e1a1c05306 in your message.

It does not occur when network policy is disabled. The domains in allowed_domains are in Container network mode in the data controls in platform.openai.com. Another thing to note is that it was still working on Feb 26.

To Reproduce

  1. Add a domain (e.g. "google.com" as in the code snippet) to platform.openai.com > Data control > Hosted tools > Container network mode > allowlist
  2. Run the included code snippet
  3. Result:
    Error code: 500 - {'error': {'message': 'An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID req_XXXXX in your message.', 'type': 'server_error', 'param': None, 'code': 'server_error'}}

Code snippets

from openai import APIStatusError, OpenAI

client = OpenAI()

try:
    response = client.responses.create(
        model="gpt-5.2",
        input="Use shell tool and run: curl google.com",
        tools=[
            {
                "type": "shell",
                "environment": {
                    "type": "container_auto",
                    "network_policy": {
                        "type": "allowlist",
                        "allowed_domains": ["google.com"],
                    },
                },
            }
        ],
    )
    print("response_id:", response.id)
    print("status:", response.status)
    print("output_text:", response.output_text)
except APIStatusError as e:
    print("http_status:", e.status_code)
    print("request_id:", e.request_id)
    print("error:", e)

OS

Ubuntu 24.04

Python version

Python v3.13.3

Library version

openai v2.24.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions