# Settings

> Every tab of the dashboard's Settings page: what each screen shows, how to set secrets and environments, how to approve a run that waits, and who may change what.

Source: https://latchkey.dev/documentation/settings

## Summary

- Settings has eight tabs: **Notifications**, **Self-healing**, **API keys and agents**, **Agent activity**, **Secrets**, **Environments**, **Account** and **Code hosts**.
- **Secrets** holds the values your jobs read, for the whole workspace, one repository or one environment of a repository; a saved value is never shown again.
- **Environments** sets which branches may use an environment and whether its jobs wait for an approval. Only owners and admins change it.
- A run that waits for an approval is approved or rejected on its own run page, by an owner or admin, within 24 hours.
- Anyone in the workspace sets workspace and repository secrets; environment secrets, environment settings and approvals are for owners and admins.

Open **Settings** in the sidebar. Its tabs, in the order the page draws them, are **Notifications**, **Self-healing**, **API keys and agents**, **Agent activity**, **Secrets**, **Environments**, **Account** and **Code hosts**. Everyone in the workspace can open every tab, and what each person can change on it depends on their role ([Team and roles](https://latchkey.dev/documentation/team-and-roles)). A workspace born without a trial sees only **API keys and agents**, **Account** and **Code hosts**.

## Notifications

Each person picks, for themselves, which alerts reach them and on which channel. Only an owner or admin connects or removes the Slack workspace. [Notifications](https://latchkey.dev/documentation/notifications) walks through the tab, and [Slack integration](https://latchkey.dev/documentation/slack-integration) through the Slack connection.

## Self-healing

How far self-heal may go on its own across the workspace, how many times it may run a failed step again, Flake Shield, and the fixes you declined. Everyone can read the tab; only an owner or admin changes it or undoes a declined fix. [Self-healing](https://latchkey.dev/documentation/self-healing#controls) lists each control.

## API keys and agents

Keys for the Latchkey CLI and the MCP server: generate a key with the access it needs, copy it while it is shown, connect your agent, and revoke a key when it is in doubt. Only an owner or admin sees the keys; a member sees **Admin access required**. [Connect your AI agent](https://latchkey.dev/documentation/connect-your-ai-agent#setup) walks through it, and its sections on each opt-in say what each access lets a key do.

## Agent activity

What each API key did over a window: the jobs it ran, what they cost, and the calls it made to the MCP server. Only an owner or admin can read it; a member sees **Admin access required**.

- Choose the window at the top: **This week** (the last seven days), **30 days**, or **Custom**, from a start day you pick. A job counts in the window it finished in.
- Four figures sum the window, each against the window before it: **Agent spend**, **Jobs finished**, **Jobs failed** and **MCP calls**.
- **Keys** lists each key that ran a job or called the MCP server in the window, with its jobs, failures, cost and MCP calls. Select a key to narrow **Batches** and **Recent jobs** to it, and **All keys** to undo that.
- **Batches** ranks the window's batches by cost, and **Batch budgets** under it opens Billing, where an owner or admin can raise a budget. **Recent jobs** lists the jobs newest first, and **CLI jobs on Runs** under it opens them on the Runs page.

## Secrets

Settings, Secrets tab, at the Pro level. The Secrets panel counts 4 secrets, with New secret in its head, the Level segments All, Workspace, Repository and Environment, and Search secrets. The table lists CODECOV_TOKEN, Repository acme/web, v1, set by the key release-bot, read by ci; DATABASE_URL, Repository acme/api, v2, set by Another member, read by ci and deploy; DEPLOY_TOKEN, Environment: production (acme/api), v1, set by You, read by deploy; and NPM_TOKEN, Workspace, v3, set by You, read by release in acme/api and in acme/web. Each row has Replace and Delete. Under the table, Referenced but not set lists SENTRY_AUTH_TOKEN at Environment: production (acme/web), read by deploy, with Set secret. Set secret opens the New secret drawer with the name, the Environment level, the repository acme/web and the environment production filled in. A value is entered and Save secret shows its loader. The drawer closes, the panel says SENTRY_AUTH_TOKEN saved., the count reads 5 secrets, the new row joins the table at v1, set by You and read by deploy, and the Referenced but not set table is gone. The panel's foot reads A value is sealed when you save it. Latchkey never shows it again, on this page or through the API.

A name a pipeline reads but nobody has set waits under Referenced but not set, and Set secret fills the drawer for you, down to its environment. Once saved, the value is sealed: the table shows who set each secret and which pipelines read it, never the value.

A secret is a value your jobs read, such as a token or a password, set at one of three levels. A **Workspace** secret can be read by a step in any repository of the workspace. A **Repository** secret is read by a step in one repository. An **Environment** secret is read only by a job in one repository that names that environment, once its run is approved for it, or in a run on its branches when the environment needs no approval. An environment secret wins over a repository secret of the same name, and a repository secret wins over a workspace one. How a step reads a secret is in [What runs today](https://latchkey.dev/documentation/workflow-files#what-runs-today).

### Set a secret

1. **Click New secret**

   **New secret**, at the head of the Secrets panel, opens a drawer of the same name.

2. **Name it and choose its level**

   Type the **Name** and choose the **Level**. **Repository** and **Environment** ask for the **Repository** too, and **Environment** for the environment's name, as the job writes it after `environment:`.

3. **Enter the value**

   Type or paste the **Value**. The box keeps line breaks, so a key or a certificate fits whole. The value is cleared when you press **Save secret**, even when the save is refused.

4. **Save it**

   **Save secret** stores the value, and the panel says the secret was saved. Saving a name that is already set at the same level, for the same repository or environment, stores a new version of that secret.

### Replace or delete a secret

**Replace** on a secret's row opens the drawer with its name and level fixed: type the new value and press **Save secret** to store a new version. **Delete** asks first, **Delete this secret?**, and says that deleting it removes every version and that Latchkey cannot restore it; **Delete secret** deletes it, and **Cancel** keeps it. The chevron beside a name lists the secret's versions, each marked current or replaced, with who set it and when, and no value. A value is sealed when you save it: Latchkey never shows it again, on this page or through the API.

### What the table shows

- **Name**, **Level**, **Version**, **Set by**, **Set at** and **Read by** for each secret. **Set by** says you, another member, or the name of the API key that set it, and shows at the Pro level only.
- **Read by** names the pipelines that read the secret, each with its repository for a workspace secret, and shows a dash when no pipeline reads it.
- **All** above the table shows every level, **Workspace**, **Repository** and **Environment** one level each, and **Search secrets** finds a secret by its name. The count in the panel's head is the workspace's whole count, whatever is shown.

### Referenced but not set

Under the table, **Referenced but not set** lists each name a pipeline reads that no level its job can see holds, at the level it would be set at: the environment, when the job that reads it names one, or else the repository. **Set secret** opens **New secret** with the name and the repository filled in, and the environment too where the job names one. A row at the environment level shows **Set secret** to an owner or admin only. Until the name is set, a run that reads it is refused before any job starts, as [What runs today](https://latchkey.dev/documentation/workflow-files#what-runs-today) says.

### Who may set which level

| Who | Workspace secret | Repository secret | Environment secret |
| --- | --- | --- | --- |
| An owner or admin | Sets, replaces, deletes | Sets, replaces, deletes | Sets, replaces, deletes |
| A member | Sets, replaces, deletes | Sets, replaces, deletes | Sees it, cannot change it |
| An API key with **Allow setting workspace secrets** | Sets, replaces | Sets, replaces | Never |

A member's **Level** offers **Workspace** and **Repository** only, and an environment secret's row shows a member no **Replace** or **Delete**. A key created with **Allow setting workspace secrets**, which the **CLI runner and secrets** and **Full access** presets carry, sets a workspace or repository secret with `latchkey secrets set`, and **Set by** names the key. It never sets an environment secret: an owner or admin sets one in the dashboard. No key reads a secret back.

### Names and values

- A name uses the letters A to Z in either case, digits and underscores, does not start with a digit, runs up to 128 characters, and never starts with `LATCHKEY_`, in upper or lower case.
- A value cannot be empty or hold a null character, and is at most 48 KiB (49,152 bytes).
- A value shorter than 28 bytes is too short to be hidden in the log. The drawer warns and still saves it, but Latchkey never delivers it: a step that names it fails before it starts.
- The **Repository** field lists the workspace's first 100 repositories, and a secret of a repository past them reads its level without the repository's name.

## Environments

Settings, Environments tab, at the Pro level. The Environments panel, with Set branches and approval in its head, lists acme/api production on main, Approval Required, set by You, and acme/api staging on main, release/* and !release/old, Approval Not required, set by Another owner or admin, each with Replace and Clear. Set branches and approval opens a form of the same name under the panel, and the button leaves the head while the form is open. The form starts on acme/api; acme/web is chosen, production is written as the Environment and main as the only branch pattern, and the Approval stays on An owner or admin approves each run, the other choice being Jobs start without an approval in runs on these branches. Save, beside Cancel, comes alive once the name is written.

An environment is listed only once an owner or admin sets its branches. A new one starts on An owner or admin approves each run; letting its jobs start without an approval makes its branches the only guard.

An environment is the name a job writes after `environment:` in a workflow file, and it belongs to one repository: the same name in two repositories is two environments, each with its own branches, approval and secrets. This tab sets, for each, the branches whose runs may use it and whether its jobs wait for an approval. The rules those settings follow are in [Jobs that wait for an approval](https://latchkey.dev/documentation/workflow-files#jobs-that-wait-for-an-approval).

The table lists only the environments an owner or admin has set branches for. An environment a workflow file names with no branches set is not listed: it accepts every branch, and its jobs always wait for an approval. With none set, the tab reads **No environment has branches set yet, so every environment accepts every branch.** Each row shows the **Repository**, the **Environment**, its **Branches**, its **Approval**, **Required** or **Not required**, who set it under **Set by**, at the Pro level, and when under **Set at**.

### Set branches and approval

1. **Click Set branches and approval**

   **Set branches and approval**, at the head of the Environments panel, opens a form of the same name under it.

2. **Choose the repository and the environment**

   Pick the **Repository** and type the **Environment**'s name as the job writes it after `environment:`.

3. **List the branches**

   Under **Branches**, write one pattern per line, as `branches:` under `on: push` takes them: `main`, `release/*`, and `!release/old` after it to leave one out. A tag and a pull request's own ref never match. Write up to 100 patterns, each up to 200 characters, and at least one that does not start with `!`.

4. **Choose the approval**

   **An owner or admin approves each run**, where a new environment starts, or **Jobs start without an approval in runs on these branches**. Without an approval, a job that names the environment starts as soon as a run on these branches reaches it, with the environment's secrets and an identity token your cloud roles trust as this environment, and nobody is asked: these branches are then its only guard.

5. **Save**

   **Save** applies the setting. A run or a re-run that starts from then on reads it, and so does a job still waiting for its approval: once no approval is needed, a waiting job on these branches starts within about a minute. A job already released keeps running.

**Replace** on a row opens the same form on that row's repository, environment, branches and approval. Only an environment with branches set can start its jobs without an approval, so a save that asks for no approval with no branches is refused. **Clear** asks first, and **Clear branches** removes the branches: the environment then accepts jobs in every run again, on any branch, tag or pull request, and a run that reaches a job naming it waits for an owner or admin to approve it. **Clear** is refused while the environment needs no approval: set it to **An owner or admin approves each run** first, then clear its branches.

An environment's secrets are set on the **Secrets** tab, at the **Environment** level. Only an owner or admin changes this tab; a member reads the table, with **Only owners and admins can change this setting.** under it. No workflow file and no API key can change these settings, and `latchkey environments list --repository <owner/name>` and the `list_environments` MCP tool read them with a key that holds `jobs:read`. The **Repository** field lists the same first 100 repositories as the Secrets tab, and a row for a repository past them shows the repository's ID.

## Approving a run

On a run's page, the Approval for production panel counts 2 jobs, with Reject and Approve in its head. It reads Waiting for an owner or admin to approve this run for production., then One decision covers the 2 jobs of attempt 1 that name production., over the jobs deploy-api and migrate-db, and its foot reads Waiting since Nov 24, 14:18 and Without a decision by Nov 25, 14:18, these jobs end without starting. Approve opens the question Approve this run for production?, which reads The 2 jobs of attempt 1 that name production can then start, with the secrets set for production in acme/api. An approval cannot be taken back, and a re-run asks again., over the two jobs, with Cancel and Approve.

One decision covers every job of the attempt that names the environment, and it cannot be taken back. Only an owner or admin sees Reject and Approve, nothing tells them a run is waiting, and its jobs end without starting 24 hours after the wait began.

A run that reaches a job naming an environment waits for an approval, unless that environment needs none or does not accept the run, or the job is held in a trial run or a pipeline on trial, as [Jobs that wait for an approval](https://latchkey.dev/documentation/workflow-files#jobs-that-wait-for-an-approval) and [Trial runs and dry runs](https://latchkey.dev/documentation/workflow-files#trial-runs-and-dry-runs) say. The decision is made on the run's own page, not in Settings. Above the jobs, each environment the run's jobs name gets an **Approval for** panel with its count of jobs, and each waiting job reads **Needs approval**.

- Only an owner or admin sees **Reject** and **Approve**; a member reads the same panel without them.
- One decision covers every job of that attempt that names the environment. **Approve** asks first and says the jobs can then start, with the secrets set for that environment in that repository; **Cancel** keeps the run waiting. **Reject** asks first and says the jobs end without starting and the jobs that need them are skipped; **Keep waiting** backs out.
- A decision cannot be taken back, and a re-run asks again. The panel then says who approved or rejected the run, and when.
- The panel's foot gives since when the run has waited and when its jobs end without starting: 24 hours after the wait began. Latchkey sends no notification when a run starts waiting, by email, Slack, browser push or the bell, so whoever decides has to open the run page.
- An agent can decide through the Jobs API, with a key created with **Allow approving runs for an environment**: see [Approve runs for an environment (opt-in)](https://latchkey.dev/documentation/connect-your-ai-agent#approve-runs-for-an-environment-opt-in).

## Account

**Workspace and sign-in** holds three rows:

- **Workspace name**, the name your team sees in the workspace switcher, on invitations and on your invoices. The owner renames the workspace here, up to 100 characters, and presses **Save**. The row shows to the owner alone, and only while the subscription is active or the trial has not ended.
- **Workspace ID**, read only, with a button that copies it. Every identity token a job of the workspace gets names it after `org:` in its `sub`, so a cloud trust policy can accept this workspace's jobs alone ([Cloud identity](https://latchkey.dev/documentation/cloud-identity#the-subject)).
- **GitHub account**, the GitHub account linked to your own login, with **Link GitHub** or **Unlink**.

**Danger zone** holds **Delete workspace**, for the owner alone, and **Delete account**, for everyone. Each asks you to confirm first and cannot be undone, and anyone but the owner reads that only the owner can delete the workspace. What each deletes is in [Deleting your data](https://latchkey.dev/documentation/security-and-permissions#deleting-your-data), and handing the workspace to another member is in [Transferring ownership and leaving](https://latchkey.dev/documentation/team-and-roles#transferring-ownership-and-leaving).

## Code hosts

Each account on a code host where the Latchkey app is installed, the state Latchkey last recorded for it (**Live**, **Suspended**, **Removed**, **Needs reconnecting** or **Permissions not accepted**), and its enrolled repositories. Everyone can read it. An owner or admin connects a code host, uses a connection's **Reconnect** or **Re-grant** when its state calls for one, and opens **Enrol repositories** in the **Repositories** panel; a member reads that only an owner or admin can reconnect or re-grant a connection. [Managing repositories](https://latchkey.dev/documentation/managing-repositories#manage-repository-monitoring) walks through enrolling repositories, and [Install the GitHub App](https://latchkey.dev/documentation/install-the-github-app#if-the-installation-goes-wrong) through a connection that needs a fix.

### Why is an environment my workflow file names not on the Environments tab?

The tab lists only environments with branches set. Until an owner or admin sets them, that environment accepts every branch, and its jobs always wait for an approval.

### Can an API key or the CLI set an environment secret?

No. A key with **Allow setting workspace secrets** sets workspace and repository secrets only; an owner or admin sets an environment secret in the dashboard, at the **Environment** level of the Secrets tab.

### Who is told when a run waits for an approval?

Nobody: Latchkey sends no notification for it. An owner or admin approves or rejects it on the run page within 24 hours, or its waiting jobs end without starting.

### Can anyone see a secret's value after it is saved?

No. Latchkey never shows a saved value again, on the Secrets tab or through the API, and no API key can read one back.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
