From e02b9fb608f645cdcf8300ffe4e64627df10ba28 Mon Sep 17 00:00:00 2001 From: George Weale Date: Wed, 3 Dec 2025 09:46:42 -0800 Subject: [PATCH] fix: Add a warning when deploying with the ADK Web UI enabled The warning message shows that ADK Web is for development purposes only and should not be used in production, as it has access to all data. This warning is displayed when the `--with-ui` flag is used with `adk deploy` and `adk deploy to-gke` Co-authored-by: George Weale PiperOrigin-RevId: 839795361 --- src/google/adk/cli/cli_tools_click.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/google/adk/cli/cli_tools_click.py b/src/google/adk/cli/cli_tools_click.py index 6c3e7b98..c4446278 100644 --- a/src/google/adk/cli/cli_tools_click.py +++ b/src/google/adk/cli/cli_tools_click.py @@ -110,6 +110,18 @@ class HelpfulCommand(click.Command): logger = logging.getLogger("google_adk." + __name__) +_ADK_WEB_WARNING = ( + "ADK Web is for development purposes. It has access to all data and" + " should not be used in production." +) + + +def _warn_if_with_ui(with_ui: bool) -> None: + """Warn when deploying with the developer UI enabled.""" + if with_ui: + click.secho(f"WARNING: {_ADK_WEB_WARNING}", fg="yellow", err=True) + + @click.group(context_settings={"max_content_width": 240}) @click.version_option(version.__version__) def main(): @@ -1429,6 +1441,8 @@ def cli_deploy_cloud_run( err=True, ) + _warn_if_with_ui(with_ui) + session_service_uri = session_service_uri or session_db_url artifact_service_uri = artifact_service_uri or artifact_storage_uri @@ -1848,6 +1862,7 @@ def cli_deploy_gke( --cluster_name=[cluster_name] path/to/my_agent """ try: + _warn_if_with_ui(with_ui) cli_deploy.to_gke( agent_folder=agent, project=project,