System Prompts in Amazon Bedrock: Write, Test, and Reuse Them

Amazon Bedrock hosts multiple models with different instruction formats. Here is how to write system prompts for each, test them in the Bedrock Playground, version them in Prompt Management, and save lessons from evaluations.

Updated 4 min read

Amazon Bedrock is a managed service that provides access to foundation models from Anthropic, Amazon, Meta, Mistral, and others through a unified AWS API. Each model family has its own instruction format, and Bedrock provides tools for testing and versioning prompts without managing the underlying infrastructure. Tools like fenbs keep the approved prompt versions and lessons from evaluation outside the AWS console, available to every connected assistant.

Check the Amazon Bedrock documentation (opens in a new tab) for current API references, available model IDs, and supported parameters. Model availability and API features change as AWS updates the service.

How system prompts reach the model in Bedrock

Bedrock provides two main APIs for running inference: the older InvokeModel API, which takes a model-specific JSON body, and the newer Converse API, which uses a consistent format across models. For new applications, the Converse API is the recommended path because it handles format differences across model families.

In the Converse API, you pass a system parameter as a list of content blocks alongside the messages array. This puts your system instructions in a consistent place regardless of which model you are calling. The API translates your system parameter into the format each model expects.

A Converse API call with a system prompt (Python, using boto3)
import boto3

client = boto3.client("bedrock-runtime", region_name="us-east-1")

response = client.converse(
    modelId="anthropic.claude-3-5-sonnet-20241022-v2:0",
    system=[
        {"text": "You are a technical writing assistant. Respond in plain US English. Keep paragraphs to four sentences or fewer."}
    ],
    messages=[
        {"role": "user", "content": [{"text": "Explain what a context window is."}]}
    ]
)

Model-specific instruction handling

Even with the Converse API abstracting the format, the underlying models handle instructions differently. Claude models (from Anthropic) treat the system prompt as a first-class instruction layer and respond well to structured prompts with XML tags. Amazon Titan models have their own format expectations. Meta's Llama models use special tokens derived from their training.

If you use the InvokeModel API directly, you must format the request body in the model-specific format. For example, calling Claude through InvokeModel requires the Anthropic messages format, including the system field outside the messages array. Mistral models use their own instruction format.

The practical implication: write your system prompt for the specific model family you are using, and test it there. A prompt that works well with Claude may need revision before it works as well with a Titan or Llama model.

The Bedrock Playground

The Amazon Bedrock console includes a Playground for testing prompts interactively. You can choose a model, set a system prompt in the System instructions field, send messages, and see how the model responds. The Playground is the fastest way to iterate on a prompt before building it into an application.

The Playground also lets you compare responses across models: try the same system prompt with Claude, Llama, and Titan to see how each interprets and applies it. This is useful when deciding which model to use for a particular task.

Prompt Management in Bedrock

Bedrock Prompt Management lets you store named prompts with full version history in the AWS console. You can create a prompt, run evaluations, save a version, and use the prompt ARN in your application rather than hardcoding the prompt text. When the prompt changes, you update the version without redeploying code.

Versioning matters when a prompt update changes the behavior of a deployed application. Keeping a record of which version was in production at a given time, and what changed between versions, makes it easier to investigate unexpected output. Note the version ARN and the date of each change alongside the reason for it.

Saving evaluation lessons

Model evaluations in Bedrock, whether through the Model Evaluation feature or manual testing in the Playground, teach you things about how each model handles your instructions. A lesson worth saving: "Llama 3 in Bedrock needs explicit step-by-step instructions to produce numbered lists; it ignores format hints." That kind of finding is easy to forget and expensive to rediscover.

How fenbs helps

Record evaluation findings for the next session

fenbs keeps Lessons learned alongside your project tasks and prompts. Record what each Bedrock model did with your system prompt, what worked, what failed, and what you changed. Save the approved prompt version as a Skill. The next developer working with Bedrock can read those lessons before starting, instead of running the same tests from scratch.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

Common issues

  • Wrong API for the model: using InvokeModel with a format designed for the Converse API, or vice versa.
  • Model-specific parameter gaps: some models in Bedrock do not support all parameters (like max_tokens) the same way. Check the model's documentation.
  • Region availability: not all models are available in all AWS regions. Check the Bedrock console for the current list in your region.
  • Stale prompt versions: a Prompt Management version that worked six months ago may produce different results after a model update. Re-evaluate after model updates.

How to do this with fenbs

  1. Create a free account. Start a personal kanban board for your Bedrock prompt work.
  2. Add a task for each system prompt you are developing. In the plan, note the model family, the Converse or InvokeModel API path, and the intended behavior.
  3. After testing in the Playground, record the evaluation results in the task. Note which model version, what the prompt achieved, and what edge cases you found.
  4. Save approved prompt versions as Skills in fenbs. Link to the Bedrock Prompt Management ARN if you have one, and note the date tested.
  5. When you learn something that should change how you approach Bedrock prompts, add a Lesson in fenbs. Check existing Lessons before starting new Bedrock work.

Related: prompt engineering covers the general principles that apply across all models. System prompt examples has patterns worth adapting for Bedrock work.

Questions people ask.

How do I set a system prompt in the Bedrock Converse API?

Pass a system parameter as a list of content blocks in your converse() call. The Converse API translates this into the format each model expects, so you do not need to handle model-specific formatting manually.

Do all Bedrock models support system prompts?

Most do, but each model has its own format and capabilities. Check the model's documentation in the Bedrock console or the AWS documentation for the supported parameters and instruction formats for the specific model you are using.

What is Bedrock Prompt Management?

Prompt Management is an AWS feature that lets you store named prompts with version history and evaluations. You reference a prompt by its ARN in your application and update the version without changing code. Check the current AWS documentation for availability and pricing.

Can I test system prompts without writing code?

Yes. The Bedrock console includes a Playground where you can set a system prompt, choose a model, and send messages interactively. This is the fastest way to test before building a prompt into an application.

Does the Converse API work the same for Claude and Llama models?

The API call structure is the same. The model behavior and instruction interpretation differ. A system prompt that works well with Claude may need adjustments for Llama. Test each model family separately.

More in Prompts and skills for AI work

All Prompts and skills for AI work articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.