A Langfuse secret key is half of the key pair that your application uses to send traces, prompts and evaluation data to Langfuse, the open-source observability platform for language model applications. The public key is paired with it, and the secret key is the part that must stay private. Whoever holds the secret can read the traces of the project, which often include user inputs, model outputs, prompt templates and internal tool results. A leak can therefore expose far more than the key itself, and it deserves quick action.
Check your GitHub account for leaked secrets — free
- Provider
- Langfuse
- Severity
- High
- Impact
- SaaS account access and billing
- Checked live by LeakWatch
- No
What a Langfuse secret key looks like
Langfuse secret keys begin with sk-lf-, followed by a UUID-style value made of groups of hexadecimal characters separated by hyphens. Public keys use the pk-lf- prefix instead, and they are meant to be visible in client code. Only the secret key is sensitive:
sk-lf-XXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX (secret key, masked)
pk-lf-… (public key, not secret)
The secret key is usually stored in an environment variable named after the Langfuse host and project, next to the public key and the host address. It is shown in full only when it is created, so a value you find in a file was copied from a settings page at some point. Keys belong to a project, so the same key works for every service that uses that project.
How Langfuse secret keys get leaked
- Environment files. A
.envfile with the secret key, committed to a repository because the ignore rules did not cover it. - Front-end code. A secret key placed in a browser application. The public key may be exposed by design, but the secret key must stay on the server, and anyone who can open the page can read a value that is bundled into it.
- Notebooks and scripts. A research notebook that sends traces from a laptop, with the key typed into a cell and saved when the notebook is shared.
- Container images. A build that copies the configuration into an image, which is then pushed to a registry.
- Shared examples. A snippet posted in a tutorial, a forum or a bug report, with the real key left in place of the placeholder.
What to do in the first hour
- Delete the secret key. Open the Langfuse project settings, go to the API keys section, and delete the key that was exposed. Deleting ends its use for new requests. Do this before you clean the repository. Make sure you are in the right project, because keys are scoped to one project.
- Create a replacement pair and store the new secret key in a secret manager or in your hosting provider’s environment settings. The secret is shown only once when it is created, so copy it at that moment.
- Update the services that send traces. Deploy the new value, and confirm that new traces appear in the project.
- Review the traces. Look at the trace history for the period since the key may have been exposed. Check for traces from sources you do not recognize, for unusual volumes, and for data that your application would not send, such as traces from an unknown environment name.
- Check the other secrets in the same file. Language model applications usually hold several keys, such as a model provider key and a database password. Rotate any that sat next to the Langfuse key.
- Clean the repository after the rotation: remove the value from the files, add the file to
.gitignoreand decide whether to rewrite history. The order of steps is in I accidentally pushed an API key to GitHub.
Not sure what else leaked? Run a free scan.
Revoke it at Langfuse
Open the account settings for your Langfuse project and go to the settings section, then to the API keys list. Find the key pair that holds the leaked secret and delete it, then create a new pair. A third-party write-up describes creating new keys before deleting old ones, so that services can be switched first, and that is a sensible order either way. We could not confirm the exact labels from the official Langfuse documentation during this review, so check what the project settings show. Keys that are deleted cannot be restored.
How LeakWatch detects it
The rule is called Langfuse Secret Key. It looks for the fixed sk-lf- prefix, followed by a value in the groups-of-hexadecimal-characters shape, in the form of eight, four, four, four and twelve characters separated by hyphens, and then a delimiter such as a quote, a space, a semicolon or the end of the line. Public keys with the pk-lf- prefix are not reported, since they are meant to be visible. The severity is high, with the impact class for SaaS services. This type is not checked live: LeakWatch does not send the key to Langfuse.
LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.
FAQ
Is the public key a problem too?
Less so. The public key is designed to appear in client-side code, and on its own it cannot read traces. It is still good practice to replace it when you replace the secret, so the pair stays matched.
Will my application lose traces while I rotate?
Traces sent with the old key will fail once it is deleted. Create the replacement, deploy it, then delete the old key. If the leak is active, the short gap in traces is a fair price.
Should I look at prompts as well as traces?
Yes. Prompt templates and stored evaluations are part of the same project, so anyone with the secret key can read them. Check whether the prompts contain anything sensitive, such as internal instructions, and rotate any other credentials they mention.