Skip to content

[BUG] Loss of Temporary System Prompt Override Functionality #344

@cagataycali

Description

@cagataycali

Checks

  • I have updated to the lastest minor and patch version of Strands
  • I have checked the documentation and this is not expected behavior
  • I have searched ./issues and there are no duplicates of my issue

Strands Version

source

Python Version

source

Operating System

macOS

Installation Method

git clone

Steps to Reproduce

Problem Description

Refactor #289 ("remove kwargs spread after agent call") has introduced a breaking change that removes the ability to temporarily override system prompts for single agent invocations. This change is causing significant issues in downstream projects.

What Changed

Before (Working)

# Temporary override for single invocation - original system prompt preserved
agent("Hello!", system_prompt="Some New Prompt")

After (Broken)

# Permanent replacement - original system prompt is lost
agent.system_prompt = "Some New Prompt"

The Core Issue

The refactor fundamentally changed the behavior from:

  • Temporary override: System prompt changed for one turn only
  • Permanent replacement: Original system prompt is completely lost

Breaking Change Impact

This change is actively breaking production code in the agent-builder repository:

Why This Matters

  1. Use Case Loss: Many applications need to temporarily adjust agent behavior without permanently modifying the agent's core instructions
  2. Backward Compatibility: Existing code that relied on this pattern is now broken
  3. Developer Experience: The new approach is more cumbersome and destructive

Requested Solution

We need both capabilities available:

Restore Original Behavior

# Temporary override (per-invocation)
agent("Hello!", system_prompt="Temporary instruction")

# Permanent change (persistent)
agent.system_prompt = "New permanent instruction"

Expected Behavior

Expected Behavior

  • Temporary overrides should not modify the agent's base system prompt
  • Permanent changes should continue to work via attribute assignment
  • Backward compatibility should be maintained for existing code

Actual Behavior

N/A

Additional Context

Additional Context

The removal of this functionality appears to have been done without consideration for existing use cases. The change description mentions "you can alter the agent's system prompt by overriding the agents system_prompt attribute" but this misses the point - we need temporary overrides, not permanent replacements.

Priority

Critical - This is blocking upgrades and breaking existing functionality in production codebases.

Possible Solution

No response

Related Issues

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions