# Say what your chart needs online

> Declare your chart's locality, its needs and each online service it uses, with alta lint telling you exactly what is missing, then read what the owner sees before installing.

You tell the people who install your chart how much it needs the network, and what it talks to. A mind or a channel is a **need**: the player picks the provider, and you write nothing about it. A service your chart always uses is declared in `external`. `alta lint` sees every network use your chart names and tells you what is missing; the owner reads the result on the first step of the install.

**Before you begin (10 minutes)**

- The `morning-brief` chart of [your first chart](https://docs.altasystem.ai/charts/quickstart), or any agent chart made with `alta chart new --kind agent`.
- [Needs](https://docs.altasystem.ai/charts/concepts/needs), the three levels and the fields of a service: [Locality and online services](https://docs.altasystem.ai/charts/concepts/locality).

### Read what the skeleton declares

`alta chart new` already wrote the agent's level and its one need, a mind:

```json [morning-brief/chart.json: needs]
{ "mind": {} }
```

The agent thinks with `"model": "need:mind"`. Next to it, `"locality": "local-first"`: the mind may be a model on the machine, and the agent may use the `message` tool, which reaches the network where it chooses. There is no Claude service to write: if the player binds Claude, the game adds it.

### Try to say less than the truth

Change `"locality": "local-first"` to `"locality": "local"` and lint:

```sh [Terminal]
alta lint morning-brief
```

```text [Output]
FAIL morning-brief (chart)
     error: locality: The chart says it is more local than what it names allows: an executor, a sign-in, a model or a channel reaches the network. [chart.locality-floor]
       detail: locality: local is more local than what the chart names allows (local-first): agents[0].permissions.tools.allow: the tool message reaches the network wherever the agent chooses (chart.locality-floor)
       fix: Say the level the message names, or remove what reaches the network (the message lists each field).
       docs: https://docs.altasystem.ai/reference/errors#chart-locality-floor
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 1 error, 1 warning
```

Lint lists every field that reaches the network. You cannot lower that floor by writing a different word; only by removing what reaches the network. Put `"local-first"` back.

### Name a channel

Let the agent write to its owner on Telegram, by name: add a channel to the agent in `agents[0]`.

```json [morning-brief/chart.json: agents[0]]
{
  "channel": {
    "kind": "telegram"
  }
}
```

```sh [Terminal]
alta lint morning-brief
```

```text [Output]
FAIL morning-brief (chart)
     error: agents[0].channel.kind: Something the chart names reaches the network (a part, a repair, a model, a channel, a skill download) and no service covers its phase and hosts. [external.undeclared]
       detail: agents[0].channel.kind: the agent talks on telegram: declare a service in phase run with api.telegram.org in external.services (external.undeclared)
       fix: Add a service to external.services with the phase and the hosts the message lists (and the same when, if it depends on a value).
       docs: https://docs.altasystem.ai/reference/errors#external-undeclared
     error: locality: The chart says it is more local than what it names allows: an executor, a sign-in, a model or a channel reaches the network. [chart.locality-floor]
       detail: locality: local-first is more local than what the chart names allows (cloud): agents[0].channel.kind: the agent talks on telegram (chart.locality-floor)
       fix: Say the level the message names, or remove what reaches the network (the message lists each field).
       docs: https://docs.altasystem.ai/reference/errors#chart-locality-floor
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 2 errors, 1 warning
```

The message names the phase (`run`) and the host (`api.telegram.org`) to declare, and the level the chart now has.

### Declare the service

Add the service to `external.services`. Write the purpose for the owner, in both languages; say an account is needed, and what leaves the machine. Set `"locality": "cloud"`: the chart does not work without it.

```json [morning-brief/chart.json: external.services[0]]
{
  "id": "telegram",
  "name": "Telegram",
  "purpose": {
    "en": "The agent writes to you on Telegram.",
    "fr": "L'agent t'écrit sur Telegram."
  },
  "hosts": [
    "api.telegram.org"
  ],
  "phase": [
    "run"
  ],
  "account": "free",
  "data": [
    "messages"
  ]
}
```

```sh [Terminal]
alta lint morning-brief
```

```text [Output]
ok   morning-brief (chart)
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 0 errors, 1 warning
```

The remaining warning is the placeholder source, filled when you [publish](https://docs.altasystem.ai/marketplace/publish). This is the **pinned** form: every owner needs Telegram. Keep it for a service your chart cannot do without (a weather service, your own API).

### Or let the player choose

A channel is a need like a mind. Remove the service, put `"locality"` back to `"local-first"`, add a channel need, and point the agent at it:

```json [morning-brief/chart.json: needs, agents[0].channel]
{
  "needs": {
    "mind": {},
    "channel": {}
  },
  "channel": "need:channel"
}
```

```sh [Terminal]
alta lint morning-brief
```

```text [Output]
ok   morning-brief (chart)
     warning: source: The source still holds placeholders (zeros). [chart.source-placeholder]
       fix: Replace them with the commit git prints and the digest alta package prints.
       docs: https://docs.altasystem.ai/reference/errors#chart-source-placeholder
1 checked, 0 errors, 1 warning
```

Nothing to declare: the player's channel is Telegram or the game's own inbox, and the service, the sign-ins and the repairs come with it.

### Read what the owner sees

The first step of the install is the owner's yes. It says which provider each need is bound to, then the services. `--renderer game --json` prints the install as the game shows it; the consent step is the first step of the first quest:

```sh [Terminal]
alta template morning-brief --renderer game --json
```

```text [The consent step]
Morning Brief asks for: 1 agent(s): Helper; 3 sign-in(s). Each change shows its own card before it runs.

- Morning Brief will think with your Claude subscription · change
- Morning Brief will write to you on Telegram · change

Risk: medium. Read why below before you agree.
- It installs programs on your machine.
- It needs you to sign in (Claude, Telegram).
- An agent writes on a messaging channel (Telegram).
- An agent may reach the network where it chooses (message).
- It talks to online services while it runs (Claude, Telegram).

Needs online services to work.
- Claude: It thinks with your Claude subscription: what you ask goes to Claude. A paid account is needed. What leaves your machine: what you ask.
- Telegram: It writes to you on Telegram. An account is needed. What leaves your machine: messages.
```

With nothing chosen yet, the game proposes the first provider of each kind, with "change". An owner who chose "100% local":

```sh [Terminal]
alta template morning-brief --renderer game --json --local-only
```

```text [The consent step]
Morning Brief asks for: 1 agent(s): Helper. Each change shows its own card before it runs.

- Morning Brief will think with a model on this machine
- Morning Brief will write to you here, in the game

Risk: medium. Read why below before you agree.
- It installs programs on your machine.
- An agent may reach the network where it chooses (message).

Works with the network off. Some extras use online services.
```

Claude and Telegram are gone, and so are their sign-ins: the same chart, bound to a model on the machine and the game's inbox. `--bind mind=local,channel=world` picks them one by one.

## Choosing the level

- Everything works offline, nothing at run time reaches the network: `local`.
- The chart works offline and some extras are online: `local-first`, and mark each of those services `"required": false`. A need whose providers include a local one stays here.
- It needs a service to do its job: `cloud`.
- A download at install time only (a model, a package): `"phase": ["install"]`, which does not change the level.

The store lists a chart with needs at the worst case of its providers, and says "can run 100% local" when every need has a local provider.

## Pitfalls

| Do | Avoid |
|---|---|
| A need for a mind or a channel: `"needs": { "mind": {} }` | A value that asks "Claude or local?", or Claude written in `external` |
| One service per company or product, with every host it reaches | One service per host |
| A purpose that says what the owner gives: "what you ask goes to the weather service" | A purpose that sells: "powered by the best AI" |
| An account in `account`, and the credential in a sign-in | A key, a token or a password anywhere in the chart |

**Next:**

- [Needs](https://docs.altasystem.ai/charts/concepts/needs)
- [Locality and online services](https://docs.altasystem.ai/charts/concepts/locality)
- [Errors of alta lint](https://docs.altasystem.ai/reference/errors#external-undeclared)
