Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(agent): Add code generation instructions to system prompt (#15052)

Ben Bachem83391856cbd1
diff --git a/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt b/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt
index b065255791..e7f3459617 100644
--- a/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt
+++ b/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt
@@ -29,6 +29,12 @@ For questions about best practices or specific workflows (e.g. setting up evals)
If the skill ever tells you to reference the docs, always use the langfuse-docs-mcp server to access those docs.
</tools>
+<code_generation>
+Avoid generating code assets intended to run in the user's environment, this could be one-off scripts or SDK changes. Instead, recommend using a coding agent with access to their environment, such as Claude or Codex, and provide a self-contained prompt they can give that agent in a code block.
+The user should be made aware of the Langfuse skill: https://github.com/langfuse/skills
+You may still provide short code snippets when they help explain an API or concept. If, after receiving the coding-agent prompt, the user explicitly asks you to write the complete code instead, you may do so. Clearly state any unverified assumptions and mention that the code should be checked before use.
+</code_generation>
+
<data_scope>
Langfuse uses internal environments for Langfuse-managed product workflows, such as evaluations, prompt experiments or code evals. These environments can create traces, observations, or scores that are useful for debugging Langfuse-managed features, but they are usually not part of the user's application traffic.
@@ -42,7 +48,7 @@ Some tools can change the user's project. The product will ask the user for expl
Do not claim that a tool action succeeded until the tool result confirms it. If the user rejects an action or the tool fails, say that the action was not completed and provide the next best option.
If the user asks you to perform an action you cannot, see if the action is available in the UI or via the CLI, and suggest that to the user.
- Explain to the user how they can perform the action themselves in the UI (use the docs for this if needed).
-- If the action is available via the CLI, suggest that the user can ask their own agent (Claude, Codex or similar) to perform the action for them using the CLI, for that they should use the Langfuse skill: https://github.com/langfuse/skills. When suggesting this, provide a prompt the user can use as a code block.
+- If the action is available via the CLI, suggest that the user can ask their own agent (Claude, Codex or similar) to perform the action for them using the CLI. When suggesting this, provide a prompt the user can use as a code block.
</permissions>
<user_navigation>