# execute_code

Execute arbitrary Python code inside Blender. Has access to bpy, mathutils, math, os.

Agent View of the PolicyLayer registry record for `execute_code`. HTML page: https://policylayer.com/tools/dwgx-blender-copilot/execute-code

## Facts

- Tool: `execute_code`
- Server: Blender Copilot MCP Server (`dwgx/blender-copilot`) — https://policylayer.com/tools/dwgx-blender-copilot.md
- Homepage: https://github.com/dwgx/blender-copilot
- 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": "execute_code",
    "arguments": {}
  }
}
```

## Why execute_code is rated High

This tool allows running arbitrary Python code within Blender's process, including system-level operations via the 'os' module. An AI agent could use this to modify files, execute system commands, exfiltrate data, or cause uncontrolled changes to the 3D scene or host system.

From the tool's own definition: "Tool explicitly states 'Execute arbitrary Python code inside Blender' with access to 'bpy, mathutils, math, os'. The word 'arbitrary' and inclusion of 'os' module confirms unrestricted code execution capability."

## Use case

AI agents invoke execute_code to trigger actions in Blender Copilot 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 Blender Copilot MCP Server:

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

## Other tools on Blender Copilot MCP Server (306)

- `anim_clear_all` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/anim-clear-all.md
- `anim_delete_keyframe` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/anim-delete-keyframe.md
- `apply_modifier` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/apply-modifier.md
- `batch_delete` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/batch-delete.md
- `blender_new_file` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/blender-new-file.md
- `clear_animation` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/clear-animation.md
- `delete_object` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/delete-object.md
- `modifier_remove` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/modifier-remove.md
- `optimize_scene` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/optimize-scene.md
- `physics_remove` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/physics-remove.md
- `remove_constraint` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/remove-constraint.md
- `remove_modifier` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/remove-modifier.md
- `scene_cleanup` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/scene-cleanup.md
- `uv_remove_layer` — Destructive — https://policylayer.com/tools/dwgx-blender-copilot/uv-remove-layer.md
- `bake_ao` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/bake-ao.md
- `bake_physics` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/bake-physics.md
- `bake_textures` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/bake-textures.md
- `blender_launch` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/blender-launch.md
- `blender_open_file` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/blender-open-file.md
- `bmesh_operation` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/bmesh-operation.md
- `build_material_nodes` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/build-material-nodes.md
- `build_scene_from_json` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/build-scene-from-json.md
- `cloth_sim_model` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/cloth-sim-model.md
- `execute_script_headless` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/execute-script-headless.md
- `execute_script_on_file` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/execute-script-on-file.md
- `ft_sculpt_shape_key` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/ft-sculpt-shape-key.md
- `ft_setup_eye_tracking_full` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/ft-setup-eye-tracking-full.md
- `generate_hunyuan3d_model` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/generate-hunyuan3d-model.md
- `generate_hyper3d_model_via_images` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/generate-hyper3d-model-via-images.md
- `generate_hyper3d_model_via_text` — Execute — https://policylayer.com/tools/dwgx-blender-copilot/generate-hyper3d-model-via-text.md
- …and 276 more: https://policylayer.com/tools/dwgx-blender-copilot.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=dwgx-blender-copilot · API: https://policylayer.com/registry/api · Policy library: https://policylayer.com/policies/dwgx-blender-copilot
