Skip to content

fix: treat forwarded OAuth access tokens as ephemeral session state - #7096

Open
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_970111577
Open

fix: treat forwarded OAuth access tokens as ephemeral session state#7096
copybara-service[bot] wants to merge 1 commit into
mainfrom
copybara_970111577

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

fix: treat forwarded OAuth access tokens as ephemeral session state

Access tokens supplied in request.authorizations are now handed to the agent
as a temp:-prefixed state_delta for the duration of the turn, rather than
written into the session's initial state. ADK trims temp: keys before a
session is persisted, so the tokens stay out of durable session storage while
remaining readable through tool_context.state["temp:<auth_id>"] for the whole
invocation, sub-agents included.

Agents reading the bare tool_context.state["<auth_id>"] key must switch to
temp:<auth_id>.

Requires google-adk >= 1.27.0, the release in which temp: state deltas began
being applied to the in-memory session before being trimmed.

Access tokens supplied in `request.authorizations` are now handed to the agent
as a `temp:`-prefixed `state_delta` for the duration of the turn, rather than
written into the session's initial state. ADK trims `temp:` keys before a
session is persisted, so the tokens stay out of durable session storage while
remaining readable through `tool_context.state["temp:<auth_id>"]` for the whole
invocation, sub-agents included.

Agents reading the bare `tool_context.state["<auth_id>"]` key must switch to
`temp:<auth_id>`.

Requires google-adk >= 1.27.0, the release in which `temp:` state deltas began
being applied to the in-memory session before being trimmed.

PiperOrigin-RevId: 970111577
@copybara-service
copybara-service Bot requested a review from a team as a code owner August 24, 2026 22:55
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. google-contributor size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant