Security & Permissions
Data Security and Keys
Model storage, encryption behavior, and key management guidance
Data Security and Keys
Local CLI state uses encrypted SQLite stores:
- City-local state and credentials:
~/.downcity/downcity.db - Federation admin profiles and session metadata:
~/.downcity/federation.db - Agent binding is stored in the CLI global DB as
execution.modelId
How secrets are protected
Provider apiKey, channel credentials, user sessions, and Federation administrator metadata are not stored in plaintext. Passwords are stored as PBKDF2 digests; session tokens are stored hashed or encrypted before being written to local SQLite stores.
city env is an explicit file-based configuration feature. Global Env is stored in plaintext at
~/.downcity/.env, and Workspace Env is stored in plaintext in the project .env. The Global file
is restricted to the current user, and project .env is added to .gitignore by default. Use the
launch environment or a secret manager when stronger secret protection is required.
Key source priority:
DC_MODEL_DB_KEY~/.downcity/main/model-db.key
Best practices
- Never commit
~/.downcityor any key material. - Use a secret manager to inject
DC_MODEL_DB_KEYin team/production environments. - After key rotation, validate model connectivity through CLI and one real invocation.
- Never commit Workspace
.env, and keep~/.downcity/.envaccessible only to your user account.