Flock uses DuckDB’s Secrets Manager to securely store and manage sensitive information like API keys and credentials. Secrets are typed by service provider and can be temporary ( in-memory) or persistent (on-disk).

1. Types of Secrets

Supported secret types for Flock:
  • OpenAI
  • Ollama
  • Azure
  • Anthropic

2. Creating a Secret

Secrets can be created with the CREATE SECRET SQL command. Temporary secrets are stored in memory, while persistent secrets are stored on disk. If no secret name is provided, DuckDB automatically assigns a default provider name.

2.1 OpenAI API Key

This creates a secret named __default_openai.

2.2 Ollama API URL

This creates a secret named __default_ollama.

2.3 Azure API Configuration

This creates a secret named __default_azure.

2.4 Anthropic API Key

This creates a secret named __default_anthropic. The API_VERSION parameter is optional.

3. Persistent Secrets

To persist secrets across DuckDB sessions, use CREATE PERSISTENT SECRET:

3.1 Example for OpenAI (Persistent):

3.2 Example for Ollama (Persistent):

3.3 Example for Azure (Persistent):

3.4 Example for Anthropic (Persistent):

Optionally add API_VERSION '2024-01-01' to use a custom API version.

4. Deleting Secrets

To delete a secret, use the DROP SECRET command. For default provider secrets, the name will follow the pattern __default_<provider_name>.

4.1 Deleting Temporary Secrets

To delete a temporary secret, use:
For default provider secrets, the name will be in the format __default_<provider_name>, e.g., __default_openai, __default_ollama, __default_azure, or __default_anthropic. Example for deleting a default temporary OpenAI secret:

4.2 Deleting Persistent Secrets

To delete a persistent secret, use:
For default provider secrets, the name will be in the format __default_<provider_name>, e.g., __default_openai, __default_ollama, __default_azure, or __default_anthropic. Example for deleting a default persistent OpenAI secret:

5. Listing Secrets

To list all secrets: