
# Where apps run (targets)

Every app runs on a deployment target. By default that's **Agent Cloud GCP**, Agent Cloud's own k3s node, with the app at `https://<app>.ac0.app`. An organization owner can add an **AWS target** in their own account, where apps run in a private VPC.

There, egress is limited to Agent Cloud, granted connections and owner-approved hosts. `agc status` shows an app's target in `data.target`, and agents ship to every target with the same `agc ship`.

## Where does data live on a private AWS target?

On a private AWS target, Agent Cloud runs application compute in the customer’s VPC, while the app’s Postgres stays in Agent Cloud’s account. Mirrors start from migrations and seed data, so production rows never leave for a copy. An organization owner can turn on "Agents may read this organization’s apps’ production databases" in the organization's General settings; then Builder and Read-only agents' `agc db query --env prod` reads production itself, read-only and unmasked, through the target's runner.

## Ask your agent

```text
Which target does this app run on, and does that change what you can see of production?
```

The agent reads `agc status` and tells you, for example, that its mirrors start empty because the app runs on your organization's AWS target.

## How it works

```mermaid
flowchart LR
  subgraph AC["Agent Cloud"]
    C["control: builds, approvals,<br/>rehearsals, receipts, sign-in, console"]
    N[(Postgres: app databases)]
    G["Agent Cloud GCP node"]
  end
  subgraph AWS["Customer AWS account, private VPC"]
    R["runner + egress proxy (k3s)"]
    A["app pods at app.internal-domain"]
  end
  C --> G
  R -- "outbound HTTPS only" --> C
  A -- "through the relay" --> N
  A --> R
```

On both kinds of target, Agent Cloud builds the image, holds approvals and receipts, and keeps the database; only where the app's pods run changes.

| | Agent Cloud GCP (default) | AWS target (customer's) |
|---|---|---|
| Who runs it | Agent Cloud | the organization's infra team, from a generated runbook |
| App address | `https://<app>.ac0.app`, public | `<app>.<internal domain>`, internal by default |
| Builds | on Agent Cloud | on Agent Cloud; images pulled through Agent Cloud's registry front |
| Database | Postgres, in Agent Cloud's account | Postgres, in Agent Cloud's account, reached through the relay; production allows only Agent Cloud's addresses |
| Egress from app pods | any public host, minus metadata and private ranges; rehearsals too | only HTTPS to Agent Cloud and the relay, plus granted connection hosts and hosts an owner approved for the app (`[production] egress_allow`, production pods only) |
| Your mirror | masked copy of production | empty: migrations, then seed data |
| `agc db query --env prod` | masked view of production | `target.private_data`, unless an organization owner turned production reads on: then production itself, read-only, unmasked, for Builder and Read-only agents |
| `agc up --at` | masked copy of production at that time | `target.private_data` |
| `cpu` / `memory` | honored within a per-app ceiling | honored within the owner's per-app cap and the node's room |
| Sign-in, email, checks, approvals, receipts, GitHub repo | same | same; smoke checks run inside the target's cluster |
| Traffic and logs in the console | collected | as `data.target.traffic` in `agc status` says for the target |

**Which target an app gets.** An app created by a connected agent gets its organization’s default target, whether the agent connected with `--join` now or earlier. An app created by an unclaimed agent has no organization and runs on Agent Cloud GCP, and stays there when it's claimed into an organization whose default is AWS. An app stays on the target it was created on, so pick the organization's default target before creating apps.

**What changes for the agent on a private target.** Very little in the commands, a lot in the data. No copy of production reaches an agent, not even masked. Mirrors are schema-only branches with production's migration ledger, so write `[data.db] seed = "seed.sql"` with a few made-up rows, or your mirror will be empty. Rehearsal evidence is pass or fail, as everywhere. `agc capsule` and `agc replay` give event names, statuses and times without attributes.

**Internet-facing targets.** A target whose owner put a public load balancer in front of it puts every app behind the target's sign-in gate, whatever `[auth] provider` says, because the network no longer protects anything.

**Sizing.** On a target, each service asks for its `cpu` and `memory` (default 0.5 CPU and 1 GiB once any service is sized). A release that doesn't fit under the owner's cap or on the node fails before it builds. On Agent Cloud GCP, an app that sets neither keeps the small shared defaults.

```toml
[service.web]
cpu = 1
memory = "2Gi"
```

`data.target.mirrors` in `agc status` is `masked` where mirrors are masked copies of production and `empty` on a customer's target.

## Errors

| `code` | exit | Cause | Fix |
|---|---|---|---|
| `target.private_data` | 12 | The app is on a customer's target, and production reads are off or this agent isn't Builder or Read-only (`agc up --at` is always refused there) | Use the mirror's seed data, or relay the link in `fix` so an organization owner can turn production reads on |
| `ship.over_cap` | 1 | The release asks for more `cpu`/`memory` than the app may have | Lower them, or ask whoever the message names to raise the cap |
| `ship.no_room` | 1 | Under the cap, but the target's node has no room | The message names the numbers and who can help |
| `ship.edge_unavailable` | 1 | `[auth] provider = "edge"` on a target with no sign-in of its own | Use Agent Cloud sign-in, or ask the target's owner to configure edge sign-in |

## Agent notes

- Check `agc status` before promising to look at production data. On a customer's target you read it only if an organization owner turned production reads on, and saying which up front saves a round trip.
- Don't work around `target.private_data` by asking the person for an export to paste in chat.
- Production rows you read on a customer's target are real and unmasked: counts and totals in chat, never rows.
- On a target, size services explicitly; a release that doesn't fit fails before it builds rather than waiting.

## Related

- [Deployment targets (owner view)](/docs/owners/deployment-targets.md)
- [Architecture of a private target](/docs/targets/architecture-of-a-private-target.md)
- [Data on private targets](/docs/data/reading-production-safely.md#data-on-private-targets)
- [Sizing and capacity](/docs/targets/sizing-and-capacity.md)
- [Data residency guarantees](/docs/security/production-data-protection.md#data-residency-on-private-targets)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "concepts/where-apps-run: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
