Skip to content

feat(sdk): make platform defaults the happy path in serve#2290

Open
jezekra1 wants to merge 1 commit intomainfrom
platform-defaults-happy-path
Open

feat(sdk): make platform defaults the happy path in serve#2290
jezekra1 wants to merge 1 commit intomainfrom
platform-defaults-happy-path

Conversation

@jezekra1
Copy link
Collaborator

@jezekra1 jezekra1 commented Mar 4, 2026

What

Changes defaults in Server.serve() to use platform-native implementations out of the box:

  • configure_telemetry=True (was False)
  • context_store defaults to PlatformContextStore() (was InMemoryContextStore())
  • auth_backend defaults to PlatformAuthBackend() (was None)

Why

This makes the happy path work without any configuration — agents connect to the platform context store, authenticate via the platform auth backend, and emit telemetry by default. Users can still override any of these by passing explicit values to serve().

  • No Docs Needed

…ackend, telemetry) in serve

Signed-off-by: Radek Ježek <radek.jezek@ibm.com>
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 4, 2026
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request streamlines the setup process for the SDK by configuring Server.serve() to use platform-native implementations for key functionalities by default. This change ensures that agents automatically connect to the platform context store, authenticate via the platform auth backend, and emit telemetry without requiring explicit configuration, thereby simplifying the initial user experience.

Highlights

  • Default Telemetry Configuration: The configure_telemetry parameter in Server.serve() now defaults to True, enabling telemetry by default.
  • Platform Context Store: The context_store parameter in Server.serve() now defaults to PlatformContextStore(), replacing InMemoryContextStore() as the default.
  • Platform Authentication Backend: The auth_backend parameter in Server.serve() now defaults to PlatformAuthBackend(), providing platform-native authentication out of the box.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • apps/agentstack-sdk-py/src/agentstack_sdk/server/server.py
    • Updated imports to include PlatformAuthBackend and PlatformContextStore, and removed InMemoryContextStore.
    • Modified the default value of the configure_telemetry parameter in the serve method to True.
    • Changed the default context_store to PlatformContextStore() and added auth_backend with a default of PlatformAuthBackend() in the serve method.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request updates the Server.serve() method to use platform-native implementations for telemetry, context storage, and authentication by default, aligning with the goal of simplifying initial configuration and providing a 'happy path' for new users. However, this change introduces a high-severity security vulnerability. The new default authentication backend, PlatformAuthBackend, is susceptible to Host Header Injection for audience validation when not explicitly configured with a public URL, potentially allowing cross-service token usage. It also lacks issuer validation and exhibits verbose error handling that could leak sensitive information. It is recommended to enforce the configuration of a trusted public URL or improve the default security of the PlatformAuthBackend before making it the default.


context_store = context_store or InMemoryContextStore()
context_store = context_store or PlatformContextStore()
auth_backend = auth_backend or PlatformAuthBackend()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The pull request changes the default auth_backend to PlatformAuthBackend(), which introduces a significant security risk. The PlatformAuthBackend implementation (in apps/agentstack-sdk-py/src/agentstack_sdk/server/middleware/platform_auth_backend.py) defaults to using the request's Host header for JWT audience validation when PLATFORM_AUTH__PUBLIC_URL is not configured (line 107). This makes the agent vulnerable to Host Header Injection, where an attacker can use a valid JWT issued for a different agent on the same platform to authenticate by manipulating the Host header. Additionally, the backend lacks issuer (iss) validation and leaks internal error details (such as platform URLs and discovery failures) in authentication responses. Making this the default 'happy path' without enforcing secure configuration significantly weakens the SDK's default security posture.

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

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant