- Category: B. Software Architecture
- English term: Secrets Management
- Related: Principle of Least Privilege (PoLP) · Sandbox and Guardrails · Zero Trust Access & Verification · Self-hosted Runner · Receipt and Definition of Done
General Meaning
Secrets Management is the practice of protecting sensitive credentials—API keys, database connection strings, SSH private keys, and service tokens—so they are never hardcoded into source files, configuration files, or Git repositories.
Instead, secrets are stored encrypted inside an OS keychain or dedicated secret manager and injected transiently at runtime via environment variables or inter-process pipes, eliminating accidental leaks in commits and logs.
Why It Matters
- Preventing accidental exposure in Git commits: Eliminates the risk of pushing hardcoded API tokens to remote repositories.
- Simplifying key rotation: Updating a token in the central keychain immediately updates all dependent jobs without changing or redeploying application code.
- Keeping plaintext secrets out of logs and AI transcripts: Prevents tokens from appearing in build logs, error traces, or LLM conversation histories.
How the Site Factory Uses It
The Site Factory strictly forbids committing secret values to Git and centers its secrets management around the encrypted macOS Login Keychain: (1) Cloudflare API token stored in keychain item honbu-cloudflare-deploy, used by unkou for Direct Uploads and provisioned across Mac mini, Studio 1, Studio 2, and MacBook; (2) GitHub fine-grained token stored in keychain item honbu-github-pipeline, scoped strictly to Administration and Contents for repository and PR automation; (3) R2 backup secret key stored in keychain item furusato-archive-r2, retrieved only during daily raw-data archival (backup.py); (4) 1Password MCP integration (rules.md K104), which passes only environment variable *names* so raw secret values never enter LLM chat prompts; and (5) macOS launchd session compliance, respecting macOS security constraints that block SSH sessions from reading GUI login keychains by running jobs inside proper launchd user sessions.
On self-hosted CI runners, workflows use a two-stage lookup that checks GitHub Secrets first and safely falls back to the local macOS Keychain.
Caveats & Operational Rules
- 'The repository is private' is never an excuse to commit secrets: Even in private repos, plaintext tokens must never appear in commits,
receiptrecords, or AI prompt logs. - Never pass secret values as command-line arguments: Command-line flags are visible to any process via
ps; always pass secrets via environment variables or standard input (stdin).
Related Terms
- Principle of Least Privilege (PoLP)
- Sandbox and Guardrails
- Zero Trust Access & Verification
- Self-hosted Runner
- Receipt and Definition of Done
References
- Book: Mark Richards & Neal Ford, *Fundamentals of Software Architecture*, Chapter 18 (Security Architecture)
Verified: 2026-11-08