AgentSession.StateBag Property

Definition

Gets any arbitrary state associated with this session.

[System.Text.Json.Serialization.JsonPropertyName("stateBag")]
public Microsoft.Agents.AI.AgentSessionStateBag StateBag { get; protected set; }
[<System.Text.Json.Serialization.JsonPropertyName("stateBag")>]
member this.StateBag : Microsoft.Agents.AI.AgentSessionStateBag with get, set
Public Property StateBag As AgentSessionStateBag

Property Value

Attributes

Remarks

Data stored in the StateBag will be included when the session is serialized. Avoid storing secrets, credentials, or highly sensitive data in the state bag without appropriate encryption, as this data may be persisted to external storage.

Applies to