
# Agent Cloud vs your own AWS

An organization owner can add an AWS target: one k3s node in a private subnet of your VPC, where the organization's apps then run. Your infra engineer or their agent runs the runbook, `infra-agent.md`; the target is ready when the console shows `healthy`. Agents ship with `agc ship` as usual.

The comparison is with building the same thing yourself on ECS or EKS, RDS and your own release process. In short, Agent Cloud gives you rehearsed, approved releases and an agent workflow without writing Terraform or a pipeline. App compute runs in your VPC, and the app's database is managed for you in Agent Cloud's account.

## Ask your agent

```text
Our apps have to run in our AWS account. Read the infra-agent.md runbook the Agent Cloud
console generated for our target, check each step against our VPC (subnets, endpoints,
egress rules), and tell me what you'd need from us before running it. Don't deploy anything.
```

The agent reads the runbook and reports what it needs: subnet IDs, whether SSM endpoints can be created, and the wildcard certificate.

## What the two approaches share

- App compute runs in your VPC.
- Nodes are reached through Systems Manager Session Manager rather than SSH or a bastion, and instances require IMDSv2.
- Infrastructure is declared as a CloudFormation stack you own and can delete.
- An internet-facing ALB can sit behind AWS WAF.

## Compute

### Your own AWS

ECS on Fargate runs containers without servers to manage, and ECS Express Mode provisions a Fargate service with a load balancer, TLS and autoscaling. EKS runs Kubernetes with an AWS-managed control plane, and Auto Mode manages nodes too. AWS App Runner is closed to new customers; AWS recommends ECS Express Mode instead.

### Agent Cloud target

The template creates one EC2 instance (hop limit 1), an IAM role with only SSM core, and a security group with no inbound from the internet. The runbook installs k3s from an offline bundle, then Agent Cloud's runner and egress proxy. Each app gets its own namespace, and its pods can't reach the Kubernetes API, the instance metadata service or other apps. Services declare `cpu` and `memory` within a per-app cap the owner sets (default 2 CPU and 4 GiB), on a node the owner sizes (default 8 vCPU and 32 GiB). Over the cap, a ship fails before building with `ship.over_cap`; with no room on the node, it fails with `ship.no_room`.

## Network and egress

### Your own AWS

You decide: NAT gateways, VPC endpoints and PrivateLink for private access to AWS services, security groups, WAF on the ALB.

### Agent Cloud target

The node's only egress is HTTPS to `agent.cloud` and `relay.agent.cloud`, plus the VPC's SSM endpoints. There's no NAT to the internet and no package registry. Images are built on Agent Cloud and pulled through its registry front with a one-hour token scoped to that image. App pods reach the outside only through the egress proxy. It allows the app's database, Agent Cloud's sign-in and email, and connections an owner granted, each `host:port` per app. Apps are served internally at `<app>.<internal domain>` with your wildcard certificate. Served instead through an internet-facing ALB with a WAF, every app sits behind the gate.

## Data

### Your own AWS

RDS or Aurora in your account. RDS automated backups give point-in-time recovery within the retention period, and Aurora's copy-on-write clones (up to 15 per source) are built for test environments from production data.

### Agent Cloud target

The app's Postgres is managed in Agent Cloud's account, reached only through the relay. Production accepts only Agent Cloud's addresses, so a leaked `DATABASE_URL` works from nowhere else. On your target, the `agc up` mirror starts from your migrations and seed data, so agents build without touching production data. Rehearsals run on a fresh branch of production, with the rehearsal pods on your node.

## Releases and governance

### Your own AWS

You build the pipeline: CodePipeline, GitHub Actions or similar, migrations in a deploy step, approvals in your CI, a staging copy from an Aurora clone if you set one up.

### Agent Cloud target

The same as on Agent Cloud's own node: a rehearsal for every release, a receipt for every live release, sign-in, email and each app's GitHub repo. On your target, a person also approves each app's first release, and any migration that drops or rewrites data (`DROP`, `TRUNCATE`, `DELETE`, `ALTER … TYPE`, an `UPDATE` without `WHERE`, a `DO` block or `EXECUTE`) waits for a person in the console.

## Operating it

The runner sends a heartbeat every minute with versions, node resources, the isolation checks and its own last 50 error lines, redacted. The runbook's doctor step prints the same report as JSON. To register, the runner signs an STS `GetCallerIdentity` request that Agent Cloud forwards, which proves it runs in your account. The resulting runner token lasts one hour, and Agent Cloud holds no AWS credential for your account.

## Summary

| | Your own AWS | Agent Cloud target |
|---|---|---|
| Setup | Your Terraform or CloudFormation, your pipeline | One generated CloudFormation template and runbook |
| Compute | Fargate, EKS, your choice | A k3s node you size, with an isolated namespace per app |
| Database | RDS or Aurora you run | Managed Postgres, reached via the relay |
| Egress | Your design | HTTPS to Agent Cloud and the relay only |
| Copies for development | Aurora clones | Mirror from migrations and seed data |
| Release testing | Whatever you build | Rehearsal on a fresh branch of production |
| Approvals | Your CI | A person approves each first release and every migration that drops or rewrites data |
| Addresses | Your Route 53 and ALB | `<app>.<internal domain>` on your wildcard certificate |
| Agent interface | Your scripts | `agc`, same as on Agent Cloud |

## Frequently asked questions

### Does production data leave our AWS account?

The database is managed in Agent Cloud's account, and app compute in yours reads and writes it through the relay.

### Do we need Terraform?

No. The runbook deploys one CloudFormation stack with `aws cloudformation deploy`. The stack is yours, so you can delete it whenever you choose.

### Can agents see our production data?

By default no: agents work on mirrors built from migrations and seed data. An owner can turn on "Agents may read this organization's apps' production databases" in General settings; Builder and Read-only agents can then run read-only `agc db query --env prod` queries, unmasked, from any laptop.

### Can Agent Cloud reach into our account?

It holds no AWS credential. The runner calls out to Agent Cloud over HTTPS, and its token expires within the hour unless it proves again where it runs.

## Agent notes

- `target.private_data` (exit 12) is expected on a customer's target unless an owner has allowed production reads. Use seed data (`[data.db] seed`) and `agc check`, or ask an owner to turn on the setting.
- On a customer's target, `agc domain` answers `domain.target`; keep the app's internal address.
- Don't ask the person for AWS credentials. Nothing in the agent workflow needs them.

## Related

- [Where apps run](/docs/concepts/where-apps-run.md)
- [Architecture of a private target](/docs/targets/architecture-of-a-private-target.md)
- [Installing with infra-agent.md](/docs/targets/installing-with-infra-agent-md.md)
- [Data residency guarantees](/docs/security/production-data-protection.md#data-residency-on-private-targets)
- [Deployment targets](/docs/owners/deployment-targets.md)

<!-- feedback:start -->
---
Wrong, outdated or unclear? Run `agc feedback docs "compare/agent-cloud-vs-your-own-aws: <what is wrong>" --body <file>` with the sentence quoted in the file. No code or app data is sent.
<!-- feedback:end -->
