# Your agent's first task

> Paste one prompt to your agent, watch it ask Castle for a device, work in it and give it back. What you will see at each step.

By the end of this page your agent will have asked Castle for a device, done one small job in it and handed it back, and you will have watched it happen.

Before you start: your agent is [connected](https://castle.cx/docs/get-started/connect-your-agent.md), restarted, and agents are allowed in Settings › Agents.

## 1. Paste a prompt

Give your agent this, in Claude Code or Codex:

> Use Castle to get an Android phone. Open the Settings app on it and tell me which Android version it shows. When you're finished, give the device back.

This uses an Android emulator, and nothing in it needs the internet once it is made.

## 2. The device appears

Your agent asks Castle for an Android. Castle hands it one it can use, or makes one. If it makes one, a new device shows in Castle's list.

The first device of each kind downloads its system, so the first time takes longer and needs the internet. Your agent's first answer gives the time as a range of minutes. If the system has terms, Castle asks you, and the agent waits.

## 3. Watch it work

A device an agent asked for has no window until you press **Open**. Open it. You see the phone's screen as the agent works. When the agent clicks, its pointer shows with its name. You can use the device at the same time.

<figure class="doc-shot" style="max-width:454px"><img class="ld" src="https://castle.cx/assets/docs/docs-window-light.webp" width="908" height="798" loading="lazy" alt="A device's own window: a slim title bar with the device's name and Settings, Pause and More buttons, over the device's screen"><img class="ln" src="https://castle.cx/assets/docs/docs-window-dark.webp" width="908" height="798" loading="lazy" alt="A device's own window: a slim title bar with the device's name and Settings, Pause and More buttons, over the device's screen, in the dark appearance"><figcaption>A Mac device's window. An Android device's window shows the phone's screen the same way. From Castle’s design prototype. The finished app may look different.</figcaption></figure>

The device's page says who is using it, and Castle keeps a record of what the agent did through Castle, in plain words.

## 4. It gives the device back

When the agent finishes it gives the device back with `done`. Castle keeps the device as it is. If nobody uses it for a few quiet minutes, a device an agent made can rest on its own. [Running, Paused and Off](https://castle.cx/docs/devices/running-paused-and-off.md) explains.

When your agent comes back to the same project, it can get back the device it left, with what it left inside. That works when it is the same agent app, nobody else is on the device, and the device is not set to **Can't use**.

## If it does not go to plan

- **The agent says agents are off.** Turn on **Allow agents** in Settings › Agents, or check the device's level in its Settings › Agents: it must not be **Can't use**.
- **The agent does not seem to know Castle.** Restart it. If it still does not, [connect it again](https://castle.cx/docs/get-started/connect-your-agent.md).
- **Stuck?** [Get support](https://castle.cx/docs/help/get-support.md).

## Next

Find out [what agents may do](https://castle.cx/docs/agents/what-agents-may-do.md), and how to stop them.

---
Section: Get started · Last updated: 2026-11-20 · Source: https://castle.cx/docs/get-started/your-agents-first-task
