Skip to contentSkip to page list

Docs

Secrets

Encrypted, write-only credentials stored per project and referenced by name from workflow code blocks and HTTP agents.

On this page

What a secret is

A secret is a named value that LangWatch stores encrypted for one project and never shows again. You reference it by name from the places that need it, so the credential is not written into the workflow or the agent definition.

Manage secrets at Settings > Secrets. Listing needs secrets:view; creating, updating and deleting need secrets:manage, which the Member and Admin team roles hold.

Rules

RuleValue
NameUppercase letters, digits and underscores, starting with a letter: ^[A-Z][A-Z0-9_]*$
Value1 to 10,000 characters
Limit50 secrets per project
StorageAES-256-GCM, encrypted at rest
Read backNever. You can replace the value or delete the secret

Creating a secret with an existing name is refused. To change a value, open the row menu and pick Update value.

Where a secret is used

Workflow code blocks. Every secret of the project is available in the Python code block as secrets.NAME. The code editor lists the names in its Secrets popover and inserts a reference on click.

example.pyPython
import requests​response = requests.get(    "https://api.acme.example/v1/items",    headers={"Authorization": f"Bearer {secrets.ACME_API_KEY}"},)

HTTP agents in Agent Testing. Write {{ secrets.NAME }} in the URL, a header value or an auth field of an HTTP agent. LangWatch resolves it when it builds the request, leaves an unknown name as written, and scrubs the resolved value from errors and spans. The request body is never substituted.

example.txtText
Authorization: Bearer {{ secrets.ACME_API_KEY }}

API

The Secrets API lists, creates, updates and deletes secrets with a project API key. The list response never includes values.

Documentation