Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Cross-invocation code-execution capability bleed via shared LlmAgent mutation

オープン
#7,224 コメント 10 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@surajksharma07 がすでに取り組んでいます。

2026年9月21日 から。

評価

この issue はまだ評価されていません。

説明

agent engine request clarification

Summary

Before commit f8282dafd3bc63476b76af31d1df3abdad6370fa, an invocation-scoped CFC setting could permanently mutate a shared LlmAgent instance.

When one invocation used RunConfig(support_cfc=True), Runner._new_invocation_context() assigned:

cfc_agent.code_executor = BuiltInCodeExecutor()

If the same long-lived Runner / Agent instance was then reused for another session or request with support_cfc=False, the later invocation could still receive the built-in code_execution capability.

This is a cross-invocation capability/policy bleed: a capability enabled for one invocation persisted into a different invocation that explicitly did not request it.

Affected version

Minimal reproduction

The reproduction only needs local ADK objects; no Gemini call, Google API, or external service is required.

  1. Create one Agent with code_executor=None.
  2. Create one InMemoryRunner using that Agent.
  3. Create independent session A and session B.
  4. Build invocation A with RunConfig(support_cfc=True).
  5. Run the code-execution request processor for A.
  6. Build invocation B with RunConfig(support_cfc=False) using the same Agent.
  7. Run the same request processor for B.
Expected

Invocation B should not receive BuiltInCodeExecutor, because CFC is disabled for B.

Pre-fix behavior

Invocation B still sees the built-in code-execution capability because invocation A mutated persistent shared Agent state.

Root cause

RunConfig.support_cfc is invocation-scoped, while LlmAgent.code_executor is persistent shared object state.

The pre-fix Runner converted an invocation-scoped decision into a permanent mutation of the shared Agent. Later invocations therefore observed a capability they did not request.

Security / isolation impact

This is a capability-isolation failure, not a claim of code execution on the ADK host itself.

The issue is that a request/session configured without the CFC / built-in code-execution capability can receive that capability because a previous invocation using the same shared Agent enabled it.

This matters for long-lived shared Runner/Agent instances, especially where different sessions, users, or policy contexts use different per-invocation capabilities.

Fixed behavior

Commit f8282dafd3bc63476b76af31d1df3abdad6370fa removes the in-place mutation of Runner.agent and resolves BuiltInCodeExecutor dynamically per invocation in _code_execution.py.

Opening this issue for public tracking/documentation of the affected released behavior and the fix.

主要言語
Python
スター
21.6k
フォーク
4k
平均マージ
6時間 56分
マージ済み PR(30日)
7

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

google/adk-python のほかの issue

google/adk-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。