Skip to content

Data files

All data is in the Docker volume cyproxy-data, mounted at /data. Only the Cyproxy user can read the files.

File Contents
secrets.json Integration keys, vendor sign-in tokens and the model key of the Agent.
store.json Collections, the recent audit entries, usage, access tokens (as hashes) and connected apps.
governance.json Approved tool definitions, calls that wait for approval, and the governance settings.
users.json The owner account: the email address, the password hash (scrypt), the authenticator secret (encrypted), the hashes of the recovery codes, and the authenticator app requirement.
audit.jsonl The audit log with the hash chain. See Audit log.
agent/ The conversations of the Agent.
results/ Complete tool results, kept for 7 days.
overrides.json The integrations that are on, and console settings.
skills/ The skills that you imported from the Feedly library, with their source and licence.
admin-password A temporary owner password. This file exists only after --reset-password. Cyproxy deletes it when the owner sets a new password.
session-key The key that signs console sessions. It is encrypted.
master-key The encryption key, if Cyproxy made it. This file does not exist when you supply the key. See What is encrypted.

What is encrypted

Cyproxy encrypts each stored secret before it writes the secret to the volume. Encryption is always on. You cannot turn it off.

Item File On the disk
Integration keys secrets.json Encrypted. The complete file is encrypted, the names of the keys included.
Vendor sign-in tokens secrets.json Encrypted.
The model key of the Agent secrets.json Encrypted.
The authenticator secret users.json Encrypted. Only this value is encrypted. The other contents of the file stay readable.
The client secret and the sign-in data that a vendor sign-in uses store.json Encrypted. Only these values are encrypted.
The key that signs console sessions session-key Encrypted.
The owner password users.json A hash (scrypt).
Recovery codes users.json A hash.
Access tokens and the tokens of connected apps store.json A hash.

One secret is not encrypted, and this is deliberate:

  • admin-password, the temporary owner password. The file exists only after --reset-password. The person who ran the command reads the password from the file. Cyproxy deletes the file when the owner sets a new password.

These files are not encrypted because they are not stored secrets:

  • master-key. This is the encryption key itself.
  • Collections, the audit log, Agent conversations, tool results, tool definitions and settings.

The encryption key

Cyproxy uses the first key that it finds:

  1. CYPROXY_ENCRYPTION_KEY: the key, in .env.
  2. CYPROXY_ENCRYPTION_KEY_FILE: the path of a file in the container that contains the key.
  3. The file master-key in the data volume. Cyproxy makes this key at random the first time that it stores a secret.

A key that you supply must be 32 bytes, written as base64 (44 characters) or as hex (64 characters). Cyproxy refuses a value of a different length, and a value in which almost all bytes are the same.

Cyproxy cannot tell a weak key from a strong key. If you type 44 characters that you chose yourself, Cyproxy accepts them, and the encryption is only as strong as that text. Do not type a key and do not use a password. Make the key with this command:

openssl rand -base64 32

The console and the logs never show the key.

Limits

  • A person who controls the running server can read your keys. Cyproxy must use the keys, so it must have the encryption key while it runs. Encryption protects the files, not the running program.
  • With the default key, a copy of the complete volume contains the key. The file master-key is in the same volume as the encrypted files. A person who has the complete volume, or a complete backup, can read your keys. A person who has only secrets.json or users.json cannot.
  • On a server, supply the key. Set CYPROXY_ENCRYPTION_KEY. Then the volume and its backups do not contain the key. Keep a copy of the key in a different safe location. Without the key, nobody can read the stored keys, and you must enter them again.
  • A key in .env is on the same computer as the volume. A person who controls that computer can read the two. Let only the administrator read .env.
  • Cyproxy accepts a plain secret in three cases only. See When Cyproxy accepts a plain secret. In all other cases, Cyproxy stops and names the file. It does not read the file and it does not change it.
  • If you supply the key, a person who can only write to the volume cannot replace an encrypted file with a plain file. That person cannot remove your key and cannot set CYPROXY_CONVERT_PLAIN, because the two settings are not in the volume.
  • With the default key, a person who can write to the volume can replace all the secrets. The key is the file master-key in the volume. That person can delete master-key and all encrypted items, and then put plain files there. Cyproxy then sees an installation that never encrypted anything, and it accepts the plain files. Your stored secrets are destroyed, and Cyproxy uses the secrets of that person. That person can also read master-key and make correctly encrypted files. On a server, supply the key.
  • An older encrypted file is accepted. Cyproxy keeps no version number for an encrypted file. A person who can write to the volume, and who has an older copy of secrets.json that was encrypted with the same key, can put the older copy back. A key that you removed after that copy was made is then in use again. Cyproxy cannot tell this from a backup that you restore. If a key must not be used again, revoke it at the vendor.
  • These rules do not protect data that is not encrypted. A person who can write to the volume can change a password hash or a setting.

To change the key, or to move from the default key to your own key, see Change the encryption key.

Technical details

Cyproxy uses AES-256-GCM with a new random 96-bit nonce for each write. An encrypted file is a small JSON document:

{"cyproxy_sealed": 1, "alg": "AES-256-GCM", "kid": "…", "nonce": "…", "data": "…"}

kid is a short hash of the key. Cyproxy uses it to tell an incorrect key from a damaged file. It is not the key. The name of the file is part of the check, so one encrypted file cannot replace a different one.

An encrypted value in users.json, store.json or session-key starts with sealed:v1:. Its place is part of the check: the file, the item that it belongs to, and the field. If someone copies an encrypted value to a different file, item or field, Cyproxy cannot open it there. Cyproxy then stops and reports that the value is damaged.

When Cyproxy accepts a plain secret

A plain secret is a secret that is not encrypted in a place where Cyproxy keeps an encrypted secret. Cyproxy accepts a plain secret, and encrypts it, only when Cyproxy starts and one of these conditions is true:

  1. The installation has no encryption key and nothing encrypted. You did not set CYPROXY_ENCRYPTION_KEY or CYPROXY_ENCRYPTION_KEY_FILE, the volume has no master-key file, and no item in the volume is encrypted. This is the first start after an update from a version without encryption. You do nothing.
  2. You started Cyproxy with CYPROXY_CONVERT_PLAIN=1. This setting is in .env, not in the volume. Use it for one start, then remove it. While it is set, Cyproxy encrypts each plain secret that it finds at a start, and the log tells you to remove the setting.
  3. An earlier start began this work and was interrupted. Cyproxy recorded the plain files in an encrypted file (sealing.json) before it changed the first one. The next start accepts only those files, and only if they did not change.

In all other cases, Cyproxy stops and names the file. This applies when Cyproxy starts and while it runs.

After an update from a version without encryption

The first start encrypts the secrets that the old version stored as plain text. Cyproxy does this one time. If the first start is interrupted, the next start completes the work.

  • If you do not supply a key, you do nothing. Cyproxy makes the key and encrypts the secrets.
  • If you supply a key at the same update, also set CYPROXY_CONVERT_PLAIN=1 in .env for that one start. Without it, Cyproxy stops and the log tells you to set it. Remove the setting after the start.

Backups that you made before the update still contain plain text. Delete them or protect them. To restore such a backup, restore the complete volume. If you supply a key, or if you restore only one plain file, start Cyproxy one time with CYPROXY_CONVERT_PLAIN=1.

Damaged files

If Cyproxy cannot read a data file, it stops. It does not replace the file with an empty file. Restore a backup, or move the file out of the volume to start that file again.

Cyproxy also stops if a secret is plain where an encrypted secret belongs. See Limits.

Cyproxy also stops if a file was encrypted with a different key, or if the key is missing. It does not make a new key and it does not change the file. The message names the file and the setting to check. See Restore without the encryption key.