# Secure Python Code Sandbox

## Links

- Product page URL: https://www.agentpmt.com/marketplace/secure-python-code-sandbox
- Product markdown URL: https://www.agentpmt.com/marketplace/secure-python-code-sandbox?format=agent-md
- Product JSON URL: https://www.agentpmt.com/marketplace/secure-python-code-sandbox?format=agent-json

## Overview

- Product ID: 689f48d98ee2d1dd79e9035e
- Vendor: Apoth3osis
- Type: compute
- Unit type: request
- Price: 1000 credits
- Categories: Scientific Computing, Developer Tools, AI & Machine Learning, Python Execution & Isolation
- Generated at: 2026-05-30T20:15:15.104Z

### Page Description

For safely executing arbitrary Python code snippets within an isolated, secure environment. The sandbox comes pre-installed with common data science and web request libraries, including requests, NumPy, and pandas. It is ideal for performing quick computations, data transformations, or dynamic API calls without requiring external infrastructure.

### Agent Description

Execute arbitrary Python code in an isolated sandbox with pre-installed libraries (requests, NumPy, pandas). Returns stdout, stderr, and execution results.

## Details

### Details

For safely executing arbitrary Python code snippets within an isolated, secure environment. The sandbox comes pre-installed with common data science and web request libraries, including requests, NumPy, and pandas. It is ideal for performing quick computations, data transformations, or dynamic API calls without requiring external infrastructure.

### Use Cases

Dynamic Code Execution, Data Manipulation, On-the-fly Calculation, API Integration, Data Analysis, Custom Scripting, Algorithmic Tasks, Web Scraping

### Workflows Using This Tool

No public workflows currently reference this product.

### Related Content

No related content is currently linked to this product.

## Integration Details

### DynamicMCP

- Setup page URL: https://www.agentpmt.com/dynamic-mcp
- Claude setup guide: https://www.agentpmt.com/dynamic-mcp?platform=claude#videos
- ChatGPT setup guide: https://www.agentpmt.com/dynamic-mcp?platform=chatgpt#videos
- Cursor setup guide: https://www.agentpmt.com/dynamic-mcp?platform=cursor#videos
- Windsurf setup guide: https://www.agentpmt.com/dynamic-mcp?platform=windsurf#videos

Use the local router for command-based MCP clients. It forwards requests to `https://api.agentpmt.com/mcp` and does not execute tools locally.

```bash
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

### REST API

The live page renders cURL, Python, JavaScript, and Node.js examples. Logged-in users see those examples prefilled with their own API and budget credentials.

- Purchase endpoint: https://api.agentpmt.com/products/purchase
- Authorization format: `Bearer <base64(apiKey:budgetKey)>`

```bash
curl -X POST "https://api.agentpmt.com/products/purchase" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eW91ci1hcGkta2V5LWhlcmU6eW91ci1idWRnZXQta2V5LWhlcmU=" \
  -d '{
    "product_id": "689f48d98ee2d1dd79e9035e",
    "parameters": {
      "code": "example_code"
    }
  }'
```

### Autonomous Agents

Autonomous agents can access this tool through AgentAddress credit balances or direct x402 payments. Use the Autonomous Agent API reference for endpoint shapes after choosing the access pattern below.

- Autonomous Agent API reference URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents
- Autonomous Agent API reference markdown URL: https://www.agentpmt.com/docs/api-reference/autonomous-agents?format=agent-md
- Credit-Based Access Using AgentAddress: https://www.agentpmt.com/docs/autonomous-agents/credit-based-tool-usage-with-agentaddress
- AgentAddress is preferred for persistent file access, stored platform state, and maximum tool use ability across repeated calls.
- Direct x402 is for independent one-off tool calls that do not require shared files or stored platform state.
- Direct x402 public payments: USDC on Base, Arbitrum, Optimism, Polygon, and Avalanche.

### Schema

#### Parameters

- Schema type: flat

```json
{
  "code": {
    "type": "string",
    "description": "A string containing the Python code to be executed. The code must be self-contained.\n\nConstraints: Maximum of 50,000 characters.\nExample: \"import numpy as np\\ndata = np.array([1, 2, 3, 4, 5])\\nmean = np.mean(data)\\nprint(\\\"The mean is {}\\\".format(mean))\"",
    "required": true
  },
  "timeout_seconds": {
    "type": "number",
    "description": "The maximum number of seconds to allow the code to run before terminating the execution.\n\nDefault: 60\nConstraints: Must be an integer between 10 and 60.\n",
    "required": false,
    "minimum": 10,
    "maximum": 60
  }
}
```

### Frequently Asked Questions

#### How do I connect this tool to an external agent?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

#### How does an external agent use this tool?

- Page URL: https://www.agentpmt.com/faq
- Markdown URL: https://www.agentpmt.com/faq?format=agent-md

After the external agent is connected to an Agent Group that can use this tool, paste this prompt into the agent:

> Call the AgentPMT-Tool-Search-and-Execution tool with action 'get\_schema' and tool\_id 689f48d98ee2d1dd79e9035e ("Secure Python Code Sandbox"). Then call the same tool with action 'call\_tool', tool\_id 689f48d98ee2d1dd79e9035e, and the parameters needed for my request.

The agent should fetch the tool schema first, collect the required parameters for your request, and then call the tool through AgentPMT.

### Dependencies

This product has no public dependency products.