feat(a2a): add value-resolver for auth credential resolution#18653
feat(a2a): add value-resolver for auth credential resolution#18653adamfweidman merged 1 commit intomainfrom
Conversation
Summary of ChangesHello @adamfweidman, 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 significantly enhances the authentication capabilities for remote agents by introducing a flexible mechanism to resolve credentials from external sources like environment variables or shell commands. It integrates this new resolution logic into the agent loading process, allowing remote agents to define their authentication requirements directly within their markdown frontmatter. This change improves security by enabling dynamic credential management and secure logging, while also providing comprehensive validation for auth configurations. Highlights
Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
|
Size Change: +2.81 kB (+0.01%) Total Size: 23.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature for resolving authentication credentials from environment variables or shell commands. However, the implementation of arbitrary shell command execution via the ! prefix introduces a high-severity security risk, potentially leading to Remote Code Execution (RCE) if a user is induced to use a malicious agent definition file. It is recommended to disable this feature or implement strict security controls like an allowlist or user confirmation. Additionally, a high-severity suggestion has been made to improve the type safety and robustness of authentication configuration handling in agentLoader.ts to prevent potential runtime errors and enhance maintainability.
18d802c to
c8e4e70
Compare
|
Size Change: +3.41 kB (+0.01%) Total Size: 23.9 MB
ℹ️ View Unchanged
|
c8e4e70 to
a406ccf
Compare
| * @returns The resolved value | ||
| * @throws Error if environment variable is not set or command fails | ||
| */ | ||
| export async function resolveAuthValue(value: string): Promise<string> { |
There was a problem hiding this comment.
We should probably update documentation to clearly states that agent files are trusted code and that the !command syntax executes with the user's shell privileges
There was a problem hiding this comment.
Because this is just the setup and not actually implemented I was going to wait to add to the docs until the next PR. wdyt
a406ccf to
b498955
Compare
b498955 to
99b504f
Compare
…ini/gemini-cli (#37) * fix(cli): resolve double rendering in shpool and address vscode lint warnings (google-gemini#18704) * feat(plan): document and validate Plan Mode policy overrides (google-gemini#18825) * Fix pressing any key to exit select mode. (google-gemini#18421) * fix(cli): update F12 behavior to only open drawer if browser fails (google-gemini#18829) * feat(plan): allow skills to be enabled in plan mode (google-gemini#18817) Co-authored-by: Jerop Kipruto <jerop@google.com> * docs(plan): add documentation for plan mode tools (google-gemini#18827) * Remove experimental note in extension settings docs (google-gemini#18822) * Update prompt and grep tool definition to limit context size (google-gemini#18780) * docs(plan): add `ask_user` tool documentation (google-gemini#18830) * Revert unintended credentials exposure (google-gemini#18840) * feat(core): update internal utility models to Gemini 3 (google-gemini#18773) * feat(a2a): add value-resolver for auth credential resolution (google-gemini#18653) * Removed getPlainTextLength (google-gemini#18848) * More grep prompt tweaks (google-gemini#18846) * refactor(cli): Reactive useSettingsStore hook (google-gemini#14915) * fix(mcp): Ensure that stdio MCP server execution has the `GEMINI_CLI=1` env variable populated. (google-gemini#18832) * fix(core): improve headless mode detection for flags and query args (google-gemini#18855) * refactor(cli): simplify UI and remove legacy inline tool confirmation logic (google-gemini#18566) * feat(cli): deprecate --allowed-tools and excludeTools in favor of policy engine (google-gemini#18508) * fix(workflows): improve maintainer detection for automated PR actions (google-gemini#18869) * refactor(cli): consolidate useToolScheduler and delete legacy implementation (google-gemini#18567) * Update changelog for v0.28.0 and v0.29.0-preview0 (google-gemini#18819) * fix(core): ensure sub-agents are registered regardless of tools.allowed (google-gemini#18870) --------- Co-authored-by: Brad Dux <959674+braddux@users.noreply.github.com> Co-authored-by: Jerop Kipruto <jerop@google.com> Co-authored-by: Jacob Richman <jacob314@gmail.com> Co-authored-by: Sandy Tao <sandytao520@icloud.com> Co-authored-by: Adib234 <30782825+Adib234@users.noreply.github.com> Co-authored-by: christine betts <chrstn@uw.edu> Co-authored-by: Christian Gunderman <gundermanc@gmail.com> Co-authored-by: Adam Weidman <65992621+adamfweidman@users.noreply.github.com> Co-authored-by: Dev Randalpura <devrandalpura@google.com> Co-authored-by: Pyush Sinha <pyushsinha20@gmail.com> Co-authored-by: Richie Foreman <richie.foreman@gmail.com> Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com> Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com> Co-authored-by: Abhijit Balaji <abhijitbalaji@google.com> Co-authored-by: Bryan Morgan <bryanmorgan@google.com> Co-authored-by: g-samroberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: matt korwel <matt.korwel@gmail.com>
Summary
This PR adds a value-resolver for authentication credentials in remote agents, allowing secrets to be resolved from environment variables or shell commands.
Details
resolveAuthValueto support$ENV_VARand!commandsyntax.maskSensitiveValuefor secure logging of credentials.AgentLoaderto parseauthconfiguration from agent markdown frontmatter.Related Issues
Fixes #18637
How to Validate
Run unit tests for the core package:
npm run test -w @google/gemini-cli-core -- src/agents/auth-provider/value-resolver.test.ts src/agents/agentLoader.test.tsPre-Merge Checklist