Secrets Management
How Syntropic137 handles secrets: file-based storage, Docker secrets, and 1Password integration.
Syntropic137 stores infrastructure secrets (database, Redis, and MinIO credentials) as file-based secrets with strict permissions, mounted into containers via Docker Compose's secrets mechanism. Application-level API keys (such as ANTHROPIC_API_KEY, CODEX_AUTH_JSON and OPENAI_API_KEY) are supplied via environment variables or .env files and injected only into the processes that need them.
How Secrets Work
Generation
During npx @syntropic137/setup init, three cryptographically random passwords are generated:
| Secret | File | Purpose |
|---|---|---|
| Database password | ~/.syntropic137/secrets/db-password.secret | PostgreSQL (TimescaleDB) |
| Redis password | ~/.syntropic137/secrets/redis-password.secret | Redis cache and pub/sub |
| MinIO password | ~/.syntropic137/secrets/minio-password.secret | S3-compatible artifact storage |
The secrets/ directory is readable only by the user who ran init. (Setup 1.0.2 and later make the directory 0700. The files mounted into containers, the three passwords above and the GitHub App private key, are 0644 so the containers can read them, while no other host user can reach them through the directory. The webhook and client secrets and any backups stay 0600. Earlier releases made every file 0600.)
Docker Secrets
The Docker Compose stack mounts secrets under /run/secrets/ in each container via Compose's secrets mechanism. The entrypoint script reads these files at startup and constructs connection URLs:
/run/secrets/db_password → POSTGRES_PASSWORD → DATABASE_URL / SYN_OBSERVABILITY_DB_URL
/run/secrets/redis_password → REDIS_URL with password
/run/secrets/minio_password → SYN_STORAGE_MINIO_SECRET_KEYThis means infrastructure secrets are:
- Never visible in
docker inspectoutput - Never stored in container image layers
- Read from files at container start and exported only into that container's process, not into its Compose-level environment
GitHub App Secrets
If you created a GitHub App during setup, additional secrets are stored:
~/.syntropic137/secrets/github-app-private-key.pem: App private key~/.syntropic137/secrets/github-webhook-secret.txt: Webhook verification secret~/.syntropic137/secrets/github-client-secret.txt: OAuth client secret
These live in the same owner-only secrets/ directory.
1Password Integration
Syntropic137 can load its configuration from one 1Password item at startup.
1Password Service Accounts require a 1Password Business or Enterprise plan. They are not available on personal or family plans.
Setup
- Create a Service Account in your 1Password account
- Add the token to your
.env:
OP_SERVICE_ACCOUNT_TOKEN=your-service-account-token- In the vault for your
APP_ENVIRONMENT(syntropic137for a self-hosted stack), create an item namedsyntropic137-configwith one field per variable, labelled with the variable's name, for exampleANTHROPIC_API_KEY.
At startup the API (which ships the op CLI) reads every field of that item and sets each label as an environment variable, unless that variable is already set. There is no op:// reference syntax: values in .env are used as written.
Coming soon: 1Password CLI (op) integration for personal and family plans: resolve secrets locally without a Service Account. See syntropic137/syntropic137#421 for progress.
Harness Credentials
A phase's harness credential is the one secret the agent needs at runtime. Which one is injected depends on the phase's agent.provider. Both are handled separately from infrastructure secrets:
| Provider | Credential | Notes |
|---|---|---|
claude | ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN | The OAuth token takes priority when both are set |
codex | CODEX_AUTH_JSON or OPENAI_API_KEY | CODEX_AUTH_JSON (the full contents of a Codex ~/.codex/auth.json) takes priority when both are set. OPENAI_API_KEY is turned into Codex's API-key auth.json. Either way the credential is injected file-only during setup, never passed through argv or logs |
- Stored in
.env(or resolved via 1Password) - Injected into agent workspaces during execution
- The only secret in the agent's environment
- A GitHub App installation token, scoped to the run's repositories, is written to
~/.git-credentialsand gh'shosts.ymlduring the setup phase and stays readable by the agent for the run (#725 tracks removing it)
Without CODEX_AUTH_JSON or OPENAI_API_KEY, a phase declaring agent.provider: codex has no credential and cannot authenticate. For a deployment credential that a developer running codex login on a laptop cannot revoke, use a ChatGPT Business or Enterprise access token: see Codex access tokens: setup and validation.
See Core Concepts: Workspaces for details on the two-phase security model.