Skip to content

Feature Request: Runtime Configurations with Env Vars #3854

Closed as not planned
Closed as not planned

Description

@ccfreeman

Problem

Developers configure applications at runtime in a variety of ways. Using command-line arguments is a common way; but in some contexts, altering command-line entrypoints to programs can be difficult or impossible. For such scenarios where we cannot alter a program entrypoint, we often use environmental variables to alter program behavior. Often in deployment environments, env-vars can be changed without releases. This flexibility in configuration allows developers to use frameworks in a wider array of contexts, and can generally ease their adoption into existing deployment systems.

ADK provides powerful configuration options through command-line arguments, but so far as I can tell is limited in which values can be set via environmental variables. I'm proposing the solution that modern server frameworks such as uvicorn provide, where configurations can be made both by command-line and by environmental variables. This will provide greater flexibility in runtime possibilities to users.

Solution

The solution should be relatively simple. For command-line arguments such as --session_service_uri or --artifact_service_uri, or other options, users should be able to set an environmental variable such as ADK_SESSION_SERVICE_URI or ADK_ARTIFACT_SERVICE_URI.

This solution should be relatively simple to implement in the ADK python library. Uvicorn implements this through a context_setting map variable in the command implementation:

@click.command(context_settings={"auto_envvar_prefix": "UVICORN"})

This allows users to set variables such as port or host by adding variables with the prefix "UVICORN" to their environment (UVICORN_PORT=...). ADK could take a similar strategy using the prefix "ADK".

@click.group(context_settings={"max_content_width": 240, "auto_envvar_prefix": "ADK"})
@click.version_option(version.__version__)
def main():
  """Agent Development Kit CLI tools."""
  pass

Additional context

  1. Solution Scope. This solution is relatively targeted toward configurations on the adk web and adk api_server entrypoints. The solution provided will not resolve other configuration issues, such as how the Uvicorn server picks up configurations. It would be good to extend the solution to cover these extended cases.

  2. Potential side-effects. In layered frameworks such as ADK, there can sometimes be conflicting variables that are taken in at different parts of the program. Thus targeting a change in configuration to one part of the app can have an unintended effect on another part of the application. This should not be an issue, as the prefix of the variables should not cause a collision with other frameworks the user may also have in play.

If this solution is good, I'm more than happy to implement a PR here and build some testing for it. Thanks!

Activity

  1. added
    core[Component] This issue is related to the core interface and implementation
    on Dec 7, 2025
  2. added theissue type on Dec 7, 2025
  3. changed the title [-]Runtime Configurations with Env Vars[/-] [+]Feature Request: Runtime Configurations with Env Vars[/+] on Dec 7, 2025
  4. adk-bot commented on Dec 18, 2025

    @adk-bot
    Collaborator

    Notification: The author has updated the issue description. Maintainers, please review.

  5. adk-bot commented on Dec 23, 2025

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  6. added
    stale[Status] Issues which have been marked inactive since there is no user response
    on Dec 23, 2025
  7. removed
    stale[Status] Issues which have been marked inactive since there is no user response
    on Dec 29, 2025
  8. klateefa commented on Feb 11, 2026

    @klateefa

    @ccfreeman Thank you for submitting this feature request. It’s currently under review by our product team, and I’ll keep you posted on any updates. We appreciate your input!
    Thanks.

  9. added
    needs review[Status] The PR/issue is awaiting review from the maintainer
    on Feb 11, 2026
  10. DeanChensj commented on Oct 14, 2026

    @DeanChensj
    Collaborator

    Thank you for the suggestion and for sharing your workflow!

    While ADK uses environment variables for global SDK credentials and feature/telemetry toggles, we intentionally avoid binding every runtime execution parameter on RunConfig to environment variables so that concurrent runs within the same process aren't affected by implicit global state.

    Since RunConfig is a standard Pydantic model, you can easily load environment variables in your application entrypoint using pydantic-settings (BaseSettings) and pass the constructed RunConfig into Runner.run_async().

    We're closing this issue for now, but if you run into any trouble with RunConfig serialization or configuration in your setup, please feel free to open a new issue anytime!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

core[Component] This issue is related to the core interface and implementationneeds review[Status] The PR/issue is awaiting review from the maintainer

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions