From 80e2c34b7f18b5b655e00d6a44e818e8f67dbbfc Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 21 Jun 2025 20:54:54 +0000 Subject: [PATCH] Address comprehensive GitHub review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add explicit security warnings about prompt injection and stop sequence pitfalls - Enhance troubleshooting section with additional actionable guidance - Improve default parameter behavior documentation - Add cross-references for better navigation - Clean up duplicate warnings from previous commits Addresses feedback from joaomdmoura and mplachta reviews Co-Authored-By: João --- docs/how-to/customize-prompts.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/how-to/customize-prompts.mdx b/docs/how-to/customize-prompts.mdx index 5ca03eddc..e49d8d46f 100644 --- a/docs/how-to/customize-prompts.mdx +++ b/docs/how-to/customize-prompts.mdx @@ -151,7 +151,7 @@ agent = Agent( ) ``` -> **Note:** If `system_template`, `prompt_template`, or `response_template` are not provided, the default templates from `translations/en.json` are used. +> **Note:** If `system_template`, `prompt_template`, or `response_template` are not provided, the default templates from `translations/en.json` are used. The default system template includes role-playing instructions, tool descriptions (if applicable), and task formatting guidelines. ### Custom Stop Words via Response Template @@ -311,6 +311,8 @@ NEXT STEPS: [Recommend next actions]""", **Stop Words Not Effective**: Check that your `response_template` includes the desired stop sequence after the `{{ .Response }}` placeholder. See [Stop Words Configuration](#stop-words-configuration) for guidance. +**Template Injection Concerns**: Review the [Security Considerations](#security-considerations) section for guidance on preventing prompt injection attacks. + ### Debugging Prompts Enable verbose mode to see the actual prompts being sent to the LLM: @@ -326,11 +328,13 @@ agent = Agent( ### Additional Troubleshooting Steps -#### Additional Troubleshooting Steps - **Verify prompt payloads**: Use verbose mode to inspect the actual prompts sent to the LLM - **Test stop word effects**: Carefully verify that stop sequences don't cause premature truncation - **Check template syntax**: Ensure placeholders like `{{ .System }}` are correctly formatted - **Validate security**: Review custom templates for potential injection vulnerabilities as described in [Security Considerations](#security-considerations) +- **Revert to defaults**: If custom templates aren't working, temporarily remove them to isolate the issue +- **Test incrementally**: Add one custom template at a time to identify which component is causing problems +- **Validate template parameters**: Ensure all required parameters (role, goal, backstory) are provided when using custom templates For more troubleshooting guidance, see the sections above on [Best Practices](#best-practices) and [Security Considerations](#security-considerations).