openai / openai/openai-python

Shell tool allowlist network policy broken

Open
#2,920 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
31.6k
Forks
5.7k
Avg merge
1d 6h
Merged PRs (30d)
96

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure through responses.create with the shell tool and the allowlist network_policy shown in the issue, comparing it with network policy disabled. Trace the Python library's request path for this payload and use the reported server_error and request ID to distinguish client serialization from an API-side failure. Done means the allowlisted request no longer returns HTTP 500.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.