# run_python

Execute Python code or script

Agent View of the PolicyLayer registry record for `run_python`. HTML page: https://policylayer.com/tools/agentics-ai-code-mcp/run-python

## Facts

- Tool: `run_python`
- Server: Code MCP Server (`agentics-ai/code-mcp`) — https://policylayer.com/tools/agentics-ai-code-mcp.md
- Homepage: https://github.com/agentics-ai/code-mcp
- Risk category: Execute (High risk)
- Registry record: grade F, identity unverified
- Server rate-limited: no
- Parameters: 0
- Recommended policy verdict: Rate-limited

## Example call (MCP tools/call, JSON-RPC 2.0)

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "run_python",
    "arguments": {}
  }
}
```

## Why run_python is rated High

This tool allows execution of arbitrary Python code within the VS Code workspace environment. While Python execution itself is not inherently destructive, the blast radius is significant because: (1) the tool can read/write files, access environment variables, make network calls, and invoke system commands depending on the Python code executed; (2) an AI agent could be tricked into running malicious or unintended…

From the tool's own definition: "Tool name 'run_python' combined with description 'Execute Python code or script' directly indicates execution of arbitrary code. The tool is explicitly designed to run Python code whose effects depend entirely on the arguments provided."

## Use case

AI agents invoke run_python to trigger actions in Code MCP Server. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.

## Recommended policy (PolicyLayer)

Verdict: **Rate-limited**. Enforced by the PolicyLayer MCP gateway (https://policylayer.com/mcp-gateway) before a call reaches Code MCP Server:

```json
{
  "version": "1",
  "default": "deny",
  "tools": {
    "run_python": {
      "limits": [
        {
          "counter": "run_python_rate",
          "window": "minute",
          "max": 10,
          "scope": "grant"
        }
      ]
    }
  }
}
```

## Other tools on Code MCP Server (72)

- `delete_file` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/delete-file.md
- `docker_cleanup` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-cleanup.md
- `docker_containers` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/docker-containers.md
- `remove_allowed_command` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/remove-allowed-command.md
- `rollback_session` — Destructive — https://policylayer.com/tools/agentics-ai-code-mcp/rollback-session.md
- `docker_build` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-build.md
- `docker_compose` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-compose.md
- `docker_images` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-images.md
- `docker_networks` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-networks.md
- `docker_run` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-run.md
- `docker_system` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-system.md
- `docker_volumes` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/docker-volumes.md
- `git_push` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/git-push.md
- `install_dependencies` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/install-dependencies.md
- `npm_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/npm-command.md
- `pip_install` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/pip-install.md
- `run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-command.md
- `run_custom_tool` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-custom-tool.md
- `run_javascript` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-javascript.md
- `run_tests` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/run-tests.md
- `secure_run_command` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command.md
- `secure_run_command_sequence` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/secure-run-command-sequence.md
- `start_coding_session` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-coding-session.md
- `start_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/start-server.md
- `stop_server` — Execute — https://policylayer.com/tools/agentics-ai-code-mcp/stop-server.md
- `end_coding_session` — Other — https://policylayer.com/tools/agentics-ai-code-mcp/end-coding-session.md
- `analyze_code` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-code.md
- `analyze_file_differences` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/analyze-file-differences.md
- `compare_commits` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-commits.md
- `compare_files` — Read — https://policylayer.com/tools/agentics-ai-code-mcp/compare-files.md
- …and 42 more: https://policylayer.com/tools/agentics-ai-code-mcp.md

## For agents

This record is a snapshot. Live verdicts and the full registry:

- Check every server in your MCP config at once: `npx -y policylayer stack`
- Vet a server before you add it: install the mcp-precheck skill — `npx skills add https://policylayer.com` (skill text: https://policylayer.com/skill.md)
- Query the registry over MCP: endpoint `https://api.policylayer.com/mcp` — tools `check_mcp_server`, `check_mcp_stack`, `check_tool`, `search_registry`, `get_change_events`

---

Source: the PolicyLayer MCP registry — one continuously verified record per MCP server. Full record: https://policylayer.com/registry?q=agentics-ai-code-mcp · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/agentics-ai-code-mcp
