# Running code on your device

Python and JavaScript in a reply can be run right where they are, in a sandbox on your own device. It is free, and nothing leaves the device.

## The Run button

Python and JavaScript code blocks in Nymbot's replies have a **Run** button. Press it and the code runs in a sandbox inside the app: a locked-down frame that cannot see your keys, your chats or the rest of the app, running in the background so a runaway loop never freezes anything.

JavaScript starts at once. Python is loaded onto your device from Nymbot's own site the first time you run something, about 14 MB plus any libraries the code imports, and starts faster after that.

For other languages, or for code that needs the internet or more time, use [Run on server](https://nymbot.ai/docs/server-runs/) instead.

## What comes back

The results appear under the code block: what it printed, any errors, and the value of the last line. Tables are shown as tables, charts are drawn as pictures, and files the code wrote get a **Save** button.

**Send output to Nymbot** puts the output in the composer, so you can ask about it. It is not sent until you send it.

## Using attached files

The text of the documents attached to the chat is available to the code as files, by name, so you can attach a CSV and ask for code that reads it. The files are handed to the sandbox on your device and are not uploaded anywhere.

## What it cannot do

- **No network.** The code cannot fetch web pages, call APIs or install packages from the internet. Python can import only the libraries Nymbot serves for it.
- **30 seconds.** A run that takes longer is stopped and its sandbox thrown away.
- **A fresh sandbox per chat.** Moving to another chat throws the old sandbox away, so nothing from one chat's runs is left for another's.
- **Only what the device can do.** It runs in the app on your device, so heavy work is limited by your device's speed and memory.

What the code works on, and what it produces, stays on your device.
