Skip to content

Commit e02b9fb

Browse files
GWealecopybara-github
authored andcommitted
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 <gweale@google.com> PiperOrigin-RevId: 839795361
1 parent 76dc169 commit e02b9fb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/google/adk/cli/cli_tools_click.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ def parse_args(self, ctx, args):
110110
logger = logging.getLogger("google_adk." + __name__)
111111

112112

113+
_ADK_WEB_WARNING = (
114+
"ADK Web is for development purposes. It has access to all data and"
115+
" should not be used in production."
116+
)
117+
118+
119+
def _warn_if_with_ui(with_ui: bool) -> None:
120+
"""Warn when deploying with the developer UI enabled."""
121+
if with_ui:
122+
click.secho(f"WARNING: {_ADK_WEB_WARNING}", fg="yellow", err=True)
123+
124+
113125
@click.group(context_settings={"max_content_width": 240})
114126
@click.version_option(version.__version__)
115127
def main():
@@ -1429,6 +1441,8 @@ def cli_deploy_cloud_run(
14291441
err=True,
14301442
)
14311443

1444+
_warn_if_with_ui(with_ui)
1445+
14321446
session_service_uri = session_service_uri or session_db_url
14331447
artifact_service_uri = artifact_service_uri or artifact_storage_uri
14341448

@@ -1848,6 +1862,7 @@ def cli_deploy_gke(
18481862
--cluster_name=[cluster_name] path/to/my_agent
18491863
"""
18501864
try:
1865+
_warn_if_with_ui(with_ui)
18511866
cli_deploy.to_gke(
18521867
agent_folder=agent,
18531868
project=project,

0 commit comments

Comments
 (0)