Skip to content

Code and sandbox ​

Some questions are best answered by running a small program: adding up a large spreadsheet, cleaning a list, drawing a chart or building an Excel report. Genie does this in a sandbox, a separate, secure computer that belongs to your conversation. You do not need to write any code; you just ask. This page explains when that happens and what you can see in the sandbox panel.

When Genie runs code ​

Genie runs code when the task needs it, for example:

  • "Total the order lines in this Excel file by branch and give me the top five products."
  • "Turn this CSV of deliveries into a chart of late deliveries per week."
  • "Make a Word summary of the Da Nang warehouse SOP with a checklist table."

You see the steps while Genie works: the commands it runs, their output and the files it writes. When it finishes, the answer explains the result and links the files it produced.

Code only runs when running code is on for your workspace, the workspace has a sandbox, and the agent you use may run code. The default assistant uses the sandbox when it has one; if your workspace has none, Genie answers without running code.

Open the sandbox panel ​

In a conversation, use the buttons at the top right of the chat:

  • Sandbox terminal: opens the sandbox panel.
  • The folder button with a number (View files generated in this reply): opens the panel on the files. It appears once the conversation has files.

The panel opens on the right. You can widen it by dragging its edge, and close it when you are done. It has these tabs:

TabWhat you see
FilesThe files Genie created in this conversation. Switch between This turn and All files, or search with Search filenames. Click a file to preview it, or download it
TerminalThe sandbox's command line, if you want to look around yourself
DesktopA remote desktop, only when your workspace has turned it on
Screenshot coming soonThe sandbox panel with the files and the terminalwebsite-docs/public/screenshots/en/sandbox-panel.png
The sandbox panel with the files and the terminal

Opening the panel does not start or wake the sandbox. Only the buttons in the Terminal and Desktop tabs do that.

Use the terminal ​

Most people never need the terminal; Genie runs the commands for you. If you want to check something yourself:

  1. Open the Terminal tab.
  2. Click the button the panel shows:
    • Start terminal when the sandbox is paused. This resumes it.
    • Create and start when the conversation has no running sandbox. This starts a new one, which may be billed to your workspace.
  3. Type your commands. If the connection drops, click Reconnect.

If the panel says No sandbox yet, and the current agent has no sandbox backend configured…, the agent you are using cannot run code. Switch to an agent that can, or simply ask a question that needs code.

Files are kept between turns ​

The sandbox belongs to the conversation, so you can build on earlier work:

  1. Ask for a first version: "Create an Excel sheet of monthly sales per branch."
  2. Then ask for changes: "Add a column with the growth versus last month and color the negative values red."

Genie reuses the files it already made. Files you attached to the conversation are there too.

Files Genie delivered to you are saved with the conversation: you find them in the Files tab and on the Artifacts page. See Files and artifacts.

Idle sandboxes ​

A sandbox does not run forever.

  • After a while without activity, the terminal or desktop disconnects (The terminal disconnected after being idle…) and the sandbox pauses. It keeps its files. Your next message, or Reconnect, resumes it.
  • After a long pause, or when the system needs the room, the sandbox is replaced by a fresh one. The files Genie delivered to you and the files you attached are still available, but anything else, such as scratch files or software installed by hand in the terminal, is gone. If your workspace keeps a persistent working folder, the files in it survive too.
  • After an update to Genie's skills, the sandbox can be rebuilt, and unsaved work in the terminal or desktop is lost.

So: when a file matters, ask Genie to deliver it as a file, then download it.

Good to know ​

  • Each conversation has its own sandbox. Files from one conversation are not visible in another. To continue a piece of work, stay in the same conversation, or attach the file again.
  • Rewinding or branching a conversation also brings the sandbox files back to that point when possible. See Conversations.
  • The desktop has one seat. Only one person can be connected to a conversation's desktop at a time.
  • Not every workspace runs code. Your system administrator sets up the sandbox and can turn running code off for the company; your workspace admin can turn it off for your workspace. If you never see code running, or the Artifacts item is missing from the sidebar, ask your admin.
  • Running a sandbox costs money for your company. Avoid starting one you do not need.
  • Code cannot see more than you can. Genie runs code on the files and data you gave it or that you may read.