# Shared: Secrets policy

The single statement of secret handling across specs, YAML, auth setup, fixtures,
notes, reports, and CI workflows. Consumed by `setup-test-auth`, `create-yaml-tests`,
`cover`, `fix`, `ci`, `create-agent-verification`.

- **Never commit raw secrets** — no real passwords, API keys, tokens, cookies, or
  one-time codes in specs, tests, fixtures, config, notes, or docs.
- Credentials belong in `.env` (or CI secrets). Specs, notes, config, and YAML may
  reference **env var names** or **`{{NAME}}` placeholders**, never the literal value.
- Commit only variable names, roles, access patterns, and setup instructions.
- **A `{{NAME}}` placeholder is not an env var.** In a YAML step (`text`, `intent`,
  `VERIFY:`), it resolves from the run's variables: `use.variables` in
  `playwright.config.ts`, parameter values, or values saved earlier in the test.
  A `.env` entry alone is not a variable, and an unresolved placeholder is typed
  literally. Map each env var you use in the `playwright.config.ts` beside the YAML
  (an embedded UI project has its own); `shiplightConfig()` has loaded `.env` by then:

  ```ts
  use: {
    variables: {
      SHOP_EMAIL: process.env.SHOP_EMAIL ?? '',
      SHOP_PASSWORD: { value: process.env.SHOP_PASSWORD ?? '', sensitive: true },
    },
  },
  ```

  Mark passwords and tokens `sensitive: true` (masked in logs). Placeholders are not
  filled in a `js:` body; read `testContext.get('NAME')` there.
- **Auth scripts read `process.env` directly.** `use.account.args` and
  `auth.setup.ts` get no placeholder filling: pass env var *names* in `args` and
  read the values in the script. See `_shared/auth.md`.
