# What runs where

Where a secret's value is decrypted, who it is handed to, what the platform records, and what happens when a source or a key fails.

Secrets runs nothing on your machines. Values are encrypted and decrypted in the control plane.
These are the main points where a value is handed out:

| Who reads               | When                                | Checked                                                                                 | Recorded in the access log as  |
| ----------------------- | ----------------------------------- | --------------------------------------------------------------------------------------- | ------------------------------ |
| You (console, CLI, API) | **Reveal value**, `get-value`       | `secrets:GetSecretValue`                                                                | your IAM user, by version      |
| An app                  | at each rollout                     | a `deploy` grant                                                                        | `deploy`, the app              |
| A workflow job          | before the job starts               | an `actions` grant for the repository and the run's IAM user's `secrets:GetSecretValue` | `actions`, the repository      |
| A promotion             | when a stored secret is promoted    | `secrets:PromoteSecret` and the target's permission                                     | `promoted to <environment>`    |
| A source's sync         | on schedule, at rollouts, on demand | —                                                                                       | in the credential secret's log |

Other services read secrets too, recorded in the access log under their consumer: a function's
secret environment (`compute`), a pull-through cache rule's upstream password (`registry`), and an
app's registry login, database binding or Error Tracking connection (`deploy`).

An app's machine receives its environment from the control plane at rollout; the value is not
written into the image or the build log. A rotation reaches running processes only at their next
rollout or run; the flow view marks a consumer that last read an older version as stale.

## Comparing values

**Compare values**, the diff and a promotion plan compare values on the server and answer equal or
not. No value is returned. Each comparison is checked against `secrets:CompareSecretValues` and
recorded in the audit log.

## Sources

The control plane talks to 1Password through its SDK with the service-account token, and to Vault
or OpenBao over its HTTP API. It reads only. For Vault it connects only to `https://` addresses that
resolve to public addresses, does not follow redirects, and gives up after 10 seconds.

Every five minutes the platform syncs each source whose refresh interval has passed since its last
sync. When the source itself fails (a revoked token, the provider unreachable), its status under
**Sources** is `error` with "Sync failed: …. Secrets keep their last synced values.", every synced
secret keeps its last value, and rollouts use the last values. When one
reference fails, only that secret shows the error.

## Keys

A secret whose KMS key is disabled, scheduled for deletion or without material cannot be read by
anyone; see [Keys and encryption](keys-and-encryption.md).

## Related

- [Security in Secrets](security.md)
- [Monitoring Secrets](monitoring.md)
