> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profy.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox

> Every Expert has an isolated cloud development environment

The sandbox is the Expert's **isolated cloud execution environment**. Whenever you have a conversation with an Expert that requires code execution or file management, the platform automatically allocates a sandbox for you. You don't need to install any software or configure any environment — everything works out of the box.

## What Can the Sandbox Do

<CardGroup cols={2}>
  <Card title="Run Code" icon="play">
    The Expert can write and execute code, supporting Python, JavaScript/TypeScript, Shell, and more
  </Card>

  <Card title="Build Websites" icon="globe">
    Using pre-installed web development frameworks, the Expert can create websites and provide live previews
  </Card>

  <Card title="Process Files" icon="file-lines">
    Read and write files, parse data, generate documents — the sandbox has a complete file system
  </Card>

  <Card title="Install Dependencies" icon="download">
    The Expert can install additional packages and tools on demand
  </Card>
</CardGroup>

## Pre-installed Environment

The sandbox image comes pre-installed with commonly used development tools and frameworks, ready for the Expert to use:

<Tabs>
  <Tab title="Runtimes">
    * **Bun**: JavaScript/TypeScript runtime and package manager
    * **Python**: Common data science and scripting tools
    * **Node.js**: JavaScript runtime
    * Common system tools: curl, jq, etc.
  </Tab>

  <Tab title="Web Development">
    The sandbox comes with a pre-installed web development scaffold:

    * Project templates based on modern web frameworks
    * `node_modules` pre-installed (saving installation wait time)
    * Development server with hot module replacement (HMR) support

    <Tip>
      The web development scaffold is located at `/home/user/project/web/` in the sandbox. The Expert performs development work in a separate working directory.
    </Tip>
  </Tab>
</Tabs>

## Sandbox Isolation

Each user-Expert combination has its own isolated sandbox environment:

* **User isolation**: Your sandbox is completely isolated from other users and invisible to them
* **Expert isolation**: Sandboxes for different Experts are also isolated — Expert A's files won't appear in Expert B
* **Security boundary**: Code execution within the sandbox is protected by resource limits and security policies

<Warning>
  The sandbox is a cloud environment — do not store sensitive passwords or keys in it. For third-party services, use environment variables instead.
</Warning>

## On-Demand Startup

The sandbox uses a **lazy start** strategy — resource-intensive services are only started when needed:

1. **Text-only conversations**: No sandbox is started, no execution environment resources consumed
2. **Code execution needed**: Sandbox starts automatically (typically ready within seconds)
3. **Website preview needed**: Development server starts on demand after the sandbox is running

This design ensures you only consume compute resources when truly needed — regular Q\&A conversations incur no extra overhead.

<Note>
  The first sandbox startup may take a few seconds. In subsequent interactions, the sandbox remains active and responds more quickly.
</Note>

## File Persistence

The sandbox uses a **persistent cloud file system (CFS)** for file storage:

* Code, documents, images, and other files generated by the Expert are automatically saved
* Files are not lost when you close the browser
* When you reopen a conversation with the same Expert, your previous files are still there
* Multiple sessions with the same Expert share the same workspace file system

### File Sync

During a conversation, files created or modified by the Expert are automatically synced to your file panel. In the file browser on the right side of the conversation interface, you can:

* Browse the file directory structure
* Open and read file contents
* Download files to your local machine

## Website Preview

When the Expert builds a website, you can view it in real time in the preview panel on the right side of the conversation interface:

* **Live refresh**: After the Expert modifies code, the preview updates automatically
* **Hot reload**: Supports HMR (Hot Module Replacement) for instant changes
* **Full-screen view**: The preview panel can be expanded to full-screen mode

<Tip>
  The preview panel only appears after the Expert has started a development server. If you need a preview, tell the Expert "help me preview the website."
</Tip>

## Storage Limits

Sandbox storage is limited by your subscription plan:

| Plan       | Storage                   |
| ---------- | ------------------------- |
| Free       | Basic storage             |
| Paid Plans | Larger storage            |
| Team Plan  | Shared team storage quota |

<Note>
  Specific storage quotas are shown in the product in real time. When limits are exceeded, you can clean up unnecessary files or upgrade your plan.
</Note>

## Sandbox and the Sites Plugin

If you have the Sites plugin enabled, websites built by the Expert can be published to the public internet:

1. The Expert completes website development in the sandbox
2. You confirm the result in the preview panel
3. Click the "Publish" button
4. The website is deployed to the public internet with an accessible URL

<Note>
  Website publishing requires your confirmation — the Expert will not publish automatically. You always control the publishing decision.
</Note>

## Next Steps

<CardGroup cols={2}>
  <Card title="Sessions & Workspace" icon="comments" href="/en/documentation/concepts/sessions-and-workspace">
    Learn about the relationship between sessions and workspaces
  </Card>

  <Card title="Plugins" icon="plug" href="/en/documentation/concepts/plugins">
    Learn about the plugins and tool capabilities available to Experts
  </Card>
</CardGroup>
