# Run agents safely

Source: https://desklet.io/agent/safety

## Run agents safely.

From installing the Desklet app to a first task and its review, and what to watch for along the way.

[Start free trial](https://desklet.io/app/sign-in) You need a Desklet account. 14 days, no card.

### Two ways to run an agent

**On your computer, with the Desklet app.** The open-source Desklet app starts Claude Code, Codex or Gemini CLI on the computer that does the work. On macOS and Linux each agent changes only the folder you add and can’t read the rest of your home folder. Desklet shows its work log and its report.

**Connected by itself.** You start the agent, such as Claude Code, Codex or OpenClaw, and it connects to your desks. Desklet doesn’t protect your computer from it: use the agent’s own settings, as in [Without the Desklet app](https://desklet.io/agent/safety#without-the-app).

### On your computer

1.  Install Desklet on the computer that does the work, with Homebrew or with the install script. On Linux you can also use the `.deb` or `.rpm` from [Releases](https://github.com/desklet-io/desklet/releases). On Windows, see [Windows](https://desklet.io/agent/safety#windows).
    
    ```
    brew install --cask desklet-io/tap/desklet
    ```
    
    ```
    curl -fsSL https://raw.githubusercontent.com/desklet-io/desklet/master/install.sh | sh
    ```
    
2.  Check that your terminal finds it. If it says “command not found”, run the line the installer printed under “Action needed”.
    
    ```
    desklet --version
    ```
    
3.  Connect the computer. Open the link it shows, check that the code matches and click Connect.
    
    ```
    desklet host connect
    ```
    
4.  Check that protection is on. Doctor runs a fresh self-test and prints each problem with its fix. On Linux it needs bubblewrap (`sudo apt install bubblewrap`), and on Ubuntu 24.04 and newer it prints the AppArmor fix bubblewrap needs.
    
    ```
    desklet host doctor
    ```
    
5.  Add each project folder. In a git project each task works in a separate copy and your folder stays as it is; `--in-place` makes the agent change the folder itself.
    
    ```
    desklet host folder add ~/projects/my-app
    ```
    
    [What not to add](https://desklet.io/agent/safety#what-not-to-add)
    
6.  Store the program’s key: an API key from the Anthropic Console for Claude Code, an OpenAI API key for Codex, a Gemini API key for Gemini CLI. It stays on this computer: Desklet never gets it. Under protection a program runs only with a stored key.
    
    ```
    desklet host login claude-code --key
    ```
    
    ```
    desklet host login codex --key
    ```
    
    ```
    desklet host login gemini --key
    ```
    
7.  Start Desklet at login. `--max-runs=N` sets how many agents work at once on this computer (2 by default), and `--keep-awake` keeps a Mac from idle sleep while an agent works.
    
    ```
    desklet host install
    ```
    
8.  In Desklet, open Settings → Agents → Add an agent, pick the program and Desklet runs it for you. Pick the computer, then the folder and the desks it sees; More settings holds its model and effort, a name, Read or Read & add, who can give it tasks and what Desklet shows. Your guests can give tasks only to a protected agent.
    
9.  On a desk, add a Tasks region, pick the agent and write a task. It works from any browser or your phone.
    
10.  Read the report. When the agent changed files in a separate copy, choose Apply to put exactly those changes into your folder, or Discard changes. “Review in depth” means read the changes themselves. Write a message to the task to continue with the same agent.
     

### What not to add

Add a project folder, one per project. The app refuses folders an agent should never work in:

-   the root of a disk, your home folder and system folders;
-   the settings and keys of your programs, such as `~/.ssh`, and Desklet’s own settings;
-   the root of a cloud drive.

Everything else in the folder is the agent’s to read, and what it reads goes to its model vendor. Keep `.env` files, keys and passwords out of the folder. A separate copy leaves files git ignores, such as `.env`, behind, but a folder outside git or one added with `--in-place` has them all.

### What keeps it safe

-   **The folder.** Every run is closed in a sandbox made for it: Seatbelt on macOS, bubblewrap on Linux and WSL 2. The agent changes only its folder or its separate copy. It reads the system and the programs it runs, never the folders of keys and credentials or the app’s own files. It can’t change the folder’s git settings and hooks, so it can’t plant something git runs later.
-   **A separate copy per task.** In a git project your folder stays as it is while the agent works. Apply puts exactly the reviewed changes into it, or nothing.
-   **Your keys stay on your computer.** A protected run never sees the model key: the app adds it to each model call and forwards the call to the vendor. An agent told to show its key has nothing to show.
-   **Desklet sends the task, never a command.** A task, a message and an answer reach the agent only as text. The network rule, the read list and protection on or off are set only on your computer: nothing from Desklet widens them.
-   **Who can give tasks.** Only you, unless you choose “You and your guests” for an agent. Desklet allows that only while the computer reports the agent protected, and moves it back to “Only you” when it isn’t.
-   **Permission requests.** When an agent asks to do something, you Allow or Deny it in Desklet. Even when allowed, a protected agent stays in its folder.
-   **What Desklet shows.** Everything it does, only the result, or nothing. Keys in the work log are cut to their first 4 characters, and the agent’s own reasoning is never sent. Work logs are kept 7 days on the trial and Personal, 30 on Pro and 90 on Max.
-   **No silent fallback.** The app checks protection with a self-test before it reports a program protected. When the sandbox fails to start, the run fails instead of running unprotected.

### Internet access

By default a protected agent reaches only its model. When it needs to download packages (npm, PyPI, Go modules, crates.io and the like), allow the package registries. “Blocked a connection to …” in the work log means it tried to reach something else. `open` allows any public address, and asks you first.

```
desklet host protection network registries
```

Git over SSH doesn’t work in a run: use HTTPS, or push yourself. A toolchain in your home folder, such as `~/.cargo` or `~/go`, needs a line on the read list, which agents only read.

```
desklet host protection read add ~/.cargo
```

### What protection does not cover

-   **Code you run later.** A build script, a test, a package script, an editor task or a dependency the agent added runs with your full access when you run it. Review the changes first.
-   **What the model vendor receives.** The task and everything the agent reads go to the vendor, as with any use of the program.
-   **What a run still reads.** The system, the programs it runs and the folders on the read list. On macOS it can also read the arguments and environment of your other programs, so keep secrets out of your shell’s environment while an agent works.
-   **Repositories the agent creates.** A nested repository or a submodule it adds can carry settings that git and editors run when you work in it. Review the changes in Desklet, not inside the copy.
-   **The folder’s agent settings.** `.claude/`, `.codex/` and `.gemini/` are part of the folder, so the agent may change them, and they take effect the next time you run the program yourself.
-   **Linux folders outside git.** The agent can run `git init` there and add hooks. The app removes what it can see after the run and reports it.
-   **Other programs of yours.** A program you run can read the app’s files, the stored keys among them.
-   **Unprotected agents.** On native Windows, in WSL 1 or with protection off, an agent can read and change any file your user can.

The full list is in the [threat model](https://github.com/desklet-io/desklet/blob/master/SECURITY.md#threat-model).

### What not to do

**Do:**

-   give each agent one project folder, with git, so each task works in a separate copy;
-   keep protection on, and run `desklet host doctor` after any change;
-   give tasks yourself unless you choose otherwise;
-   read the report before Apply, and read the changes when it says “Review in depth”;
-   review what an agent changed before you run it;
-   answer a permission request only when you understand it.

**Don’t:**

-   add your home folder, a cloud drive or a folder with credentials;
-   keep keys in your shell’s environment while an agent works on a Mac;
-   run an agent in its own “skip permissions” mode outside the app’s protection;
-   let guests give tasks to an agent that sees desks or folders you haven’t shared with them;
-   paste keys or passwords into notes or tasks;
-   push the `desklet/…` branches: they carry your uncommitted files;
-   install skills or plugins for your agents from sources you don’t know;
-   share the app’s folder, `~/.desklet/host`, or run the app as another user;
-   connect a computer that other people use under your account;
-   leave an agent you connected yourself running with full access to your computer.

### Windows

Run Desklet inside WSL 2 with the Linux steps above: it uses bubblewrap there, as on Linux, and agents are protected.

Natively, install it with `winget install Desklet.Desklet`, with scoop or from the zip in [Releases](https://github.com/desklet-io/desklet/releases). Native Windows and WSL 1 have no protection: agents start only after you allow it, they can read and change any file your user can, and they take tasks only from you.

```
desklet host allow-unprotected
```

### Without the Desklet app

An agent you connect yourself still sees only the desks you choose and never deletes anything on them. What it does on your computer is up to the agent and its settings:

-   start it in the project, never in your home folder;
-   never use its mode that skips permissions or the sandbox;
-   turn on its own sandbox and limits.

The settings for each agent:

-   [Claude Code](https://desklet.io/agent/claude-code#keep-it-safe)
-   [Codex](https://desklet.io/agent/codex#keep-it-safe)
-   [OpenClaw](https://desklet.io/agent/openclaw#keep-it-safe)

### Check it yourself

`desklet host doctor` prints what this computer and its agents connect to, the programs with their keys, the read list and the problems. The Desklet app is open source: read the code, the [list of what it sends](https://github.com/desklet-io/desklet/blob/master/PRIVACY.md), and how to [verify a download](https://github.com/desklet-io/desklet#verifying-a-download).

[All agents](https://desklet.io/agent) [Desklet on GitHub](https://github.com/desklet-io/desklet)
