AST-163480: Add Gemini AI provider support for agent hook remediation - #1543
Open
cx-rahul-pidde wants to merge 10 commits into
Open
AST-163480: Add Gemini AI provider support for agent hook remediation#1543cx-rahul-pidde wants to merge 10 commits into
cx-rahul-pidde wants to merge 10 commits into
Conversation
cx-rahul-pidde
requested review from
cx-anjali-deore,
cx-anurag-dalke and
cx-umesh-waghode
as code owners
August 19, 2026 10:59
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…s-rebased # Conflicts: # go.mod # go.sum # internal/commands/agenthooks/guardrails/asca/delta.go # internal/commands/agenthooks/sca/prompts.go
Extract goosWindows constant in kics and ignore packages to satisfy goconst, and avoid copying IacRealtimeResult per loop iteration in geminiSuppressCommands to satisfy gocritic. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
cx-sumit-morchhale
had a problem deploying
to
release
August 26, 2026 07:22 — with
GitHub Actions
Error
Contributor
Original alert (resolved)Security Policy Alert: Secret Policy ViolationThis workflow run has been blocked by StepSecurity's secrets policy because it accesses secrets and the workflow file differs from the default branch. Secret references detected:
To approve this workflow, please add the Note: The label must be added by someone other than the PR author (cx-sumit-morchhale) or automation bots to ensure proper security review. After the label is added, you can re-run the blocked workflow to proceed. This workflow will be automatically approved once merged into the default branch. For more information, see StepSecurity's Secret Exfiltration Policy documentation. |
cx-sumit-morchhale
had a problem deploying
to
release
August 26, 2026 07:24 — with
GitHub Actions
Error
cx-rakesh-kadu
previously approved these changes
Aug 26, 2026
cx-sumit-morchhale
had a problem deploying
to
release
August 26, 2026 07:27 — with
GitHub Actions
Failure
cx-sumit-morchhale
had a problem deploying
to
release
August 26, 2026 08:11 — with
GitHub Actions
Failure
cx-sumit-morchhale
had a problem deploying
to
release
August 26, 2026 09:04 — with
GitHub Actions
Failure
cx-sumit-morchhale
self-requested a review
August 26, 2026 09:07
cx-sumit-morchhale
temporarily deployed
to
release
August 26, 2026 09:19 — with
GitHub Actions
Inactive
Gemini previously had its own additionalContext variant solely to generate suppress commands and use underscore-style MCP tool names. Since suppress isn't offered to Claude either, drop the Gemini-only path and instead parametrize additionalContext by agent so it picks the correct MCP tool name format (mcp_Checkmarx_... for Gemini vs mcp__Checkmarx__... for others), removing the now-dead suppress command plumbing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
cx-rahul-pidde
dismissed stale reviews from cx-sumit-morchhale and cx-rakesh-kadu
via
August 31, 2026 07:44
339065d
cx-kedar-bhujade
previously approved these changes
Aug 31, 2026
cx-kedar-bhujade
approved these changes
Aug 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for Google Gemini as an AI provider in the Checkmarx AST CLI agent hooks system, enabling Gemini-based agents to perform real-time security remediation alongside the existing Claude support. This change introduces agent-agnostic remediation routing that adapts MCP tool names and skill invocation patterns based on the AI provider.
What Changed
1. Agent-Agnostic Remediation Routing (
delta.go)remediationTargets(agent string)— Returns provider-specific:/cx-security-ascafor Gemini vscx-devassist:cx-devassist-ascafor Claude)mcp_Checkmarx_codeRemediationfor Gemini vsmcp__Checkmarx__codeRemediationfor Claude)additionalContext()— Now callsremediationTargets()to generate provider-specific instructions injected into the agent's context window2. Shell-Safe JSON Quoting Utility (
shellquote.go+shellquote_test.go)ignore.QuoteDataFlag(data)— Safely escapes JSON data for shell arguments"to\"for PowerShell native-exe argument parsing--dataarguments survive shell parsing3. Cross-Provider Hook Integration (
asca_test.go)TestAdditionalContext_GeminiUsesGeminiSkillAndMCPTool()to verify Gemini-specific routing4. SCA Vulnerability Suppression (
prompts.go)ignore.QuoteDataFlag()for cross-platform shell safety (same pattern as ASCA)Technical Details
Provider Detection
Agent name parameter passed through hook pipeline determines routing:
"Claude"→ Claude Code conventions"Gemini"→ Gemini CLI conventionsMCP Tool Naming Convention Difference
Skill Invocation Difference
Files Changed
internal/commands/agenthooks/guardrails/asca/delta.goremediationTargets(), updatedadditionalContext()for provider routinginternal/services/realtimeengine/ignore/shellquote.gointernal/services/realtimeengine/ignore/shellquote_test.gointernal/commands/agenthooks/sca/prompts.goQuoteDataFlag()internal/commands/agenthooks/guardrails/asca/asca_test.goTesting
New Tests
TestAdditionalContext_GeminiUsesGeminiSkillAndMCPTool()— Verifies Gemini routing works correctlyQuoteDataFlag()edge cases — Windows escaping, special characters, JSON preservationExisting Tests (Maintained)
Coverage
go test ./internal/commands/agenthooks/... -vgo test -tags integration ./test/integration -timeout 210mgolangci-lint run -c .golangci.ymlBackward Compatibility
✅ No breaking changes
Downstream Impact
This change prepares the CLI for:
Related Issues
ast-cx-hooksGemini adapter for BeforeTool hook handlingagentparameter in hook calls