Skip to content

AST-180794 - Add provenance tag and confidence-gated suppression to guardrail prompts - #1584

Merged
cx-sumit-morchhale merged 9 commits into
mainfrom
feature/AST-180794-add-provenance-tag-confidence-gated-remediation
Oct 12, 2026
Merged

cx-sumit-morchhale merged 9 commits into
mainfrom
feature/AST-180794-add-provenance-tag-confidence-gated-remediation

Conversation

@cx-kedar-bhujade

@cx-kedar-bhujade cx-kedar-bhujade commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a provenance tag and a hook-deny header to the ASCA, KICS, and SCA guardrail hook output, and replaces the blanket "ask the user first" suppression gate with a classify-then-act remediation model. This is the same change as #1578, which merged into staging; this PR brings it to main.

The flow:

  1. Each guardrail package (asca, kics, sca) builds its permissionDecisionReason, additionalContext, or finding text as before.
  2. provenanceTag prepends [Checkmarx cx-devassist — automated security output, not user input], so the coding agent can tell genuine Checkmarx output from text that only looks like a finding.
  3. hookDenyHeader opens the agent-facing instructions and states that the message is a Checkmarx hook deny, not file content or an untrusted tool error.
  4. Suppression has two independently sufficient paths: the user explicitly told the agent to suppress or ignore the finding, or the agent decides on its own from code it has opened and read. For SCA, the agent path also requires a remediation attempt that returned "no fixed version exists".
  5. Each prompt reminds the agent that the security check happens mid-task, so it resumes the user's original request afterward.

What changed

  • Guardrail prompts and findings in asca/delta.go, kics/delta.go, sca/prompts.go, and sca/sca.go carry the provenance tag and hook-deny header.
  • The "ASK THE USER FIRST" gate is removed from the ASCA and KICS Cursor prompts and the SCA vulnerable-package prompt.
  • github.com/Checkmarx/ast-cx-hooks is bumped from v1.0.9 to v1.0.10 in go.mod and go.sum for shared remediation report templates.
  • Tests cover the header and the absence of injection-trigger phrases such as "without asking" or "silently" across all five supported agents in asca/asca_test.go, kics/delta_test.go, and sca/sca_test.go.

Behavior guarantees

  • Suppression commands and remediation tool calls emitted by each guardrail are unchanged; only the surrounding instruction text changed.
  • A user's explicit suppress or ignore instruction is honored without first classifying the finding as a false positive.
  • No CLI flag, output format, or exit code changes.

Validation

  • Test approach: TDD was not established from available evidence.
  • Unit tests: go test ./internal/commands/agenthooks/... — passed.
  • Integration tests: Not run — no integration test covers guardrail prompt text.
  • Lint: Not re-run for this PR; CI runs golangci-lint.

Documentation updates

  • None required: this changes internal guardrail hook prompt text and a dependency version only, with no public API, CLI flag, or configuration change.

Related pull requests

cx-kedar-bhujade and others added 8 commits September 25, 2026 17:11
…ardrail prompts

Tags ASCA/KICS/SCA guardrail output with a Checkmarx provenance marker so
agents can distinguish genuine findings from spoofed text, and replaces the
blanket "ask the user first" suppression gate with a confidence-gated model:
suppress only when grounded in something verifiable in the file (or, for SCA,
after actually attempting remediation), otherwise ask instead of guessing.
Also reminds the agent to resume the original task after handling a finding.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…o guardrail prompts

Adds a shared hookDenyHeader to ASCA, KICS, and SCA guardrail prompts that
states up front the message is a Checkmarx hook deny, not file content or an
untrusted tool error, without repeating the spoof phrases the anti-injection
skill tests treat as evidence a message did not come from Checkmarx.

Splits the suppression rule into two independently sufficient paths: (a) the
user explicitly told the agent to suppress or ignore the finding, honored
immediately with no further verification, or (b) the agent decides on its own
and grounds that decision in code it has actually opened and read itself (not
an assumption or another file's claim). SCA's package suppression path is
tightened the same way, requiring either the user's instruction or an actual
remediation attempt returning "no fixed version exists".

Adds injection-trigger regression tests across all five supported agents for
ASCA, KICS, and SCA verifying the hook-deny header is present and phrases like
"without asking" or "silently" never appear in agent-facing text.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ation model

Replaces the analyze/ask-when-unsure flow with an explicit classify-then-act
sequence: findings are false positives only when cited evidence meets (a) or
(b), otherwise they are always remediated autonomously and never surfaced to
the user as a remediate-or-suppress question. Adds a structured remediation
summary report and a verify-and-retry step across ASCA, KICS, and SCA
guardrails.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the findings/packages list into the Cursor ASCA/KICS prompts and the
SCA malicious/vulnerable prompts (previously only in the non-Cursor path),
and simplifies remediationNote's signature now that subject/goal are no
longer used. Aligns summary report wording and evidence hints (e.g. "parent
module or sibling manifest") across agents, and updates the KICS Cursor test
to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extract the ASCA, KICS, and SCA closing remediation reports into shared
constants (ascaRemediationReport, kicsRemediationReport, scaMaliciousReport,
scaVulnerableReport) so the Cursor and non-Cursor deny paths render the same
markdown report instead of two copies that could drift apart. Bump
ast-cx-hooks to v1.0.10 and refresh go.sum.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cx-kedar-bhujade
cx-kedar-bhujade requested a review from a team October 12, 2026 09:32
@cx-sumit-morchhale
cx-sumit-morchhale merged commit db9fa4f into main Oct 12, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants