Guides
Code sandbox
When a question needs computation, the agent writes Python and runs it in an isolated cloud sandbox.
How it runs
The agent writes Python and runs it with run_python_code in an E2B cloud sandbox. The code and its output appear in the chat. Nothing runs on your computer, and your runs go to a sandbox of your own.
Each chat has its own sandbox. Python and bash in that chat share it, so a file one step writes is there for the next, and variables stay defined between turns.
What is installed
The sandbox image comes with these tools, so a run starts without installing them:
- Data and statistics: NumPy, pandas, SciPy, statsmodels, scikit-learn, pingouin, lifelines for survival analysis, and PyMC with ArviZ for Bayesian models.
- RNA-seq: R 4.5 with DESeq2, edgeR, limma, apeglm and tximport, plus salmon and samtools.
- Genomic files: pysam, bcftools, bedtools, tabix and bgzip for VCF, BAM and BED files.
- Single cell: scanpy and anndata, with Leiden clustering and UMAP.
- Structures and docking: AutoDock Vina, Open Babel, RDKit, meeko, PDBFixer, OpenMM, MDAnalysis and gemmi, plus PyMOL (open source).
- Microbiome, CRISPR screens and proteomics: scikit-bio, MAGeCK and pyOpenMS.
- Sequences and trees: Biopython, bioservices, ete3, primer3, MAFFT, IQ-TREE 2, FastTree and trimAl.
- Enrichment: gseapy and g:Profiler.
- Networks and plots: NetworkX, Matplotlib, seaborn and Plotly, with PNG export.
- Files and web: requests, Pillow and pypdf.
Note
A chat started before these tools were added moves to the new sandbox at its next run, and the chat says so once. Its files are kept; Python variables from earlier runs are not.
Files
Python, bash and background jobs work in the same folder of the chat's sandbox, as the same user, so a file one step writes is there for the next at the same path.
You can list the files a run writes and download them from the chat: plots, tables and anything else the code saves to the outputs folder.
A database tool can also save a whole list into the sandbox as a JSON file, every row, for the code to read: GO annotations, GWAS associations, UniProt, PDB and GEO search results, ChEMBL measurements, clinical trials, gnomAD variants, Reactome pathways, orthologs, gene lists and more. The answer states how the file is laid out, read from what was written: a list of rows, how many, and their fields. When the database serves a list a page at a time, the tool reads every page. When a list would take longer to read than the tool call may run, the answer says which rows the file holds and how to save the rest.
An Excel workbook can be made straight from such a file, or from a CSV table the code wrote. The rows go from the file into the workbook, so every saved row arrives exactly as it was saved, however long the list.
Limits
| Limit | Value |
|---|---|
| Code size | 1 MB per run |
| One run | Up to 45 seconds for Python and 2 minutes for a shell command. Longer work, such as docking or a large alignment, runs as a background job, and its result is posted in the chat when it ends. |
| Sandbox lifetime | Each chat keeps its own sandbox. It pauses one minute after the last run and resumes in about a second on the next one, with its files and Python variables, until the chat is deleted. A background job keeps it running until the job ends. |
| Code sandbox time | Time your analyses run on RBAi’s private code machine. Paused time is free. Set by your plan while it is limited; the plans table lists it (Plans). One hour is an hour of the standard sandbox (2 vCPU, 2 GB); a larger sandbox counts in proportion. A notice comes at 80%. At 100%, new sandbox runs wait for the next month, unless you turn on Keep computing on credits in Settings → Usage & billing: then code keeps running and each minute past the hours is charged in credits at the price in the plans table, a larger sandbox in proportion. A run first holds a block of credits, shown beside the switch, and gives back what it did not use; when your credits run out, background jobs stop and new runs are refused. |