Skip to content

chore: add agent-readiness governance templates#944

Closed
KooshaPari wants to merge 1 commit intomainfrom
chore/agent-readiness-governance
Closed

chore: add agent-readiness governance templates#944
KooshaPari wants to merge 1 commit intomainfrom
chore/agent-readiness-governance

Conversation

@KooshaPari
Copy link
Copy Markdown
Owner

@KooshaPari KooshaPari commented Apr 2, 2026

chore: add agent-readiness governance templates

Summary by CodeRabbit

  • Chores
    • Added GitHub issue templates for bug reports and feature requests with structured form fields
    • Implemented automated security scanning workflow with secrets detection, static code analysis, dependency auditing, and container image scanning
    • Added code coverage tracking configuration with project and patch-level coverage thresholds
    • Configured Gitleaks to detect credential patterns in commits

Copilot AI review requested due to automatic review settings April 2, 2026 20:08
@cursor
Copy link
Copy Markdown

cursor bot commented Apr 2, 2026

You have used all Bugbot PR reviews included in your free trial for your GitHub account on this workspace.

To continue using Bugbot reviews, enable Bugbot for your team in the Cursor dashboard.

@gemini-code-assist
Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai
Copy link
Copy Markdown

codeant-ai bot commented Apr 2, 2026

Your free trial PR review limit of 100 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'pre_merge_checks'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Five new configuration and template files added to establish security scanning, issue management workflows, and code coverage standards. These include GitHub issue templates for bug reports and feature requests, a GitHub Actions security workflow with multiple scanning jobs, a Codecov coverage configuration, and a Gitleaks secrets detection configuration.

Changes

Cohort / File(s) Summary
GitHub Issue Templates
.github/ISSUE_TEMPLATE/bug-report.yml, .github/ISSUE_TEMPLATE/feature-request.yml
Structured issue templates for bug reports and feature requests with required/optional fields, dropdown selections, and default labels for triage workflow.
Workflow Automation
.github/workflows/security.yml
GitHub Actions workflow for automated security scanning including Gitleaks secret detection, Gosec static analysis, Nancy dependency auditing, and Trivy container scanning with SARIF result uploads.
Project Configuration
codecov.yml, gitleaks.toml
Coverage configuration defining targets (70% project, 80% patch), report behavior, ignored paths, and test flags; Gitleaks configuration with path-based exclusions, allowlist patterns, and regex-based secret detection rules for multiple credential types.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 With whiskers held high, I celebrate code,
Security scans now lighten the load!
Templates and workflows, all neatly arranged,
Coverage tracked, secrets exchanged,
A burrow of quality, thoughtfully staged! 🔒✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'chore: add agent-readiness governance templates' does not accurately describe the changeset, which includes security scanning workflows, coverage configuration, and issue templates—far beyond just governance templates. Update the title to reflect the actual scope, such as 'chore: add governance templates, security workflows, and codecov configuration' or break into separate PRs by concern.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/agent-readiness-governance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 2, 2026

Code Review Summary

Status: 3 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.github/workflows/security.yml 17-18 Empty env: block should be removed
.github/workflows/security.yml 55, 82, 102 Security tools using @master branch - pin to specific version for reproducibility and security
gitleaks.toml 12 .github/ in allowlist may allow secrets in workflow files to go undetected
Other Observations (not in diff)

This PR adds governance templates (YAML/TOML) rather than Rust code. The primary review criteria from AGENTS.md (cargo clippy, cargo fmt, cargo test) are not applicable here.

File Issue
codecov.yml Inconsistent indentation in paths array (lines 8-11)
Files Reviewed (5 files)
  • .github/ISSUE_TEMPLATE/bug-report.yml
  • .github/ISSUE_TEMPLATE/feature-request.yml
  • .github/workflows/security.yml
  • codecov.yml
  • gitleaks.toml

Assessment

The PR adds useful governance templates:

  • Issue templates for structured bug reports and feature requests
  • Security scanning workflow (Gitleaks, Gosec, Nancy, Trivy)
  • Codecov configuration
  • Gitleaks secret detection rules

Recommendations:

  1. Remove the empty env: block in security.yml
  2. Pin security tools to specific versions instead of @master
  3. Remove .github/ from gitleaks allowlist or add a note about workflow file scanning

Reviewed by minimax-m2.5 · 149,068 tokens

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds repo governance and readiness templates/configs to improve security scanning, coverage reporting, and issue intake for the project.

Changes:

  • Introduces a custom Gitleaks configuration and a GitHub Actions “Security Scan” workflow (gitleaks, gosec, nancy, trivy).
  • Adds a Codecov configuration to enforce project/patch coverage targets.
  • Adds GitHub Issue Form templates for bug reports and feature requests.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
gitleaks.toml Adds custom secret-detection rules and allowlists for Gitleaks.
codecov.yml Configures Codecov coverage status thresholds, ignore rules, and flags.
.github/workflows/security.yml Adds scheduled + PR/push security scanning workflow (secrets/SAST/deps/container).
.github/ISSUE_TEMPLATE/feature-request.yml Adds structured feature request issue form.
.github/ISSUE_TEMPLATE/bug-report.yml Adds structured bug report issue form.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +10 to +12

- "*.go"

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codecov.yml is invalid YAML: the sequence item at line 11 (- "*.go") is not under any key and will cause Codecov to fail parsing this config. Move it under paths: (if intended) or remove it so the file is valid YAML.

Suggested change
- "*.go"
- "*.go"

Copilot uses AI. Check for mistakes.
Comment on lines +7 to +10
paths:
- "src/"
- "cliproxyapi-plusplus/"

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The configured Codecov paths/flags don’t match this repo’s layout: cliproxyapi-plusplus/ and tests/unit/ / tests/integration/ don’t exist (repo uses pkg/, cmd/, and test/). This will make status checks/flags ineffective or misleading; update paths: and flags.*.paths to real directories.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +19
env:


Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The top-level env: key is currently empty (env: null), which can fail GitHub Actions workflow validation because env must be a mapping. Remove the env: block or populate it with at least an empty mapping (env: {}).

Suggested change
env:

Copilot uses AI. Check for mistakes.
Comment on lines +49 to +53
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow pins Go to 1.21, but the repository’s CI uses go-version-file: go.mod and go.mod declares go 1.26.0. Using an older toolchain here can break gosec/nancy runs or analyze the wrong code; align with the rest of the repo by using go-version-file: go.mod (or at least >=1.26.0).

Copilot uses AI. Check for mistakes.
Comment on lines +54 to +56
- name: Run Gosec
uses: securego/gosec@master
with:
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several third-party actions are referenced from moving branches (securego/gosec@master, sonatypecommunity/nancy-github-action@main, aquasecurity/trivy-action@master). This is a supply-chain risk and makes builds non-reproducible; pin these to a version tag or (preferably) a commit SHA.

Copilot uses AI. Check for mistakes.
- name: Run Nancy
uses: sonatypecommunity/nancy-github-action@main
with:
nancyCommand: sleuth --exclude-vulnerability CVE-2021-1234
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nancyCommand excludes a placeholder CVE (CVE-2021-1234). Keeping a fake exclusion is confusing (and may hide real misconfigurations later); either remove the exclusion or replace it with a documented, real exception that’s needed for this repo.

Suggested change
nancyCommand: sleuth --exclude-vulnerability CVE-2021-1234
nancyCommand: sleuth

Copilot uses AI. Check for mistakes.
"^docs/.*$",
"^\\.github/.*$",
"^.*\\.md$",
"^test.*$",
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allowlist currently excludes entire file classes/directories from scanning (e.g., all *.md, everything under docs/ and .github/). This significantly reduces secret-detection coverage in places where credentials are often accidentally committed (README snippets, workflow files); consider narrowing this allowlist to specific known-safe files/patterns instead of whole directories/extensions.

Suggested change
"^test.*$",

Copilot uses AI. Check for mistakes.
Comment on lines +89 to +96
[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''[0-9a-zA-Z/+]{40}'''
tags = ["aws", "secret"]
entropy = 4.5
secretGroup = 1

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The aws-secret-key rule regex ([0-9a-zA-Z/+]{40}) is extremely broad and will match many non-secret strings (any 40-char base64-ish token), likely causing high false-positive noise in CI. Prefer a more specific pattern that includes AWS context (e.g., assignment to aws_secret_access_key) or rely on gitleaks’ built-in AWS rules.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/ISSUE_TEMPLATE/bug-report.yml:
- Around line 1-113: Make the Version and Environment inputs required by adding
validations.required: true for the fields with id "version" and "environment";
add automation to apply a "security" label when the dropdown with id
"risk-profile" is set to "high (data loss or security concern)" (e.g., update
workflow/issue template automation to map that option to the security label);
and broaden the logs field description (id "logs") to clarify it accepts all log
types (application logs, stack traces, network traces, etc.) rather than only
shell output by updating the attributes.description and removing or adjusting
the render hint if necessary.

In @.github/ISSUE_TEMPLATE/feature-request.yml:
- Around line 1-95: The template applies a universal "triage" label and uses
non-standard priority wording and undefined effort buckets; update the form so
the labels array no longer blindly includes "triage" (or make its application
conditional via workflow/maintainer process), change the priority dropdown (id:
priority) options to standardized levels like "low", "medium", "high",
"critical", and add brief definitions for the effort dropdown (id: effort)
either in the dropdown description or as a markdown field so reporters know what
"small/medium/large/unknown" mean; ensure IDs (priority, effort, labels) are
updated consistently and that any automation that relied on the old "triage"
label is adjusted.

In @.github/workflows/security.yml:
- Around line 82-85: The Nancy workflow step ("Run Nancy" using
sonatypecommunity/nancy-github-action) contains a placeholder CVE exclusion in
the nancyCommand; remove the "--exclude-vulnerability CVE-2021-1234" flag from
the nancyCommand or, if you truly need to suppress one or more vulnerabilities,
replace it with the real CVE IDs and add an inline comment/justification above
the step explaining why each CVE is excluded; update the nancyCommand value to
only include valid flags and documented exclusions.
- Around line 77-80: Update the Go version used by the workflow step that sets
up Go (the step with "name: Setup Go" and uses: actions/setup-go@v5) so it
matches the project's go.mod requirement (change go-version from '1.21' to
'1.26.0' or the exact version declared in go.mod) to ensure dependency auditing
runs with the correct Go runtime.
- Around line 101-107: The Trivy step named "Run Trivy vulnerability scanner"
currently only outputs results and does not fail the workflow on critical
findings; update that step using the aquasecurity/trivy-action inputs to enforce
zero critical issues by adding a severity threshold and fail behavior (e.g., add
inputs like severity: 'CRITICAL' and exit-code: 1 or fail-on: 'CRITICAL'
depending on the action version) so the job fails when any CRITICAL
vulnerabilities are detected.
- Around line 17-18: Remove the empty env: section in the workflow to fix the
YAML syntax error: either delete the bare "env:" mapping entirely or populate it
with at least one environment variable. Locate the standalone "env:" key in the
workflow file (the one with no children) and remove that key or replace it with
valid key: value pairs so the workflow parser no longer errors.
- Around line 48-52: The GitHub Actions job uses actions/setup-go@v5 with
go-version '1.21' which doesn't match the module's go.mod (Go 1.26.0); update
the workflow's setup step to use go-version '1.26' (or '1.26.0') to match go.mod
and ensure tools/scanners run with the same toolchain; locate the "Setup Go"
step (uses: actions/setup-go@v5) and change the go-version input accordingly,
then re-run CI to verify builds and security scans succeed.
- Line 93: Remove the job-level conditional `if: ${{ hashFiles('Dockerfile') !=
'' }}` and instead add a dedicated step (e.g., id="check-dockerfile") that uses
a step-level `if: ${{ hashFiles('Dockerfile') != '' }}` or a short run that
writes an output to $GITHUB_OUTPUT indicating presence of the Dockerfile; then
make subsequent Docker-related steps conditional on that step output (or reuse
the step-level `if:`) so the hashFiles() call is only used at step scope not at
job scope.

In `@codecov.yml`:
- Around line 7-11: The paths list in codecov.yml is mis-indented (the entry "-
\"*.go\"" is outside the paths block), causing a YAML parse error; fix by
placing "*.go" as an item under the existing paths sequence (alongside "src/"
and "cliproxyapi-plusplus/") with the same indentation so the 'paths:' key
contains all three list entries and the YAML structure is valid.
- Around line 5-6: Update the Codecov configuration to enforce the repository
policy by changing the project coverage target: locate the "target" setting in
the codecov.yml (the project-level target entry) and set its value from 70% to
80% so CI enforces an 80% coverage gate (leave "threshold" as-is unless policy
requires adjustment).

In `@gitleaks.toml`:
- Around line 89-95: The current rule id "aws-secret-key" uses an overly broad
regex `[0-9a-zA-Z/+]{40}` and sets secretGroup = 1 despite no capture groups;
update the rule so the regex requires AWS-specific context (e.g., proximity to
keywords like "AWS", "aws_secret_access_key", "secret_key", or pairing with the
AWS access key pattern "AKIA...") and define a proper capture group around the
40-char secret, then set secretGroup to that capture index (or remove
secretGroup if not using captures); also consider tightening entropy or adding
lookaround anchors to reduce false positives.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b2ead896-6f09-49f2-8036-4b8af35b098d

📥 Commits

Reviewing files that changed from the base of the PR and between b168e5c and 4e835c4.

📒 Files selected for processing (5)
  • .github/ISSUE_TEMPLATE/bug-report.yml
  • .github/ISSUE_TEMPLATE/feature-request.yml
  • .github/workflows/security.yml
  • codecov.yml
  • gitleaks.toml

Comment on lines +1 to +113
name: Bug Report
description: Report a bug or unexpected behavior
title: "[BUG] "
labels: ["bug", "triage"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report a bug! Please fill out the information below to help us fix it quickly.

- type: input
id: component
attributes:
label: Component
description: Which component or module is affected?
placeholder: e.g., API, CLI, Database, Authentication
validations:
required: true

- type: textarea
id: description
attributes:
label: Bug Description
description: A clear and concise description of the bug
placeholder: Tell us what happened that shouldn't have...
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction Steps
description: Steps to reproduce the behavior
placeholder: |
1. Go to '...'
2. Click on '...'
3. Run command '...'
4. See error
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What you expected to happen instead
placeholder: Describe what should have happened...
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Behavior
description: What actually happened
placeholder: Describe what actually happened including any error messages...

- type: textarea
id: logs
attributes:
label: Logs and Error Messages
description: Paste any relevant log output or error messages (use code blocks)
render: shell

- type: dropdown
id: risk-profile
attributes:
label: Risk Profile
description: How severe is this bug?
options:
- low (minor inconvenience)
- medium (feature not working)
- high (data loss or security concern)
validations:
required: true

- type: dropdown
id: frequency
attributes:
label: Frequency
description: How often does this occur?
options:
- Once
- Sometimes
- Always
validations:
required: true

- type: input
id: version
attributes:
label: Version
description: What version of the software are you using?
placeholder: e.g., v1.2.3, commit hash, or "latest"

- type: input
id: environment
attributes:
label: Environment
description: Operating system, runtime version, etc.
placeholder: e.g., macOS 14.2, Python 3.11, Node 20

- type: checkboxes
id: checks
attributes:
label: Checklist
options:
- label: I have searched existing issues to ensure this is not a duplicate
required: true
- label: I have provided clear reproduction steps
required: false
- label: I have included relevant logs/error messages
required: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Excellent bug report template!

The template is well-structured with all essential fields for effective bug triage and investigation. The required fields (component, description, reproduction steps, expected behavior, risk profile, frequency) ensure sufficient information for debugging, while optional fields capture additional context.

Some optional enhancements to consider:

  1. Lines 89-94 & 96-101: Version and environment information are currently optional but are critical for reproducing bugs. Consider making these required fields, as they significantly impact the ability to triage and fix issues.

  2. Lines 65-75: The risk profile dropdown includes "high (data loss or security concern)". Consider adding automation to apply a security label when this option is selected, enabling faster escalation of security-related bugs.

  3. Line 63: The render: shell attribute is helpful for formatting, but the description "Paste any relevant log output or error messages" could clarify that this applies to all log types (application logs, stack traces, etc.), not just shell output.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/ISSUE_TEMPLATE/bug-report.yml around lines 1 - 113, Make the Version
and Environment inputs required by adding validations.required: true for the
fields with id "version" and "environment"; add automation to apply a "security"
label when the dropdown with id "risk-profile" is set to "high (data loss or
security concern)" (e.g., update workflow/issue template automation to map that
option to the security label); and broaden the logs field description (id
"logs") to clarify it accepts all log types (application logs, stack traces,
network traces, etc.) rather than only shell output by updating the
attributes.description and removing or adjusting the render hint if necessary.

Comment on lines +1 to +95
name: Feature Request
description: Suggest a new feature or enhancement
title: "[FEAT] "
labels: ["enhancement", "triage"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a feature! Please provide as much detail as possible to help us understand and prioritize your request.

- type: input
id: component
attributes:
label: Component
description: Which area does this feature relate to?
placeholder: e.g., API, CLI, UI, Performance, Documentation
validations:
required: true

- type: textarea
id: problem
attributes:
label: Problem Statement
description: What problem are you trying to solve?
placeholder: Describe the pain point or limitation you're experiencing...
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed Solution
description: Describe your proposed solution or feature
placeholder: Explain what you'd like to see added or changed...
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: What alternatives have you considered?
placeholder: Describe any workarounds or alternative approaches...

- type: textarea
id: context
attributes:
label: Additional Context
description: Any other context, screenshots, or examples
placeholder: Add any other relevant information, mockups, or use cases...

- type: dropdown
id: priority
attributes:
label: Priority
description: How important is this feature to you?
options:
- nice to have
- would help workflow
- blocking my work
validations:
required: true

- type: dropdown
id: effort
attributes:
label: Estimated Effort (if known)
description: How complex do you think this feature is?
options:
- small (hours)
- medium (days)
- large (weeks)
- unknown

- type: checkboxes
id: contributions
attributes:
label: Contribution
options:
- label: I am willing to implement this feature
required: false
- label: I can help test this feature
required: false
- label: I can provide additional requirements/details
required: false

- type: checkboxes
id: checks
attributes:
label: Checklist
options:
- label: I have searched existing issues for similar requests
required: true
- label: This feature aligns with the project's goals
required: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial

Well-structured feature request template!

The template follows GitHub's issue form schema correctly and includes all essential fields for effective feature request triage. The combination of required fields (component, problem, solution, priority) ensures sufficient information for prioritization, while optional fields allow for additional context without creating friction.

A few optional refinements to consider:

  1. Line 4: The triage label is applied to all feature requests. Consider whether this label serves its purpose if it's universal, or if it should be conditionally applied based on form responses.

  2. Lines 57-60: Priority options use descriptive phrases ("nice to have", "would help workflow", "blocking my work"). For consistency with bug reports and industry standards, consider aligned severity levels like low, medium, high, critical.

  3. Lines 69-72: The effort estimates are helpful for planning. Consider whether these should have definitions in the template description to ensure consistency across reporters.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/ISSUE_TEMPLATE/feature-request.yml around lines 1 - 95, The template
applies a universal "triage" label and uses non-standard priority wording and
undefined effort buckets; update the form so the labels array no longer blindly
includes "triage" (or make its application conditional via workflow/maintainer
process), change the priority dropdown (id: priority) options to standardized
levels like "low", "medium", "high", "critical", and add brief definitions for
the effort dropdown (id: effort) either in the dropdown description or as a
markdown field so reporters know what "small/medium/large/unknown" mean; ensure
IDs (priority, effort, labels) are updated consistently and that any automation
that relied on the old "triage" label is adjusted.

Comment on lines +17 to +18
env:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove the empty env: section.

The env: section is defined but contains no environment variables, which causes a syntax error. Either remove this section entirely or define at least one environment variable.

🔧 Proposed fix
-env:
-  
-
 jobs:
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
env:
🧰 Tools
🪛 actionlint (1.7.11)

[error] 17-17: expecting a single ${{...}} expression or mapping value for "env" section, but found plain text node

(syntax-check)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/security.yml around lines 17 - 18, Remove the empty env:
section in the workflow to fix the YAML syntax error: either delete the bare
"env:" mapping entirely or populate it with at least one environment variable.
Locate the standalone "env:" key in the workflow file (the one with no children)
and remove that key or replace it with valid key: value pairs so the workflow
parser no longer errors.

Comment on lines +48 to +52

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check Go version requirement in go.mod

grep "^go " go.mod

Repository: KooshaPari/cliproxyapi-plusplus

Length of output: 84


🏁 Script executed:

sed -n '40,60p' .github/workflows/security.yml

Repository: KooshaPari/cliproxyapi-plusplus

Length of output: 569


Update Go version to match go.mod requirement.

The workflow uses Go 1.21, but go.mod specifies Go 1.26.0. Running security scans with an outdated toolchain may miss vulnerabilities introduced in newer versions or allow issues that newer compilers would catch.

🔧 Proposed fix
       - name: Setup Go
         uses: actions/setup-go@v5
         with:
-          go-version: '1.21'
+          go-version: '1.26'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/security.yml around lines 48 - 52, The GitHub Actions job
uses actions/setup-go@v5 with go-version '1.21' which doesn't match the module's
go.mod (Go 1.26.0); update the workflow's setup step to use go-version '1.26'
(or '1.26.0') to match go.mod and ensure tools/scanners run with the same
toolchain; locate the "Setup Go" step (uses: actions/setup-go@v5) and change the
go-version input accordingly, then re-run CI to verify builds and security scans
succeed.

Comment on lines +77 to +80
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Update Go version to match go.mod requirement.

Same issue as the SAST job: the workflow uses Go 1.21 while go.mod requires Go 1.26.0. Dependency auditing should run with the correct Go version to ensure accurate vulnerability detection.

🔧 Proposed fix
       - name: Setup Go
         uses: actions/setup-go@v5
         with:
-          go-version: '1.21'
+          go-version: '1.26'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.26'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/security.yml around lines 77 - 80, Update the Go version
used by the workflow step that sets up Go (the step with "name: Setup Go" and
uses: actions/setup-go@v5) so it matches the project's go.mod requirement
(change go-version from '1.21' to '1.26.0' or the exact version declared in
go.mod) to ensure dependency auditing runs with the correct Go runtime.

container:
name: Container Scan
runs-on: ubuntu-latest
if: ${{ hashFiles('Dockerfile') != '' }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

GitHub Actions hashFiles function context availability

💡 Result:

The hashFiles function in GitHub Actions is a special expression function (not part of any specific context like github.context) that computes a SHA256 hash of files matching given glob patterns. It is available only in specific locations within workflow YAML files where expressions are evaluated on the runner, primarily under jobs.<job_id>.steps.* keys. Availability details from official GitHub documentation: - jobs..steps.continue-on-error - jobs..steps.env - jobs..steps.if - jobs..steps.name - jobs..steps.run - jobs..steps.timeout-minutes - jobs..steps.with - jobs..steps.working-directory It is NOT available in higher-level keys like workflow run-name, env, jobs.<job_id>.strategy, jobs.<job_id>.container, etc., nor inside JavaScript actions (use @actions/cache or implement manually). Expressions containing hashFiles are evaluated before step execution, so changes to files within a 'run' script do not affect the hash (split into separate steps if needed). If no files match, it returns an empty string.

Citations:


🏁 Script executed:

cat -n .github/workflows/security.yml | sed -n '85,105p'

Repository: KooshaPari/cliproxyapi-plusplus

Length of output: 820


🏁 Script executed:

cat -n .github/workflows/security.yml | sed -n '101,115p'

Repository: KooshaPari/cliproxyapi-plusplus

Length of output: 561


Fix the job-level conditional syntax for Dockerfile detection.

The hashFiles() function is not allowed in job-level if: conditions—it's only available in step-level contexts. This will cause the workflow to fail. Use a step-level approach to check for Dockerfile existence instead.

🔧 Proposed fix using step-level conditional

Remove the job-level if: and add a step to check for Dockerfile:

   container:
     name: Container Scan
     runs-on: ubuntu-latest
-    if: ${{ hashFiles('Dockerfile') != '' }}
     steps:
       - name: Checkout
         uses: actions/checkout@v4
 
+      - name: Check for Dockerfile
+        id: dockerfile_check
+        run: |
+          if [ -f "Dockerfile" ]; then
+            echo "exists=true" >> $GITHUB_OUTPUT
+          else
+            echo "exists=false" >> $GITHUB_OUTPUT
+          fi
+
       - name: Build image
+        if: steps.dockerfile_check.outputs.exists == 'true'
         run: docker build -t ${{ github.event.repository.name }}:scan .
 
       - name: Run Trivy vulnerability scanner
+        if: steps.dockerfile_check.outputs.exists == 'true'
         uses: aquasecurity/trivy-action@master
         with:
           image-ref: '${{ github.event.repository.name }}:scan'
           format: 'sarif'
           output: 'trivy-results.sarif'
 
       - name: Upload Trivy results
+        if: steps.dockerfile_check.outputs.exists == 'true' && always()
         uses: github/codeql-action/upload-sarif@v3
-        if: always()
         with:
           sarif_file: 'trivy-results.sarif'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if: ${{ hashFiles('Dockerfile') != '' }}
container:
name: Container Scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check for Dockerfile
id: dockerfile_check
run: |
if [ -f "Dockerfile" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
- name: Build image
if: steps.dockerfile_check.outputs.exists == 'true'
run: docker build -t ${{ github.event.repository.name }}:scan .
- name: Run Trivy vulnerability scanner
if: steps.dockerfile_check.outputs.exists == 'true'
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ github.event.repository.name }}:scan'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy results
if: steps.dockerfile_check.outputs.exists == 'true' && always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'
🧰 Tools
🪛 actionlint (1.7.11)

[error] 93-93: calling function "hashFiles" is not allowed here. "hashFiles" is only available in "jobs.<job_id>.steps.continue-on-error", "jobs.<job_id>.steps.env", "jobs.<job_id>.steps.if", "jobs.<job_id>.steps.name", "jobs.<job_id>.steps.run", "jobs.<job_id>.steps.timeout-minutes", "jobs.<job_id>.steps.with", "jobs.<job_id>.steps.working-directory". see https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details

(expression)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/security.yml at line 93, Remove the job-level conditional
`if: ${{ hashFiles('Dockerfile') != '' }}` and instead add a dedicated step
(e.g., id="check-dockerfile") that uses a step-level `if: ${{
hashFiles('Dockerfile') != '' }}` or a short run that writes an output to
$GITHUB_OUTPUT indicating presence of the Dockerfile; then make subsequent
Docker-related steps conditional on that step output (or reuse the step-level
`if:`) so the hashFiles() call is only used at step scope not at job scope.

Comment on lines +101 to +107
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: '${{ github.event.repository.name }}:scan'
format: 'sarif'
output: 'trivy-results.sarif'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Enforce zero critical security issues in Trivy scan.

The Trivy scan does not enforce the requirement for zero critical security issues. Configure Trivy to fail the build when critical vulnerabilities are detected. Based on learnings, zero critical security issues should be enforced using the Trivy scan.

🔒 Proposed fix to enforce severity threshold
       - name: Run Trivy vulnerability scanner
         uses: aquasecurity/trivy-action@master
         with:
           image-ref: '${{ github.event.repository.name }}:scan'
           format: 'sarif'
           output: 'trivy-results.sarif'
+          severity: 'CRITICAL,HIGH'
+          exit-code: '1'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/security.yml around lines 101 - 107, The Trivy step named
"Run Trivy vulnerability scanner" currently only outputs results and does not
fail the workflow on critical findings; update that step using the
aquasecurity/trivy-action inputs to enforce zero critical issues by adding a
severity threshold and fail behavior (e.g., add inputs like severity: 'CRITICAL'
and exit-code: 1 or fail-on: 'CRITICAL' depending on the action version) so the
job fails when any CRITICAL vulnerabilities are detected.

Comment on lines +5 to +6
target: 70%
threshold: 1%
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Raise project coverage target to 80% to match repository policy.

Line 5 sets project coverage to 70%, which weakens the CI gate relative to the documented standard.

Suggested fix
-        target: 70%
+        target: 80%

Based on learnings: "Enforce 80% test coverage as a CI gate." and "Maintain >80% test coverage for critical code paths".

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
target: 70%
threshold: 1%
target: 80%
threshold: 1%
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@codecov.yml` around lines 5 - 6, Update the Codecov configuration to enforce
the repository policy by changing the project coverage target: locate the
"target" setting in the codecov.yml (the project-level target entry) and set its
value from 70% to 80% so CI enforces an 80% coverage gate (leave "threshold"
as-is unless policy requires adjustment).

Comment on lines +7 to +11
paths:
- "src/"
- "cliproxyapi-plusplus/"

- "*.go"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix invalid YAML structure under paths (parsing blocker).

Line 11 is mis-indented and creates a YAML syntax error (expected <block end>, but found '-'). Codecov won’t parse this file.

Suggested fix
     project:
       default:
         target: 70%
         threshold: 1%
         paths:
           - "src/"
           - "cliproxyapi-plusplus/"
-        
-        - "*.go"
+          - "*.go"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
paths:
- "src/"
- "cliproxyapi-plusplus/"
- "*.go"
paths:
- "src/"
- "cliproxyapi-plusplus/"
- "*.go"
🧰 Tools
🪛 YAMLlint (1.38.0)

[error] 11-11: syntax error: expected , but found '-'

(syntax)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@codecov.yml` around lines 7 - 11, The paths list in codecov.yml is
mis-indented (the entry "- \"*.go\"" is outside the paths block), causing a YAML
parse error; fix by placing "*.go" as an item under the existing paths sequence
(alongside "src/" and "cliproxyapi-plusplus/") with the same indentation so the
'paths:' key contains all three list entries and the YAML structure is valid.

Comment on lines +89 to +95
[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''[0-9a-zA-Z/+]{40}'''
tags = ["aws", "secret"]
entropy = 4.5
secretGroup = 1
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Refine the AWS secret key pattern to reduce false positives.

The regex [0-9a-zA-Z/+]{40} is too generic and will match any 40-character alphanumeric string, leading to many false positives (base64 strings, hashes, etc.). Consider adding context requirements, such as proximity to AWS-related keywords or pairing with the AWS access key pattern.

Additionally, secretGroup = 1 is specified, but the regex contains no capture groups.

♻️ Suggested refinement
 [[rules]]
   id = "aws-secret-key"
   description = "AWS Secret Key"
-  regex = '''[0-9a-zA-Z/+]{40}'''
+  regex = '''(?i)(aws[_-]?secret[_-]?key|aws[_-]?secret)[\s]*[=:]+[\s]*['"]?([0-9a-zA-Z/+]{40})['"]?'''
   tags = ["aws", "secret"]
   entropy = 4.5
-  secretGroup = 1
+  secretGroup = 2

This pattern requires AWS-related keywords near the secret, and properly defines capture groups.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''[0-9a-zA-Z/+]{40}'''
tags = ["aws", "secret"]
entropy = 4.5
secretGroup = 1
[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''(?i)(aws[_-]?secret[_-]?key|aws[_-]?secret)[\s]*[=:]+[\s]*['"]?([0-9a-zA-Z/+]{40})['"]?'''
tags = ["aws", "secret"]
entropy = 4.5
secretGroup = 2
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@gitleaks.toml` around lines 89 - 95, The current rule id "aws-secret-key"
uses an overly broad regex `[0-9a-zA-Z/+]{40}` and sets secretGroup = 1 despite
no capture groups; update the rule so the regex requires AWS-specific context
(e.g., proximity to keywords like "AWS", "aws_secret_access_key", "secret_key",
or pairing with the AWS access key pattern "AKIA...") and define a proper
capture group around the 40-char secret, then set secretGroup to that capture
index (or remove secretGroup if not using captures); also consider tightening
entropy or adding lookaround anchors to reduce false positives.

@KooshaPari KooshaPari closed this Apr 3, 2026
@KooshaPari KooshaPari deleted the chore/agent-readiness-governance branch April 3, 2026 01:28
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.

2 participants