5.6 Advanced Agent Prompt Templates & Flow Customization

Key Takeaways

  • Prompt types include four core stages plus conditional memory and multi-agent stages.
  • Placeholder availability is model and prompt-type specific; inspect current documentation and the resolved template.
  • Disabling orchestration changes behavior and is not merely a latency optimization.
  • Version the model, template, parser, tools, and evaluation evidence as one release.
  • Protect trace data and diagnose repeated actions from evidence rather than one assumed cause.
Last updated: September 2026

5.6 Advanced Agent Prompt Templates & Flow Customization

Amazon Bedrock Agents builds prompts at defined runtime stages. Advanced prompts let a developer inspect or override the base template, inference configuration, and parser behavior for a stage. This is powerful but creates a versioned runtime contract: a placeholder or output structure that works for one model family may not work for another.

Prompt types and conditional stages

The core prompt types are pre-processing, orchestration, knowledge-base response generation, and post-processing. Post-processing is disabled by default. Memory summarization appears when memory is enabled, and multi-agent collaboration adds routing-classifier behavior. Current documentation may therefore display more prompt types than the familiar four-stage overview.

Pre-processing classifies or prepares an incoming request. Orchestration is the model-driven loop that selects action groups, knowledge bases, collaborators, or a final response. Knowledge-base response generation synthesizes retrieved content when that path is used. Post-processing can transform the final response when enabled. Memory summarization and routing classification serve their corresponding optional features.

Disabling a prompt is not equivalent across stages. Disabling pre-processing, knowledge-base response generation, or post-processing skips that step. Disabling orchestration causes the request to be sent to the model without the normal orchestration among APIs and knowledge bases. Treat that as an architectural change, not a latency toggle.

Placeholder variables are model specific

Use the current placeholder table for the chosen model and prompt type. The console can show how placeholders resolve for the configured agent. Do not teach one universal mandatory set.

For orchestration, question and agent_scratchpad are available across supported models, while tools versus functions, conversation_history, knowledge-base guidelines, memory fields, and other variables differ by model family and feature. Knowledge-base response generation uses query and search_results for supported models, with documented exceptions. Post-processing can use latest_response, question, responses, and model-specific variables. Multi-agent routing has its own collaborator and routing placeholders.

The scratchpad provides current-turn predictions and prior iteration output. Removing a placeholder used by the selected default contract can deprive the model or parser of required context, but repeated tool calls can also come from a malformed observation, vague tool descriptions, an idempotency defect, or a weak stopping condition. Diagnose from trace evidence rather than assuming one cause.

Safe customization workflow

Start by recording the agent model, instructions, action groups, knowledge bases, memory, collaborators, default template, and resolved placeholders. Copy the correct current template for that configuration and make the smallest change. If the model changes, the console warns that default-template behavior can replace an override, so preserve the reviewed source in version control.

When using UpdateAgent, set promptOverrideConfiguration deliberately: prompt type, creation mode, state, inference settings, parser mode, and optional override Lambda. A custom parser must understand every response form the prompt can generate. The agent execution role needs permission for the parser Lambda when one is configured.

Test ordinary requests, missing parameters, tool errors, knowledge-base queries, refusals, multi-turn context, and maximum-step behavior. Inspect traces under controlled access because they can contain prompts, tool arguments, retrieved data, or model reasoning material. Do not expose traces to end users.

Deployment and rollback

Prepare and test a working draft, then deploy through a reviewed alias/version workflow used by the application. Record template text, model, parser, inference parameters, action schemas, and evaluation set as one release. A rollback that restores only the template while leaving a changed tool schema or parser in place is incomplete.

The exam signal is compatibility: choose advanced prompts when a specific behavior cannot be achieved safely with defaults, preserve the documented variables for the exact model and stage, test the rendered prompt, and validate tool outcomes rather than optimizing only token count.

Multi-agent and memory compatibility

For a supervisor and collaborators, verify which payload and routing placeholders are populated and which agent owns the final response. Payload referencing can reduce repeated content, but it also creates a reference-resolution contract that must be tested across handoffs. A collaborator should receive only the context and permissions needed for its specialty. Evaluate ambiguous routing, collaborator failure, circular delegation, and attempts to smuggle instructions through a collaborator response.

When memory is enabled, test memory summarization separately from immediate conversation history. Confirm what is retained, how a user or tenant is bound to the memory identifier, and how deletion or correction works. Prompt customization must not turn a private memory summary into a broadly shared collaborator payload or trace. These tests belong in the same release gate as ordinary tool and knowledge-base behavior.

Loading diagram...
Agent Prompt Configuration and Verification Path
Test Your Knowledge

A team changes the foundation model used by a Bedrock Agent and wants to reuse a custom orchestration template. What is the safest next step?

A
B
C
D