Forum Discussion
URLs not accessible when running python script in sandbox
The 403 is expected sandbox behavior, not a malformed requests call. The screenshot shows x-ms-block-by: sandbox-proxy and says the URL is not relevant to the conversation. Microsoft documents Code Interpreter as an isolated Python environment that restricts network access and accesses only inputs provided in the session. You cannot make arbitrary requests.get calls succeed by changing the URL, headers, or timeout. For data analysis, download the source outside the sandbox, upload the permitted file to the conversation, and have the agent process it. If the agent needs live data, expose the approved service through a supported connector, agent action, or API integration and authenticate there; use Code Interpreter only for returned data. For a simple HTTP test, run the script in your local Python environment. If a URL supplied through an approved integration is still blocked, capture the 403 headers and conversation ID and raise an administrator support case.