AST-xxx: Add Gemini AI provider support for agent hook remediation - #1543
Open
cx-rahul-pidde wants to merge 1 commit into
Open
AST-xxx: Add Gemini AI provider support for agent hook remediation#1543cx-rahul-pidde wants to merge 1 commit into
cx-rahul-pidde wants to merge 1 commit 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
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