Skip to content

fix(a2a-server): Implement default policy loading for parity with CLI#27073

Merged
kschaab merged 9 commits into
mainfrom
keithsc/fix/a2a-readonly-policies
May 19, 2026
Merged

fix(a2a-server): Implement default policy loading for parity with CLI#27073
kschaab merged 9 commits into
mainfrom
keithsc/fix/a2a-readonly-policies

Conversation

@kschaab

@kschaab kschaab commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the A2A server to automatically load the same default policies (including read-only policies) as the CLI. This ensures that the A2A server inherits standard security safeguards and remains synchronized as the core default policies evolve.

Details

  • Integrated @google/gemini-cli-core's createPolicyEngineConfig into the A2A server configuration flow.
  • Mapped A2A-specific tool settings (core, exclude, allowed) to the PolicySettings structure expected by the core engine.
  • Exposed policyPaths and adminPolicyPaths in the A2A server's Settings interface for parity with CLI configuration.
  • Updated A2A server tests to mock the new policy engine configuration dependency while preserving existing YOLO mode verification.

Related Issues

Fixes #25182

How to Validate

  1. Run unit tests for the A2A server:
    npm test -w @google/gemini-cli-a2a-server
  2. Verify that all 130 tests pass, confirming that both default policy loading and YOLO mode overrides are correctly handled.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@gemini-cli gemini-cli Bot added the priority/p1 Important and should be addressed in the near term. label May 14, 2026
@github-actions

github-actions Bot commented May 14, 2026

Copy link
Copy Markdown

Size Change: -4 B (0%)

Total Size: 33.8 MB

Filename Size Change
./bundle/chunk-5X54PR37.js 0 B -2.78 MB (removed) 🏆
./bundle/chunk-75IXRPFL.js 0 B -16.5 MB (removed) 🏆
./bundle/chunk-AYT2RPJX.js 0 B -659 kB (removed) 🏆
./bundle/chunk-ELFXU7GT.js 0 B -3.43 kB (removed) 🏆
./bundle/chunk-N3P3DBLX.js 0 B -3.77 kB (removed) 🏆
./bundle/chunk-T23BP7OH.js 0 B -12.5 kB (removed) 🏆
./bundle/chunk-VMBVGMS3.js 0 B -19.5 kB (removed) 🏆
./bundle/chunk-ZO2FYLZU.js 0 B -49.2 kB (removed) 🏆
./bundle/core-QXUJWTI3.js 0 B -49.1 kB (removed) 🏆
./bundle/devtoolsService-CEAIX37I.js 0 B -28 kB (removed) 🏆
./bundle/gemini-E6T3A4KO.js 0 B -585 kB (removed) 🏆
./bundle/interactiveCli-GORC5YSN.js 0 B -1.3 MB (removed) 🏆
./bundle/liteRtServerManager-6QUMNSVH.js 0 B -2.08 kB (removed) 🏆
./bundle/oauth2-provider-A2LHVBAM.js 0 B -9.12 kB (removed) 🏆
./bundle/chunk-A5NUWFLS.js 19.5 kB +19.5 kB (new file) 🆕
./bundle/chunk-EBY4O4EJ.js 2.78 MB +2.78 MB (new file) 🆕
./bundle/chunk-HRYBL46A.js 659 kB +659 kB (new file) 🆕
./bundle/chunk-K22TDHUA.js 3.77 kB +3.77 kB (new file) 🆕
./bundle/chunk-NUBD4QP3.js 12.5 kB +12.5 kB (new file) 🆕
./bundle/chunk-O7LQTIBF.js 49.2 kB +49.2 kB (new file) 🆕
./bundle/chunk-VPTP7VDX.js 3.43 kB +3.43 kB (new file) 🆕
./bundle/chunk-ZE7FS5BD.js 16.5 MB +16.5 MB (new file) 🆕
./bundle/core-WTNIKHGY.js 49.1 kB +49.1 kB (new file) 🆕
./bundle/devtoolsService-NGVTNYAU.js 28 kB +28 kB (new file) 🆕
./bundle/gemini-7EGYCKK7.js 585 kB +585 kB (new file) 🆕
./bundle/interactiveCli-M7BU6YWS.js 1.3 MB +1.3 MB (new file) 🆕
./bundle/liteRtServerManager-VJITIGX6.js 2.08 kB +2.08 kB (new file) 🆕
./bundle/oauth2-provider-FE6ZC4WN.js 9.12 kB +9.12 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size Change
./bundle/bundled/third_party/index.js 8 MB 0 B
./bundle/chunk-34MYV7JD.js 2.45 kB 0 B
./bundle/chunk-5AUYMPVF.js 858 B 0 B
./bundle/chunk-5PS3AYFU.js 1.18 kB 0 B
./bundle/chunk-664ZODQF.js 124 kB 0 B
./bundle/chunk-CTHYVDCX.js 39.8 kB 0 B
./bundle/chunk-DAHVX5MI.js 206 kB 0 B
./bundle/chunk-IUUIT4SU.js 56.5 kB 0 B
./bundle/cleanup-Y5ZMHIGV.js 0 B -902 B (removed) 🏆
./bundle/devtools-36NN55EP.js 696 kB 0 B
./bundle/dist-JYLQM7LS.js 373 B 0 B
./bundle/events-XB7DADIJ.js 418 B 0 B
./bundle/examples/hooks/scripts/on-start.js 188 B 0 B
./bundle/examples/mcp-server/example.js 1.43 kB 0 B
./bundle/gemini.js 5.07 kB 0 B
./bundle/getMachineId-bsd-TXG52NKR.js 1.55 kB 0 B
./bundle/getMachineId-darwin-7OE4DDZ6.js 1.55 kB 0 B
./bundle/getMachineId-linux-SHIFKOOX.js 1.34 kB 0 B
./bundle/getMachineId-unsupported-5U5DOEYY.js 1.06 kB 0 B
./bundle/getMachineId-win-6KLLGOI4.js 1.72 kB 0 B
./bundle/multipart-parser-KPBZEGQU.js 11.7 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 222 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 229 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 13.4 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B
./bundle/src-QVCVGIUX.js 47 kB 0 B
./bundle/start-25V5LLP4.js 0 B -622 B (removed) 🏆
./bundle/tree-sitter-7U6MW5PS.js 274 kB 0 B
./bundle/tree-sitter-bash-34ZGLXVX.js 1.84 MB 0 B
./bundle/cleanup-U3SPUPZX.js 902 B +902 B (new file) 🆕
./bundle/start-U6W6KLYO.js 622 B +622 B (new file) 🆕

compressed-size-action

@kschaab kschaab marked this pull request as ready for review May 18, 2026 20:29
@kschaab kschaab requested a review from a team as a code owner May 18, 2026 20:29
@gemini-code-assist

Copy link
Copy Markdown
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 aligns the A2A server's security policy handling with the core CLI implementation. By adopting the shared policy engine configuration, the server now automatically enforces standard security safeguards, including read-only policies, while maintaining support for existing YOLO mode overrides. These changes ensure consistent behavior across the application ecosystem and simplify future policy maintenance.

Highlights

  • Policy Engine Integration: Integrated the createPolicyEngineConfig utility from @google/gemini-cli-core into the A2A server to standardize policy loading and ensure parity with the CLI.
  • Configuration Interface Updates: Updated the Settings interface to include policyPaths and adminPolicyPaths, allowing for consistent configuration management.
  • Build Process Enhancements: Modified the asset copying script to include policy files in the A2A server's distribution directory, ensuring availability during bundled execution.
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 the 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 counterproductive. 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.

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.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors a2a-server to use createPolicyEngineConfig for policy management, adds policy path settings, and updates the build script to copy policy assets. Reviewers identified a critical privilege escalation vulnerability where malicious workspace settings could override admin policies. Improvements to the test mocks were also suggested to ensure correct mapping of policy settings.

Comment thread packages/a2a-server/src/config/config.ts
Comment thread packages/a2a-server/src/config/config.test.ts Outdated
@kschaab kschaab added this pull request to the merge queue May 19, 2026
Merged via the queue into main with commit 85566a7 May 19, 2026
27 checks passed
@kschaab kschaab deleted the keithsc/fix/a2a-readonly-policies branch May 19, 2026 14:29
@kschaab

kschaab commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

/patch preview

@github-actions

Copy link
Copy Markdown

🚀 [Step 1/4] Patch workflow(s) waiting for approval!

📋 Details:

  • Channels: preview
  • Commit: 85566a73f60b28d0a9a3e74e76b26cd76317793b
  • Workflows Created: 1

⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs.

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 [Step 2/4] Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #27256
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

🚀 [Step 3/4] Patch Release Waiting for Approval!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.43.0-preview.0
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.43.0-preview.0-pr-27073

⏳ Status: The patch release has been triggered and is waiting for deployment approval. Please visit the specific workflow run link below and approve the deployment. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions

Copy link
Copy Markdown

[Step 4/4] Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

@sripasg sripasg added the size/l A large sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Issues related to security priority/p1 Important and should be addressed in the near term. size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Policy is bypassed if the file is opened in the IDE

3 participants