Skip to content

feat(agent): expose system_prompt_content as public property#2015

Open
dosvk wants to merge 1 commit intostrands-agents:mainfrom
dosvk:feat/expose-system-prompt-content
Open

feat(agent): expose system_prompt_content as public property#2015
dosvk wants to merge 1 commit intostrands-agents:mainfrom
dosvk:feat/expose-system-prompt-content

Conversation

@dosvk
Copy link
Copy Markdown

@dosvk dosvk commented Mar 31, 2026

Description

Add a read-only system_prompt_content property to Agent, exposing the
content block representation of the system prompt as part of the public API.

The private _system_prompt_content attribute is already accessed from
event_loop.py, multiple test files, and proposed telemetry changes. This
makes it an official public property and updates all internal consumers to
use it.

Related Issues

Closes #1996

Type of Change

New feature

Testing

  • All existing system prompt tests updated to use the public property
  • 2473 tests passing, 0 failures
  • 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
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Add read-only system_prompt_content property to Agent, making the
content block representation of the system prompt part of the public
API. Update internal consumers in event_loop.py and tests to use the
public property instead of the private _system_prompt_content attribute.

Closes strands-agents#1996
@dosvk dosvk requested a deployment to manual-approval March 31, 2026 16:45 — with GitHub Actions Waiting
@dosvk dosvk requested a deployment to manual-approval March 31, 2026 16:45 — with GitHub Actions Waiting
@lizradway lizradway self-requested a review March 31, 2026 16:49
@lizradway
Copy link
Copy Markdown
Member

lizradway commented Mar 31, 2026

Hi @dosvk! Thanks for your contribution! Since this changes our public API surface, will need to discuss this with the team.

@dosvk
Copy link
Copy Markdown
Author

dosvk commented Mar 31, 2026

Hi @dosvk! Thanks for your contribution! Since this changes our public API surface, will need to discuss this with the team.

@lizradway
Thanks for the quick look! Happy to adjust if the team has any feedback on the approach.

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.

[FEATURE] Expose system_prompt_content as a public property on Agent

2 participants