Skip to content

Prompts

System prompts and user messages are how you communicate with the model. This guide covers writing both, sending multi-modal input, calling tools directly, and structuring complex instructions as agent SOPs.

A system prompt gives the model high-level instructions about its role, capabilities, and constraints, setting how it behaves across the whole conversation. Set it when you construct the agent:

from strands import Agent
agent = Agent(
system_prompt=(
"You are a financial advisor specialized in retirement planning. "
"Use tools to gather information and provide personalized advice. "
"Always explain your reasoning and cite sources when possible."
)
)

Without a system prompt, the model behaves according to its default settings.

User messages are your queries and requests to the agent. You can send them several ways.

The simplest way to interact with an agent is through a text prompt:

response = agent("What is the time in Seattle")

Include images, documents, and other content types alongside text in a single message:

with open("path/to/image.png", "rb") as fp:
image_bytes = fp.read()
response = agent([
{"text": "What can you see in this image?"},
{
"image": {
"format": "png",
"source": {
"bytes": image_bytes,
},
},
},
])

For a complete list of supported content types, refer to the API Reference: Python | TypeScript.

Natural-language prompting is the usual way to invoke tools. When you need programmatic control instead, call a tool directly:

result = agent.tool.current_time(timezone="US/Pacific")

Direct tool calls bypass the natural-language interface and run the tool with the parameters you pass. Strands records them in the conversation history by default; opt out with record_direct_tool_call=FalserecordDirectToolCall: false.

Simple text instructions work for basic tasks. Getting complex, repeatable behavior out of an agent benefits from more structure.

Agent SOPs (Standard Operating Procedures) are a standardized markdown format for defining agent workflows in natural language. They hit a “determin-ish-tic” sweet spot between fully code-defined workflows and open-ended model-driven agents, providing structure for consistency while preserving the agent’s reasoning ability.

Here is a minimal example of an Agent SOP:

# Code Review SOP
## Parameters
- repo_path (REQUIRED): Path to the repository to review
## Steps
### Step 1: Understand the Changes
- MUST read the diff of all changed files
- SHOULD summarize what the changes are doing at a high level
### Step 2: Review for Issues
- MUST check for bugs, security vulnerabilities, and logic errors
- SHOULD flag any style or readability concerns
- MAY suggest alternative approaches where appropriate
### Step 3: Provide Feedback
- MUST output a structured review with file-level comments
- SHOULD categorize findings by severity (critical, warning, suggestion)

Writing to the Agent SOP format makes the agent’s behavior easier to understand, easier to debug when it strays from instructions, and steerable across different underlying models.

Debugging system prompts is hard and expensive, usually involving costly evaluations to confirm the agent still works as expected. Structuring the system prompt as an SOP turns that editing process into targeted, step-level changes.

For more on authoring and using Agent SOPs, including SOP chaining for multi-phase workflows, see the Agent SOPs GitHub repository.

For guidance on writing safe and responsible prompts, including defending against prompt injection and adversarial attacks, refer to our Safety & Security - Prompt Engineering documentation.