Skip to content

fix: confine config-driven dynamic class loading to intended types#1356

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_948846834
Jul 16, 2026
Merged

fix: confine config-driven dynamic class loading to intended types#1356
copybara-service[bot] merged 1 commit into
mainfrom
test_948846834

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jul 16, 2026

Copy link
Copy Markdown

fix: confine config-driven dynamic class loading to intended types

Config-driven loaders confine every reflectively loaded class to the intended
type (BaseTool, BaseToolset, BaseExampleProvider, or the caller's expectedType)
before constructing it or reading a static field, so a non-intended type is never
instantiated nor its static initializer run (type-confinement, not a sandbox).

CompiledAgentLoader also gains source-dir confinement
(adk.agents.confine-to-source-dir), keeping compiled agents within source-dir.
Type confinement is on by default; source-dir confinement is off by default (with
a warning) to avoid breaking existing setups, and will default on in a future
release.

@copybara-service copybara-service Bot force-pushed the test_948846834 branch 2 times, most recently from 477e997 to 05a5e26 Compare July 16, 2026 12:58
@copybara-service copybara-service Bot changed the title fix: confine config-driven dynamic class loading to the intended type fix: confine config-driven dynamic class loading to intended types Jul 16, 2026
@copybara-service copybara-service Bot force-pushed the test_948846834 branch 2 times, most recently from 825813d to ddeb907 Compare July 16, 2026 13:35
Config-driven loaders confine every reflectively loaded class to the intended
type (BaseTool, BaseToolset, BaseExampleProvider, or the caller's expectedType)
before constructing it or reading a static field, so a non-intended type is never
instantiated nor its static initializer run (type-confinement, not a sandbox).

CompiledAgentLoader also gains source-dir confinement
(adk.agents.confine-to-source-dir), keeping compiled agents within source-dir.
Type confinement is on by default; source-dir confinement is off by default (with
a warning) to avoid breaking existing setups, and will default on in a future
release.

PiperOrigin-RevId: 948941874
@copybara-service copybara-service Bot merged commit 3967cfa into main Jul 16, 2026
@copybara-service copybara-service Bot deleted the test_948846834 branch July 16, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant