Skip to content

Conversation

@dbschmigelski
Copy link
Member

Description

This PR introduces Strands Steering, an experimental feature that solves the prompt bloat problem in complex multi-step agent tasks through modular prompting with progressive disclosure.

Traditional agent prompting requires front-loading all instructions into monolithic prompts. For complex workflows with 30+ steps, this leads to prompt bloat where agents ignore instructions, hallucinated behaviors, failed adherence to intended procedures.

Existing solutions like workflow frameworks improve predictability but sacrifice the adaptive reasoning that makes AI valuable.

Solution

Steering provides context-aware guidance that appears when relevant, rather than upfront. Key components:

SteeringHandler Base Class: Abstract base for implementing custom steering logic with steer() method that returns SteeringActions

LLMSteeringHandler: Concrete implementation using natural language guidance via system prompts

Context Provider Architecture:

  • SteeringContextCallback protocol for event-specific context updates
  • SteeringContextProvider protocol for multi-event context management
  • Built-in LedgerProvider tracks comprehensive tool call history and timing

SteeringActions: Proceed, Guide (cancel + feedback), or Interrupt (human input)

Decision

We are leveraging Hooks as the extension mechanism for this feature. This architectural choice allows Steering to integrate seamlessly with the existing agent lifecycle by intercepting tool calls through the BeforeToolCallEvent, enabling context-aware guidance without modifying core agent behavior.

We focus on tool calls because they represent the only decision points where we can intervene and continue the agent loop - the agent loop is tool-focused, and when the LLM returns anything other than a tool call request, it becomes terminal.

Usage

from strands.experimental.steering import LLMSteeringHandler

handler = LLMSteeringHandler(
    system_prompt="Ensure emails maintain cheerful tone..."
)

agent = Agent(tools=[send_email], hooks=[handler])

Documentation PR

TODO

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@dbschmigelski dbschmigelski marked this pull request as ready for review December 3, 2025 16:12
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 96.74419% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/strands/experimental/steering/core/context.py 86.95% 1 Missing and 2 partials ⚠️
src/strands/experimental/steering/core/handler.py 93.61% 3 Missing ⚠️
src/strands/types/_events.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions github-actions bot added size/xl and removed size/xl labels Dec 3, 2025
zastrowm added a commit to zastrowm/docs that referenced this pull request Dec 3, 2025
Includes documentation for:

 - The TypeScript SDK (https://github.com/strands-agents/sdk-typescript)
 - Bidirectional Streaming Agent (strands-agents/sdk-python#1276)
 - Evaluations (https://github.com/strands-agents/evals)
 - Steering (strands-agents/sdk-python#1280)

----

Co-authored-by: Aaron Farntrog <afarn@amazon.com>
Co-authored-by: afarntrog <47332252+afarntrog@users.noreply.github.com>
Co-authored-by: Arron Bailiss <arron@amazon.com>
Co-authored-by: Chay Nabors <github@chaynabors.com>
Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
Co-authored-by: Jack Yuan <94985218+JackYPCOnline@users.noreply.github.com>
Co-authored-by: Jack Yuan <jackypc@amazon.com>
Co-authored-by: Jonathan Buck <jonabuck@amazon.com>
Co-authored-by: Jonathan Segev <jsegev01@gmail.com>
Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
Co-authored-by: mehtarac <mehtarac@amazon.com>
Co-authored-by: Murat Kaan Meral <muratkaanmeral@gmail.com>
Co-authored-by: Murat Kaan Meral <murmeral@amazon.nl>
Co-authored-by: Nicholas Clegg <ncclegg@amazon.com>
Co-authored-by: Nick Clegg <nac542@gmail.com>
Co-authored-by: Patrick Gray <pgrayy@amazon.com>
Co-authored-by: poshinchen <pschen@amazon.com>
Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
@dbschmigelski dbschmigelski merged commit 50969a4 into strands-agents:main Dec 3, 2025
12 of 14 checks passed
zastrowm added a commit to strands-agents/docs that referenced this pull request Dec 3, 2025
…eering (#355)

Includes documentation for:

 - The TypeScript SDK (https://github.com/strands-agents/sdk-typescript)
 - Bidirectional Streaming Agent (strands-agents/sdk-python#1276)
 - Evaluations (https://github.com/strands-agents/evals)
 - Steering (strands-agents/sdk-python#1280)

----

Co-authored-by: Aaron Farntrog <afarn@amazon.com>
Co-authored-by: afarntrog <47332252+afarntrog@users.noreply.github.com>
Co-authored-by: Arron Bailiss <arron@amazon.com>
Co-authored-by: Chay Nabors <github@chaynabors.com>
Co-authored-by: Dean Schmigelski <dbschmigelski+github@gmail.com>
Co-authored-by: Jack Yuan <94985218+JackYPCOnline@users.noreply.github.com>
Co-authored-by: Jack Yuan <jackypc@amazon.com>
Co-authored-by: Jonathan Buck <jonabuck@amazon.com>
Co-authored-by: Jonathan Segev <jsegev01@gmail.com>
Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
Co-authored-by: mehtarac <mehtarac@amazon.com>
Co-authored-by: Murat Kaan Meral <muratkaanmeral@gmail.com>
Co-authored-by: Murat Kaan Meral <murmeral@amazon.nl>
Co-authored-by: Nicholas Clegg <ncclegg@amazon.com>
Co-authored-by: Nick Clegg <nac542@gmail.com>
Co-authored-by: Patrick Gray <pgrayy@amazon.com>
Co-authored-by: poshinchen <pschen@amazon.com>
Co-authored-by: Strands Agent <217235299+strands-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants