Code Execution
Karma One provides a cloud-based code sandbox powered by E2B, allowing you to write, run, and iterate on code directly within your conversation. No local setup required.
Cloud Sandbox Overview
Every code execution session runs in an isolated E2B sandbox -- a secure, ephemeral virtual machine in the cloud. Each sandbox comes pre-configured with common runtimes and libraries so you can start coding immediately.
| Feature | Details | |---------|---------| | Runtimes | Python 3.11+, Node.js 20+ | | Isolation | Each session runs in its own container with no access to other users' data | | Persistence | Files persist within a session but are cleaned up after the sandbox expires | | Networking | Outbound HTTP requests are supported (e.g., fetching APIs) |
One-Click Code Run
You do not need to ask the AI to "run" your code in a special way. Simply describe what you want:
"Calculate the compound interest on $10,000 at 5% over 10 years."
"Write a Python script that fetches the top 10 Hacker News stories."
"Sort this CSV data by the 'revenue' column and show the top 5 rows."
The AI will generate the code, execute it in the sandbox, and return the results inline.
Tip: If the AI shows you code but does not execute it, say "Please run this code" to trigger execution.
Data Analysis and Chart Generation
One of the most powerful use cases is data analysis. Upload a file (CSV, JSON, Excel) and ask the AI to analyze it:
"Here's our sales data. Show me monthly revenue trends as a line chart."
"Find the correlation between temperature and ice cream sales in this dataset."
"Create a bar chart comparing Q1 vs Q2 performance by region."
Charts are rendered as images and displayed directly in the conversation. You can download them or ask for modifications.
Pre-Installed Libraries
The Python sandbox comes with a rich set of pre-installed packages:
| Category | Libraries | |----------|-----------| | Data Analysis | pandas, numpy, scipy, statsmodels | | Visualization | matplotlib, seaborn, plotly | | Machine Learning | scikit-learn, xgboost | | Web & APIs | requests, beautifulsoup4, httpx | | File Processing | openpyxl, python-docx, PyPDF2, Pillow | | Utilities | json, csv, re, datetime (standard library) |
The Node.js sandbox includes common npm packages and supports require() for built-in modules.
Tip: If you need a package that is not pre-installed, ask the AI to install it. For example: "Install the
yfinancepackage and fetch Apple's stock price history."
Uploading Files to the Sandbox
You can upload files directly into the sandbox for processing:
- Attach a file to your message (drag-and-drop or use the attachment button).
- The file is transferred into the sandbox's working directory.
- Ask the AI to process it.
"I've uploaded sales_2025.xlsx. Create a pivot table by product category."
"Parse the uploaded JSON file and extract all email addresses."
Supported upload formats include CSV, JSON, JSONL, Excel (.xlsx), text files, images, and more.
Viewing Results
Execution results appear in several forms depending on the output:
| Output Type | Display | |-------------|---------| | Text / Numbers | Rendered inline in the conversation | | Tables | Formatted as markdown tables or code blocks | | Charts / Images | Displayed as embedded images with download option | | Files | Available as downloadable links | | Errors | Shown with traceback; the AI will attempt to fix and re-run |
When the AI encounters an error, it automatically diagnoses the issue, modifies the code, and retries -- often without you needing to intervene.
Security and Isolation
Your code runs in a fully sandboxed environment:
- No access to your device. The sandbox cannot read your local files, clipboard, or system information.
- No cross-session leakage. Each sandbox is independent. One user's session cannot interact with another's.
- Network restrictions. The sandbox can make outbound HTTP requests but does not expose any inbound ports.
- Automatic cleanup. Sandboxes are destroyed after a period of inactivity, and all files are deleted.
Sandbox Sizes
Depending on your workload, Karma One selects an appropriate sandbox size:
| SKU | CPU | Memory | Best For | |-----|-----|--------|----------| | S | 1 core | 2 GB | Simple scripts, small datasets | | M | 2 cores | 4 GB | Medium data analysis, charting | | L | 4 cores | 8 GB | Large datasets, ML training | | XL | 8 cores | 16 GB | Heavy computation, large-scale processing |
Usage Limits
- Each code execution has a default timeout of 60 seconds. Long-running tasks may be terminated.
- Sandbox sessions expire after a period of inactivity (typically 15-30 minutes).
- File uploads are subject to size limits based on your plan.
- Extremely resource-intensive operations (e.g., training a large neural network) may be throttled.
Example Workflows
Quick Calculation
"What is 17% of 4,350?"
Data Cleaning
"Remove all rows with missing values from the uploaded CSV file and export a cleaned version."
API Integration
"Fetch the current Bitcoin price from CoinGecko and plot the 30-day trend."
File Conversion
"Convert the uploaded Markdown file to a PDF."
Best Practices
- Describe your goal, not just the code. Saying "Analyze this sales data and find the top-performing product" is more effective than pasting raw code.
- Iterate naturally. If the first result is not quite right, say "Make the chart bigger" or "Add a legend" -- the AI remembers the context.
- Use file uploads for datasets larger than what you can paste into a chat message.
- Check the output. While the AI is highly capable, always verify results for critical business decisions.