As AI coding assistance increases the number of pull requests, reviewers may no longer be able to check for vulnerabilities as well. So it becomes tempting to add a mechanism that scans pull requests automatically when they are opened and blocks risky ones from being merged. However, if the conditions for "blocking" do not match where your code lives or how you think about severity, you end up letting things through while believing they were scanned.
In its official blog post of November 11, 2026, "Don’t just flag it, fix it: How to run CodeMender in your pull requests", Google Cloud published a reference architecture that connects CodeMender, an agent for detecting and fixing vulnerabilities, to GitHub pull requests. The implementation is in the GitHub repository "codemender-gitops-starter-kit". In this article, we read the blog, the kit's README and code, and the CodeMender documentation, and summarize what to check before trying it. We covered where CodeMender itself fits in our article on CodeMender.
What it does
According to the kit's README, the flow is as follows.
- When a pull request is opened or updated, a relay workflow in GitHub Actions sends the event to a service on Cloud Run
- CodeMender scans the files changed in the pull request (the diff against the base) and pins the list of findings to the pull request as a single comment
- It sets the commit status
security/codemender-gate - Developers operate it through comments.
/verifytries the attack in a sandbox to confirm whether it is exploitable,/fixproposes a fix as a diff, and/approvecommits that fix to the branch and rescans
Commands can be used by collaborators with write or admin permissions, and /dismiss, which accepts a finding, and /override-gate, which overrides the gate, require maintain or admin permissions.
What to check before trying it
Not for production, and access requires approval
The top of the README says "This code is for PoC environments only." and states that it is not intended for production use and is not covered by Google's official support. CodeMender is in "Public Preview with gated access", and to use the CodeMender CLI (cm), your Google Cloud project must be on the allowlist.
The CodeMender documentation (updated November 12, 2026) also states that the Public Preview is available only to some customers and that access requires contacting a sales representative. It further states that, as a preview condition, it is provided for limited testing and evaluation and cannot be used for commercial or production purposes. If you try the kit, keep it within the scope of evaluation.
Only CRITICAL findings block a merge
The gate fails when a CRITICAL finding remains or when the scan did not complete. Severity is determined by a fixed policy per CWE. In the README's example, SQL injection and OS command injection are CRITICAL, XSS and IDOR (missing authorization checks) are HIGH, and hard-coded secrets are MEDIUM. By default, finding XSS or IDOR does not block a merge.
This default differs from the scan in GitHub Actions or Cloud Build (cm find --diff) described in the CodeMender documentation "Integrate with CI/CD." With the documented method, the check fails when a finding introduced by the pull request is CRITICAL or HIGH (the default for --fail-on is CRITICAL,HIGH), and it scans not only the changed files but also the files that call or import them. The kit's gate defaults to a narrower blocking scope than this.
In addition, enforcing the gate depends on settings on the GitHub side. Both the README and the blog state that unless security/codemender-gate is made required through branch protection (or rulesets), the gate is only advisory.
Changes under backend/ and frontend/ are not scanned
The README's "Known limitations" section says that changes under backend/, frontend/, scripts/, scratch/, configs/, .github/ and .gemini/ are treated as the kit's own tooling, so the scan is skipped and the gate passes. The backend/main.py code also excludes files with these seven prefixes. In repositories that keep application code in these folders, the main code will not be scanned as is. The README also asks you to fix the list before deployment if this applies.
Although the README does not mention it, backend/main.py also narrows the targets by file extension. It scans only .ts, .js, .py, .go, .java, .cpp, .c, .rb, .php, .sh and .tf files. Extensions such as .tsx, .jsx, .mjs, .vue, .kt and .cs are not on the target list, so they are not scanned even when they change along with other files, and a pull request that changes only such files passes the gate without a scan, just like the excluded folders. Out-of-scope files also do not count toward the file limit described below. In repositories with a lot of React or Vue UI code, review this list as well (this is based on reading the code; we have not verified it by running it).
In addition, the number of files scanned at once defaults to 20 (CM_MAX_SCAN_FILES, 1 to 100). If any files exceed the limit, the gate stays failed. One deployment can protect one repository.

Differences between the blog's description and the kit's implementation
Under the heading "No stored keys between GitHub and Cloud Run," the blog emphasizes that no long-lived keys are kept between GitHub and Cloud Run. The approach accepts short-lived OIDC tokens issued by GitHub Actions through Google Cloud's Workload Identity Federation. The blog further recommends using immutable IDs (assertion.repository_id and repository_owner_id) in the conditions rather than the repository name (assertion.repository), because names can be changed or taken by someone else after being released.
On the other hand, the condition created by the kit's scripts/setup_wif.sh is, by default (strict), a combination of assertion.repository == '<owner>/<repo>' and the workflow file and branch (job_workflow_ref). It matches by name, not by repository ID. The kit also assumes that a fine-grained personal access token scoped to the target repository is stored in Secret Manager for commenting and committing to GitHub. In this section the blog writes that "the agent needs write access to source code, which is exactly the kind of credential you don't want sitting in a secret store," but in the kit, only the path from GitHub to Cloud Run is replaced with OIDC. A long-lived token remains on the path where Cloud Run writes to GitHub.
When trying it, consider whether to replace the condition with the repository ID, and decide the token's permissions (read and write for Contents, Pull requests, Issues, Commit statuses and Checks) and how to rotate it. The approach to Google Cloud authentication without distributing keys is covered in our article on Workload Identity Federation.
The relay workflow and the data that gets stored
The relay workflow runs on pull_request_target. Because this event uses the workflow on main, the relay's contents cannot be rewritten from the pull request side. The workflow does not check out the pull request's code; it only sends the event JSON, and the receiving service re-reads the event from the GitHub API. Pull requests from forks are not relayed. When using pull_request_target in your own other workflows, take care not to break the same assumptions.
Also check where data is stored. According to the README, verification artifacts remain in Cloud Storage, scan records and accepted findings in BigQuery, and job state in Firestore, and the CodeMender CLI uses a Gemini model on Vertex AI (GOOGLE_CLOUD_LOCATION=global). Because source code fragments and attack steps remain in these, set project access rights and retention periods in line with your internal policies.
If you try it (editorial suggestions)
- Start with a test Google Cloud project and a test repository. Do not add it to production repositories
- Adjust the lists of excluded folders and target extensions against your own repository structure
- Decide which severity the gate blocks. If you also want to block on HIGH, change the kit's policy or combine it with other checks
- Write the Workload Identity Federation conditions with the repository ID, and decide the token's permissions and expiration
- Make
security/codemender-gaterequired through branch protection, then confirm that the sample vulnerable code is blocked
Scope of verification
On November 13, 2026, we read the official Google Cloud blog post (November 11, 2026) and, from GitHub's GCP-Architecture-Guides/codemender-gitops-starter-kit (commit da53aa3, November 11, 2026; the latest as of the 13th), the README,
scripts/setup_wif.sh,.github/workflows/codemender-wif.yml.exampleandbackend/main.py, as well as the CodeMender documentation (Overview, Integrate with CI/CD, and environment setup; all updated November 12, 2026) (desk research). We did not run CodeMender, deploy the kit or run the bundled tests. We have not checked CodeMender's pricing.
GleamHub's development, AI and automation consulting covers designing automated checks on pull requests and reviewing integrations between Google Cloud and GitHub. Please reach out via our contact form.









