Skip to content
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
f7dea97
fix: enable YAML denylist by default in CLI mode
aimenhamzi01-dot May 13, 2026
525fd5d
Merge pull request #1 from aimenhamzi01-dot/aimenhamzi01-dot-patch-1
aimenhamzi01-dot May 13, 2026
174d7be
fix: block RCE via module denylist in resolve_code_reference
aimenhamzi01-dot May 13, 2026
77269cd
Merge branch 'main' into main
rohityan May 18, 2026
436205b
style: fix pyink formatting in config_agent_utils.py
aimenhamzi01-dot May 18, 2026
3392c08
Merge branch 'main' into main
aimenhamzi01-dot May 18, 2026
260c678
Merge branch 'main' into main
aimenhamzi01-dot May 19, 2026
29a3b50
Merge branch 'main' into main
aimenhamzi01-dot May 27, 2026
27e6479
Merge branch 'main' into main
aimenhamzi01-dot May 29, 2026
71c79cf
Merge branch 'main' into main
aimenhamzi01-dot May 29, 2026
c2e3779
fix: restore missing function definition after conflict resolution
aimenhamzi01-dot May 29, 2026
c324b7c
Merge branch 'main' into main
aimenhamzi01-dot Jun 22, 2026
ce2753a
Merge branch 'main' into main
aimenhamzi01-dot Jun 22, 2026
765ab15
Merge branch 'main' into main
aimenhamzi01-dot Jun 25, 2026
ff98f90
Merge branch 'main' into main
aimenhamzi01-dot Jun 25, 2026
76b2575
Merge branch 'main' into main
aimenhamzi01-dot Jun 25, 2026
0f15069
Merge branch 'main' into main
aimenhamzi01-dot Jun 27, 2026
09c3b67
Merge branch 'main' into main
aimenhamzi01-dot Jun 27, 2026
d0d430f
Merge branch 'main' into main
aimenhamzi01-dot Jun 29, 2026
869fc97
Merge branch 'main' into main
aimenhamzi01-dot Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/google/adk/agents/config_agent_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ def _resolve_agent_class(agent_class: str) -> type[BaseAgent]:
" BaseAgent."
)

_BLOCKED_MODULES = frozenset({
"os",
"sys",
"subprocess",
"builtins",
"importlib",
"shutil",
"socket",
"ctypes",
"pickle",
"marshal",
})
_BLOCKED_YAML_KEYS = frozenset({
"args",
"model_code",
"tools",
"callbacks",
"input_schema",
"output_schema",
})
_ENFORCE_DENYLIST = True

_BLOCKED_YAML_KEYS = frozenset({"args"})
_ENFORCE_YAML_KEY_DENYLIST = False
Expand Down Expand Up @@ -109,7 +130,6 @@ def _check_config_for_blocked_keys(node: Any, filename: str) -> None:

def _load_config_from_path(config_path: str) -> AgentConfig:
"""Load an agent's configuration from a YAML file.

Args:
config_path: Path to the YAML config file. Both relative and absolute paths
are accepted.
Expand Down Expand Up @@ -308,6 +328,9 @@ def resolve_code_reference(code_config: CodeConfig) -> Any:
"""
if not code_config or not code_config.name:
raise ValueError("Invalid CodeConfig.")
top_level = code_config.name.split(".")[0]
if top_level in _BLOCKED_MODULES:
raise ValueError(f"Module '{top_level}' is not allowed in code references.")

_validate_module_reference(code_config.name)
module_path, obj_name = code_config.name.rsplit(".", 1)
Expand Down