AWS amazonq documentation change
Summary
Restructured documentation to remove detailed sections about working with prompt arguments for file-based prompts, clarified that only MCP prompts support arguments, and simplified examples.
Security assessment
The changes primarily reorganize content and clarify argument handling differences between file-based and MCP prompts. While security-related examples (e.g., 'security review') were removed from some code snippets, there is no explicit evidence of addressing a security vulnerability or weakness. The modifications focus on documentation structure rather than introducing/removing security features.
Diff
diff --git a/amazonq/latest/qdeveloper-ug/command-line-prompts.md b/amazonq/latest/qdeveloper-ug/command-line-prompts.md index 5e0a2d0d8..f93ccbafb 100644 --- a//amazonq/latest/qdeveloper-ug/command-line-prompts.md +++ b//amazonq/latest/qdeveloper-ug/command-line-prompts.md @@ -5 +5 @@ -About prompt typesCommandsUsing promptsWorking with prompt argumentsCreating prompts with argumentsStorage locationsPriority systemEnhanced featuresMCP integrationComprehensive examples +About prompt typesCommandsUsing promptsPassing arguments to MCP promptsStorage locationsPriority systemEnhanced featuresMCP integrationExamples @@ -108,5 +107,0 @@ Once you've created prompts, invoke them in chat using the @ prefix: -For prompts that accept arguments: - - - @prompt-name arg1 arg2 "argument with spaces" - @@ -117,131 +112 @@ For prompts that accept arguments: - # Uses the code-review prompt you created - - - @debug-help "connection timeout error" - # Passes the error message as an argument to the debug-help prompt - -## Working with prompt arguments - -Many prompts accept arguments to customize their behavior. Understanding how to discover, provide, and troubleshoot prompt arguments is essential for effective prompt usage. - -### Argument syntax - -Prompt arguments follow a simple positional syntax: - - - @prompt-name <required-arg> [optional-arg] - -###### Argument conventions - -`<required-arg>` - - -Arguments that must be provided - -`[optional-arg]` - - -Arguments that can be omitted - -`"quoted arguments"` - - -Use quotes for arguments containing spaces - -#### Quoting and special characters - - - # Arguments with spaces require quotes - @debug-help "connection timeout error" - - # Multiple word arguments - @code-review "src/main.py" "security review" - - # Single quotes also work - @generate-docs 'API Reference' 'markdown' - - # Mix quoted and unquoted arguments - @analyze-logs error "last 24 hours" --verbose - -### Discovering prompt arguments - -Use the `/prompts details` command to see what arguments a prompt accepts: - - - /prompts details prompt-name - -This shows: - - * Required and optional arguments - - * Argument descriptions and purposes - - * Usage examples with proper syntax - - * Validation requirements - - - - -#### Example: Discovering arguments - - - /prompts details code-review - - # Output: - # Name: code-review - # Server: development-tools - # - # Usage: @code-review <file-path> [review-type] - # - # Arguments: - # (required) file-path - Path to the file to review - # (optional) review-type - Type of review (security, performance, style) - -### Argument validation and errors - -The CLI validates prompt arguments and provides helpful error messages: - -#### Missing required arguments - - - # Calling prompt without required arguments - @code-review - - # Error output: - # Error: Missing required arguments for prompt code-review - # Usage: @code-review <file-path> [review-type] - # Arguments: - # (required) file-path - Path to the file to review - # (optional) review-type - Type of review (security, performance, style) - -#### Invalid argument values - - - # Providing invalid argument values - @validate-email "not-an-email" - - # Error output: - # Error: Invalid arguments for prompt validate-email: - # - email: Must be a valid email ending in .com - # Use '/prompts details validate-email' for usage information. - -### Server-specific prompts - -When multiple MCP servers provide prompts with the same name, specify the server: - - - # Ambiguous prompt error - @analyze - - # Error: Prompt analyze is ambiguous. Use one of the following: - # - @dev-tools/analyze - # - @security-tools/analyze - - # Use server-specific syntax - @dev-tools/analyze "performance issues" - @security-tools/analyze "vulnerability scan" - -## Creating prompts with arguments - -You can create both file-based and MCP prompts that accept arguments for dynamic content generation. + # Uses your local code-review prompt @@ -249 +113,0 @@ You can create both file-based and MCP prompts that accept arguments for dynamic -### File-based prompts with arguments @@ -251 +115,2 @@ You can create both file-based and MCP prompts that accept arguments for dynamic -File-based prompts (local and global) receive arguments as contextual information when invoked. The arguments are provided to the AI model along with the prompt content, but file-based prompts do not have built-in templating or argument substitution. + @team-standup + # Uses your team-standup prompt @@ -253 +118 @@ File-based prompts (local and global) receive arguments as contextual informatio -#### Example: Creating a parameterized prompt +## Passing arguments to MCP prompts @@ -254,0 +120 @@ File-based prompts (local and global) receive arguments as contextual informatio +MCP server prompts can accept arguments to customize their behavior. File-based prompts (local and global) do not support arguments. @@ -256,2 +122 @@ File-based prompts (local and global) receive arguments as contextual informatio - # Create a code review prompt - /prompts create --name code-review --content "Please review this code for best practices, security issues, and potential improvements. Pay special attention to the specific aspects mentioned in the arguments." +### MCP prompt argument syntax @@ -259,3 +123,0 @@ File-based prompts (local and global) receive arguments as contextual informatio - # Usage with arguments - @code-review "src/auth.py" "security focus" - # The AI receives both the prompt content and the arguments as context @@ -263,47 +125 @@ File-based prompts (local and global) receive arguments as contextual informatio -**Note:** File-based prompts pass arguments as additional context to the AI model. The model interprets how to use the arguments based on the prompt content and the provided argument values. - -### MCP prompt arguments - -MCP servers can define structured argument schemas with validation, descriptions, and type information. These provide the richest argument experience with automatic validation and help text. - -#### Understanding MCP argument schemas - -MCP prompts define arguments with: - - * **Name** : The argument identifier - - * **Description** : What the argument is for - - * **Required** : Whether the argument is mandatory - - * **Validation** : Rules for valid values - - - - - - # Example MCP prompt schema (shown via /prompts details) - /prompts details aws-troubleshoot - - # Output: - # Name: aws-troubleshoot - # Server: aws-tools - # - # Usage: @aws-troubleshoot <service> <error-message> [region] - # - # Arguments: - # (required) service - AWS service name (e.g., ec2, s3, lambda) - # (required) error-message - The error message you're seeing