Secret Classes
1. Paperclip infra secrets
These are owned by the deployment, not by any company or provider integration.BETTER_AUTH_SECRETPAPERCLIP_AGENT_JWT_SECRETPAPERCLIP_SECRETS_MASTER_KEYorPAPERCLIP_SECRETS_MASTER_KEY_FILEDATABASE_URLPORKBUN_API_KEYandPORKBUN_SECRET_API_KEY
2. Paperclip company secrets
These are encrypted at rest and stored in the Paperclip database as company-scoped secret refs.- LLM keys used by agents
- service tokens used by adapters
- any other runtime value that should rotate without editing code or compose files
3. Provider-connected-account auth
These are external account grants, refresh tokens, webhook credentials, or opaque connection IDs managed by the provider layer.- keep the provider grant with the provider or connector
- keep only the reference or sync metadata in Paperclip, if Paperclip needs to know about the connection at all
Default Provider: local_encrypted
Secrets are encrypted with a local master key stored at:
Configuration
CLI Setup
Onboarding writes default secrets config:Environment Overrides
| Variable | Description |
|---|---|
PAPERCLIP_SECRETS_MASTER_KEY | 32-byte key as base64, hex, or raw string |
PAPERCLIP_SECRETS_MASTER_KEY_FILE | Custom key file path |
PAPERCLIP_SECRETS_STRICT_MODE | Set to true to enforce secret refs |
Strict Mode
When strict mode is enabled, sensitive env keys matching*_API_KEY, *_TOKEN, *_SECRET, *_PASSWORD, and similar patterns must use secret references instead of inline plain values.
Agent Env Binding
Agent environment variables use secret references:Rotating Hosted Secrets
For hosted deployments:- rotate infra secrets in the platform secret store
- rotate company secrets through the Paperclip secret API
- rotate provider-connected-account auth in the provider UI or connector control plane
Recovery Notes
- If the master key file is missing in local dev,
paperclipai doctorcan recreate it. - If strict mode is off in a PostgreSQL deployment, Paperclip will warn rather than fail, but that is still a policy gap.
- Never commit decrypted values or copied
.envvalues into repo-managed config.