"""Authentication headers for LangGraph-to-Gateway internal calls.""" from __future__ import annotations import os def internal_service_token() -> str: return ( os.environ.get("EVOSCIENTIST_BACKEND_SERVICE_TOKEN", "").strip() or os.environ.get("AI4SCI_EVO_RUNTIME_GRANT_SECRET", "").strip() ) def internal_service_headers() -> dict[str, str]: token = internal_service_token() return {"X-Ai4Sci-Service-Token": token} if token else {}