Skip to main content
Applies to: Embedded ❌, Enterprise ✅ Early access A Secret is a catalog object, like a table or a namespace: a named credential, such as a model provider’s API key, stored once and addressed by name. A Function binds a Secret by reference when you register it, never by value; see Vend a Secret to a Function for how that binding reaches running code. The design rule is bind by reference, resolve late. A Function records which Secret it reads, never the value, and the value is looked up each time a job starts. That is what lets a credential be rotated or revoked without touching the Functions, columns or tables that use it.

Create and manage

Every call takes an optional namespace_path; the default is the root namespace.
A Secret’s value is never returned by any interface: create and alter take it as input and return nothing, and describe reports only metadata. Python and Rust both expose the full lifecycle shown above; TypeScript does not yet, and is tracked separately. See the SQL reference for the same operations’ SQL syntax and result rows.
SQL has no syntax for binding a Secret to a Function. Register Functions that bind Secrets through the Python SDK; see Vend a Secret to a Function.

Properties and guarantees

LanceDB guarantees that:
  • No API returns a Secret’s value.
  • Values do not appear in Function source, Function versions, jobs, logs, or error messages. Errors raised by Function code are redacted, within limits.
  • A Function receives only the Secrets bound to it.
  • Values are always encrypted at rest.
Redaction is a safety net, not a boundary: Function code that logs, returns or sends a credential will leak it.

Encryption at rest

Every Secret’s value is encrypted directly with your deployment’s key in AWS KMS, Google Cloud KMS, or Azure Key Vault — there is no separate application data key to manage. Storage, backups and replicas hold only ciphertext. Decryption goes through your KMS, which records it in your cloud’s audit log. BYOC You are responsible for the network egress policy for the jobs that run Functions.

Redaction

If a Function raises an error or skips a row with a message that contains a bound value, LanceDB replaces each exact occurrence with [REDACTED] before the message is recorded. Redaction matches only the exact value: a value that is base64-encoded, sliced, or otherwise transformed is not caught. Function code that prints a credential, writes it into a column, or sends it elsewhere will leak it, so review a Function bound to a Secret as code that holds that credential.

Limits

Reserved variables

A Secret cannot be bound to a variable that LanceDB sets for Functions itself. These names are reserved:
  • Exact names: HOME, PATH, TEMP, TMP, TMPDIR, LANG, LC_ALL, LC_CTYPE, TZ, HTTP_PROXY, HTTPS_PROXY, NO_PROXY (and their lowercase forms), SSL_CERT_FILE, SSL_CERT_DIR, REQUESTS_CA_BUNDLE, UV_CACHE_DIR, UV_NATIVE_TLS, UV_PYTHON_INSTALL_DIR, RUST_BACKTRACE
  • Prefixes: DYLD_, LANCE_, LANCEDB_, LD_, PYTHON, and a few others LanceDB reserves for its own use. create_function refuses a reserved name and says which one.

Troubleshooting

Secret 'X', bound to VAR, does not exist when adding a column or refreshing one: the Secret was never created in that namespace, was dropped, or its name is misspelled in the binding. Create it, or register a new Function version with the right name. 501 from a Secret API call: Secrets aren’t enabled for this deployment. Contact LanceDB support.

Privileges

A Secret is its own object in the authorization model, a namespace child like a table, so a grant names one credential rather than a whole database. See Privileges for the privilege each operation above requires, and GRANT and REVOKE for the full SQL statement syntax.

What to read next

Vend a Secret to a Function

Bind a Secret when you register a Function, and how rotation reaches code that is already running.

Privileges

Grant and revoke privileges on a Secret.