feat(go/plugins/checks): add Google Check (AI Safety) plugin#5450
feat(go/plugins/checks): add Google Check (AI Safety) plugin#5450adesinah wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the Google Checks AI Safety plugin for Genkit in Go, providing a batch evaluator, a synchronous guardrails client, and a guardrail middleware to block violative content. The review feedback highlights several key improvement opportunities: deferring credential resolution in Init when no metrics are configured to prevent unnecessary startup panics, replacing time.After with time.NewTimer in the retry loop to avoid memory leaks, using io.LimitReader on HTTP responses to mitigate potential denial-of-service risks, and classifying text concurrently in the middleware using errgroup to significantly reduce latency.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
f77931a to
b242da3
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a Go plugin for Google Checks AI Safety, integrating it with Genkit to provide a batch evaluator and synchronous guardrail middleware. The review feedback highlights several key areas for robustness improvements: avoiding application panics at startup by storing and gracefully returning initialization errors during evaluator execution, capping retry delays to prevent excessive blocking, safely defaulting the API endpoint for zero-initialized clients, and returning early in the middleware when no policies are configured to conserve API quota.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
6157ea6 to
9d2ce38
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the Google Checks AI Safety plugin for Genkit in Go, providing a batch evaluator, a synchronous Guardrails client, and middleware to block violative model inputs and outputs. Feedback on the implementation suggests replacing time.After with time.NewTimer in the retry loop of ClassifyContent to prevent potential memory leaks of timer resources when a context is cancelled.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
9d2ce38 to
5e74cae
Compare
fix(go/plugins/checks): address review feedback
5e74cae to
fbdd924
Compare
Add Google Checks AI-safety plugin (Go)
Port of the JS @genkit-ai/checks plugin to Go. Integrates Google Checks AI Safety (https://checks.google.com/ai-safety) for classifying content against safety policies, built directly on net/http + Application Default Credentials against the Checks v1alpha aisafety:classifyContent API (there is no first-party Go SDK).
Testing
mapping, evaluator fan-out, middleware blocking, optional-score handling, 429 retry, and project-ID precedence.
Pass under -race.
loop (against a real 429), and error propagation all confirmed working.
Checklist (if applicable):