canvas-code-execution

Execute Python and JavaScript code securely in a sandboxed Canvas environment.

1|Updated Oct 9, 2025
One-click install
npx skills add https://github.com/omerakben/omer-akben --skill canvas-code-execution
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: canvas-code-execution
Source: https://github.com/omerakben/omer-akben/tree/main/.claude/skills/canvas-code-execution
Command: npx skills add https://github.com/omerakben/omer-akben --skill canvas-code-execution

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enables secure, in-browser code execution for Python and JavaScript within a sandboxed Canvas environment, addressing the challenge of running user-provided code safely without leaving the page.

Core Features & Use Cases

  • Pyodide-based Python execution with micropip package management for on-demand dependencies.
  • JavaScript/TypeScript execution via a restricted iframe sandbox with Monaco editor integration for quick experimentation.
  • Robust error handling, timeouts, and security policies (package allowlists, blocklists, and sandbox restrictions).
  • Integration with a dedicated execution manager to coordinate loading, execution, and result reporting.
  • Real-world use case: build a learning playground where students run small Python snippets and see live output within the canvas.

Quick Start

Load the canvas-code-execution skill, initialize the Pyodide-based Python runtime, and run a simple snippet like print('Hello Canvas') in a sandboxed environment.

Frequently Asked Questions about canvas-code-execution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Python in the browser securely without a backend server?

You can run Python in the browser securely by using Pyodide within a sandboxed Canvas environment. This approach executes user-provided code safely on the client side, eliminating the need for a backend server while maintaining strict security constraints.

How to execute untrusted JavaScript code in an iframe sandbox?

To execute untrusted JavaScript in an iframe sandbox, use a restricted iframe environment with enforced allowlists and blocklists. This security model, combined with a dedicated execution manager, safely isolates code execution and reports results without compromising the parent page.

Can I install and manage Python packages in a browser sandbox using micropip?

Yes, you can manage Python packages in a browser sandbox using micropip. This Skill integrates micropip for on-demand dependency installation within the Pyodide runtime, allowing you to load specific packages securely during execution.

What is the best way to handle timeouts and errors during in-browser code execution?

The best way to handle timeouts and errors during in-browser code execution is through a modular execution manager architecture. This dedicated manager coordinates loading, enforces execution timeouts, and captures robust error reporting across security constraints.

What are the limitations of using a sandboxed iframe for JavaScript execution?

Limitations of using a sandboxed iframe for JavaScript execution include strict security policies like package blocklists and sandbox restrictions. While safe, these constraints limit direct access to the parent DOM and require a dedicated execution manager for result reporting.

How do I integrate a Monaco editor for a live Python snippet playground?

You can integrate a Monaco editor for a live Python snippet playground by loading this Skill and initializing the Pyodide-based runtime. The modular architecture includes Monaco editor integration, allowing users to write, execute, and see live output within the Canvas.