INNER CODE UNIT · Python
_emit_startup_warnings
ohdearquant/lionagi · lionagi/studio/app.py:67
def _emit_startup_warnings() -> None:
"""Emit security warnings once at startup — no-op if conditions are safe."""
token = os.getenv("LIONAGI_STUDIO_AUTH_TOKEN")
if not token:
bind_host = os.getenv("LIONAGI_STUDIO_HOST", HOST)
if bind_host == "0.0.0.0": # noqa: S104
_log.warning(
"Studio running WITHOUT authentication on host 0.0.0.0 — "
"ALL API requests are accepted from any network interface. "
"This is unsafe in containers or cloud deployments. "
"Set LIONAGI_STUDIO_AUTH_TOKEN to require a bearer token."
)
else:
_log.warning(
"Studio running WITHOUT authentication — all API requests are "
"accepted. Set LIONAGI_STUDIO_AUTH_TOKEN to require a bearer token."
)