# Cloud Agents

Source: https://athas.dev/docs/cloud-agents

Run Claude Code or Codex in an isolated cloud sandbox and get a draft pull request.

Cloud Agents run Claude Code or Codex on a GitHub repository in an isolated Cloudflare sandbox.
The agent clones the repository, works on your task with your own Anthropic or OpenAI API key,
and opens a draft pull request with its changes. Runs continue when Athas is closed, so you can
start a task, close your laptop, and review the pull request later.

## Requirements

- Athas Pro
- GitHub connected in Athas. See [GitHub Integration](https://athas.dev/docs/github-integration).
- An Anthropic API key for Claude Code or an OpenAI API key for Codex, saved in **Settings > AI**.
  See [Providers and Models](https://athas.dev/docs/ai-providers).

## Start a Run

1. Open **AI: Cloud Agents** from the command palette.

2. Choose a repository you connected to Athas and its base branch.

3. Choose **Claude Code** or **Codex** and a time limit.

4. Describe the task and click **Run in the cloud**.

The run list shows each run's status and activity while it works. When the agent finishes with
changes, Athas links the draft pull request on a new `athas/agent-…` branch. Review and merge it
on GitHub like any other pull request. Stop a run at any time; its work so far is discarded.

## Pricing

Sandbox time costs $0.40 per hour. You pay for the time the sandbox actually ran, never more than
the time limit you chose. While a run is active, Athas holds the cost of its full time limit and
releases the unused part when it finishes. A run that fails to start is not charged.

Sandbox time comes out of your included Pro credit first, then from your prepaid balance. See
[Hosted AI Pricing](https://athas.dev/docs/ai#hosted-ai-pricing). Model usage is billed by Anthropic or OpenAI to
the API key you provide, not by Athas.

## Limits

- Up to 2 runs at the same time per account
- Time limits of 30 minutes, 1 hour, or 2 hours
- The sandbox has no open Internet access. It can reach the Anthropic or OpenAI API, read the
  run's repository on GitHub, and read from package registries such as npm, PyPI, crates.io,
  Go modules, RubyGems, and Maven Central.

## Privacy and Security

- Your API key is sent with the run and is never stored. The sandbox only sees a placeholder;
  the real key is added to model API requests on their way out of the sandbox.
- The sandbox can only read the repository. Athas creates the branch, commit, and draft pull
  request through the GitHub API after the agent finishes, so the agent never has write access.
- Each run gets its own sandbox, which is destroyed when the run ends.
- Athas keeps the run's repository, task, status, activity log, sandbox time, and pull request
  link so you can see your run history.

**Info:**

  The agent works only with what is in the repository. It cannot reach your local files, databases,
  or services running on your machine.

## Before starting a run

Choose the repository and base branch deliberately, commit files the agent needs, and make the task and tests explicit. Local uncommitted work is not part of the clone. Inspect the resulting draft pull request and its checks before merging; see [Agent context](https://athas.dev/docs/agent-context).
