# Architecture from your infrastructure, with drift

## Agent prompt

```text
Help me map my infrastructure with Slatebox's Living architecture: infrastructure recipe. Ask which GitHub repositories hold my Terraform, Kubernetes, Helm, compose or deploy workflows, and which clouds I run on. Walk me through Add a recipe in a project, Install Slatebox on GitHub, connecting each cloud (one click for DigitalOcean, OVHcloud and Vultr; a read-only key I make myself for Hetzner Cloud, Linode and Scaleway), and keeping the first run. Never paste or ask for a cloud key in chat: tell me where I make it and where I paste it myself.

Read https://docs.slatebox.com/Using-Slatebox/architecture-from-infrastructure.md first. Ask for the inputs you need. Tell me what you verified and which steps I still need to do.

If your client cannot fetch the documentation, read the same published file at https://raw.githubusercontent.com/Slatebox/slatebox-docs/retype/Using-Slatebox/architecture-from-infrastructure.md.
```

**Living architecture: infrastructure** reads your repositories' infrastructure files and keeps what runs where on live slates. Connect a cloud and it also reads what actually runs there and marks drift: what the repo declares but is not running, and what runs but no repository declares. It only lists and describes; it never changes anything in a cloud and writes nothing outside Slatebox. It uses no agent work, and it is free on Slatebox Cloud and on a self-hosted Slatebox.

## Turn it on

1. Open a project, then **Recipes → Add a recipe → Living architecture: infrastructure**.
2. Choose **Install Slatebox on GitHub** and pick up to 10 repositories. It needs read access to their files only.
3. Optional: under **Add what is actually running**, choose **Connect** on each cloud you use (below), and pick regions to narrow it.
4. Optional: under **Slates to keep**, turn off any of the four slates.
5. Choose **Preview the first run**, **Turn on**, then **Keep all**.

It runs again on every push to the default branch and every 6 hours, and on **Run now**.

## What it reads

| From | What |
| --- | --- |
| Terraform | Resource and module blocks: the type, the name, where it runs and its size, and what it refers to |
| Kubernetes | Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, Services, Ingresses (their hosts), PersistentVolumeClaims and Namespaces, by namespace |
| Helm | `Chart.yaml` and the charts it depends on. Templates are not rendered |
| docker-compose | Its services |
| Dockerfiles | Base images and the ports they expose |
| GitHub Actions | Workflows that build, push or deploy: when they run, each job's environment, the images they push and where they deploy |

It reads names only, never values or secrets. **Only these paths** and **Leave out these paths** narrow it.

## The slates

| Slate | Shows |
| --- | --- |
| **Infrastructure — <repo>** | Each repository's resources by role, with environments as frames and networks inside them. Each note names the resource, its kind, its cloud and its region |
| **Cluster — <repo> › <cluster>** | Each Kubernetes cluster, namespace by namespace: workloads, Services, replicas and hosts |
| **How it ships — <repo>** | Each deploy workflow: what starts it, the images it builds, where it pushes them and where it deploys |
| **Runtime map** | Every repository's infrastructure on one slate |
| **Drift** | A board in two lanes, **In the repo, not running** and **Running, not in any repository**. Only with a cloud connected |

On the overview, a resource in the repo that is not running is red and dashed, and one running that no repository declares is added in amber. Notes the recipe keeps are locked while it updates; choose **Stop updating** on a note to move or edit it. Its slates open only for the people the project is shared with, never by link alone.

## Connect a cloud

| Cloud | How you connect | What it lists |
| --- | --- | --- |
| DigitalOcean | **Connect**, then sign in on DigitalOcean's page | Droplets, Kubernetes clusters, databases, load balancers and apps |
| OVHcloud | **Connect**, then sign in on OVHcloud's page. The region picks the area: Europe (the default), the US or Canada | Projects, instances, Kubernetes clusters and databases |
| Vultr | An admin of your Vultr organization turns on MCP access once (in public preview). Then **Connect** and sign in on Vultr's page | Instances, Kubernetes clusters, databases and load balancers |
| Hetzner Cloud | Make an API token with **Read** permission in the Hetzner Console (**Security › API tokens**) and paste it into **Connect** | Servers, load balancers, volumes, networks, firewalls and IP addresses |
| Linode | Make a personal access token with **Read Only** on Linodes, Kubernetes, NodeBalancers, VPCs, Domains, Firewalls, Databases and Object Storage, and **No Access** on the rest, and paste it | Those resources |
| Scaleway | Make an IAM application with read-only permission sets, give it an API key, and paste its access key, secret key and Project ID | Instances, Kubernetes, load balancers, networks, databases, caches, buckets, domains, apps and functions |

DigitalOcean, OVHcloud and Vultr connect through each one's own MCP server; the recipe calls only their list and get tools. The same connection is an agent you can invite onto any slate to ask about your cloud. A pasted key is sealed and never shown again; forget it in the recipe's **Settings**.

AWS, Google Cloud, Azure and Kubernetes clusters are listed in the recipe as **Not on yet**, each saying what it waits for. Until then the recipe reads them from your Terraform and manifests.

## How drift is decided

- A resource is matched by the name its cloud shows. One the repo declares with no name its cloud would show is never called missing.
- A run that read only part of a cloud (a timeout, throttling, a list it could not read, or a region you did not pick) never reports what it could not read as gone.
- What every account or network starts with, such as a default network or security group, is never drift.
- Webhooks: `infrastructure.updated`, `infrastructure.drift_found` and `infrastructure.drift_cleared`.

## Questions

### Can Slatebox draw an architecture diagram from Terraform?

Yes. Living architecture: infrastructure reads the Terraform in your repositories, with Kubernetes, Helm, docker-compose, GitHub Actions and Dockerfiles, and keeps an overview, each cluster, How it ships and a Runtime map current on every push.

### Can it change anything in my cloud?

No. It makes only list, describe and get calls, and writes nothing outside Slatebox.

### Do I need a cloud connected?

No. Without one, the slates show what your repositories declare. A cloud adds what actually runs, and the Drift board.

### What does it cost?

Nothing. It is free on Slatebox Cloud and on a self-hosted Slatebox, and it uses no agent work.

For code structure, pull request diagrams and Mermaid files in your repository, see [Architecture diagrams from GitHub](architecture-diagrams-from-github.md).
