Security: skill instructions can leak LANGFUSE_SECRET_KEY into agent context #21
Closed
ishii1648
started this conversation in
Ideas & Improvements
Replies: 1 comment 1 reply
-
|
Note on the choice of channel: I considered filing this as an Issue (with a Happy to convert this to an Issue or open a parallel Issue if maintainers prefer — please let me know what fits the repo's triage workflow best. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe your idea or feedback
The skill contains three patterns that can cause
LANGFUSE_SECRET_KEYto flow into the coding agent's context (and from there into LLM provider logs and persistent transcript files such as~/.claude/projects/**/*.jsonl). They differ in scope, so I'll separate them:1. Echoing the secret key (
references/prompt-migration.md, lines 13-18)A compliant agent will run
echo $LANGFUSE_SECRET_KEYand the value lands in its context and transcripts.Scope: this file is loaded only when the agent is invoked specifically for the prompt-migration workflow — it is not loaded on every Langfuse interaction. So this concrete echo command is gated by that use case rather than always-on. Even so, the agent never needs to read the actual key value; an existence check is sufficient.
2. Asking the user to paste API keys into chat (
SKILL.md,references/cli.md)Both the entry-point
SKILL.mdandreferences/cli.mdsay:This is loaded on every invocation of the skill. The natural user response is to paste the secret key directly into the chat, which produces the same end state as #1 (key in context + transcripts).
3.
--curlpreview inreferences/cli.mdreferences/cli.mdrecommends--curlto preview HTTP requests. If the CLI's--curloutput emits theAuthorizationheader, agents using this flag for debugging will surface the secret. I have not verified the actual CLI behavior — flagging for the maintainers' attention.Why this matters
The Langfuse secret key grants full API access — read all traces, overwrite/delete prompts, mutate scores. Once it lands in an agent's transcript:
This is the CWE-532 / CWE-200 anti-pattern.
What would the ideal outcome look like?
prompt-migration.mdprerequisites — replace value-printing with an existence check, e.g.:SKILL.md/cli.md— reword "ask the user for their API keys" to instruct the agent to ask the user to set the env vars in their shell or.envfile, rather than provide them in chat.cli.md--curl— verify whether the output includes theAuthorizationheader. If it does, either mask it in the CLI itself or add a warning discouraging agent use of--curlagainst authenticated endpoints.These changes preserve the diagnostic value of the prerequisites while removing the leak surface entirely.
Beta Was this translation helpful? Give feedback.
All reactions