aws / aws/amazon-q-developer-cli

Feature Request: Support system-level instructions for agent prompts

Open
#3,314 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2k
Forks
439
PR merge metrics
No merged PRs in 30d

Description

## Summary

The agent `prompt` field is currently injected as a context entry rather than system-level instructions, limiting its authority and effectiveness.

## Current Behavior

Agent prompts are added to the conversation as context entries in `conversation.rs:841-842`:

```rust
if let Some(agent_prompt) = self.agents.get_active().and_then(|a| a.prompt.as_ref()) {
context_content.push_str(&format!("Follow this instruction: {}", agent_prompt));
}
```

This makes them easily overridable and treated as optional guidance rather than mandatory behavioral requirements.

## Expected Behavior

The agent `prompt` field should function as system-level instructions with higher authority than context entries. According to the [agent format documentation](https://github.com/aws/amazon-q-developer-cli/blob/main/docs/agent-format.md#prompt-field), it should be "similar to a system prompt."

## Root Cause

The underlying Q Developer API only supports `UserInputMessage` and `AssistantResponseMessage` types with no system prompt field in `ConversationState` (see `crates/amzn-codewhisperer-streaming-client/src/types/_conversation_state.rs`).

In contrast, AWS Bedrock Agents have proper system prompt support via the `instruction` field.

## Suggested Solution

Enhance the Q Developer API to support system-level instructions similar to Bedrock's approach, or improve the current implementation to give agent prompts higher priority and authority.

---

*Note: This implementation has been unchanged since commit `a48bfad0` (July 22, 2025).*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.