Skip to content

fix: clarify advisory output string concatenation (PR #5689 follow-up)#5691

Merged
marcusquinn merged 2 commits intomainfrom
feature/security-advisory-system
Mar 25, 2026
Merged

fix: clarify advisory output string concatenation (PR #5689 follow-up)#5691
marcusquinn merged 2 commits intomainfrom
feature/security-advisory-system

Conversation

@alex-solovyev
Copy link
Copy Markdown
Collaborator

@alex-solovyev alex-solovyev commented Mar 25, 2026

Summary

Closes #5689 review item #3.

Summary by CodeRabbit

  • Chores
    • Updated DSPy dependency to version 3.1.3
    • Removed legacy dependency alias
    • Updated known dependency vulnerability documentation

@github-actions github-actions bot added the bug Auto-created from TODO.md tag label Mar 25, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

This pull request updates the DSPy dependency from version 2.6.27 to 3.1.3 and removes the legacy dspy-ai alias, while documenting a known CVE in the diskcache pinned version. Additionally, shell script logic in the advisory processing module is refactored to use printf-based construction and controlled newline aggregation instead of direct string concatenation.

Changes

Cohort / File(s) Summary
Advisory Output Refactoring
.agents/scripts/aidevops-update-check.sh
Refactored advisories_output assembly to use per-advisory printf-constructed entries with conditional newline prefixing, replacing direct concatenation while preserving output structure.
Dependency Updates
requirements.txt
Removed legacy dspy-ai==2.6.27 alias; upgraded dspy to 3.1.3; added inline CVE documentation comment for pinned diskcache==5.6.3 (version unchanged).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

📦 Dependencies rise, from old to new,
DSPy climbs from point-six to three,
Advisory strings now neatly brew,
With printf precision, clean and free! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Changes in aidevops-update-check.sh align with PR #5689's advisory system scope. However, requirements.txt updates (dspy upgrade and diskcache CVE comment) extend beyond the advertised scope of this follow-up PR. The requirements.txt changes (dspy 2.6.27→3.1.3 upgrade and diskcache CVE comment) appear to address separate concerns from the original PR #5689 follow-up. Clarify whether these dependency updates are intentional or should be reverted to maintain PR scope focus.
Docstring Coverage ⚠️ Warning Docstring coverage is 61.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Title clearly describes the main change: refactoring advisory output string concatenation logic in aidevops-update-check.sh as a follow-up fix to PR #5689.
Linked Issues check ✅ Passed The PR addresses the refactoring follow-up noted in issue #5689, specifically resolving CodeRabbit review item #3 regarding confusing multi-line string literals in the advisory output concatenation logic.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/security-advisory-system

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.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly strengthens the aidevops framework's security capabilities by introducing a new secret-hygiene-helper.sh script. This script performs comprehensive scans for plaintext credentials, identifies suspicious Python .pth files (a common supply chain attack vector), checks for unpinned dependencies, and audits MCP server configurations for auto-download risks. These new checks are seamlessly integrated into a unified aidevops security command and active advisories are now displayed in the session greeting. Additionally, Python dependencies are now strictly pinned to enhance supply chain security, and a minor string concatenation issue in an advisory output was clarified.

Highlights

  • Enhanced Security Scanning: Introduced secret-hygiene-helper.sh to scan for plaintext secrets, suspicious Python .pth files, unpinned dependencies, and risky MCP server configurations.
  • Unified Security Command: Integrated new and existing security checks under a single aidevops security command, providing a comprehensive assessment of user posture, secret hygiene, and supply chain integrity.
  • Active Security Advisories: Implemented a system to deliver and display security advisories (e.g., LiteLLM supply chain attack) in the session greeting until dismissed by the user.
  • Supply Chain Hardening: Pinned all Python dependencies in requirements.txt to exact versions to prevent malicious package upgrades and mitigate supply chain risks.
  • Output Clarity Fix: Replaced a confusing multi-line string literal with explicit printf-based concatenation in aidevops-update-check.sh for improved readability and to resolve a false positive from a previous code review.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Mar 25, 2026

🤖 Augment PR Summary

Summary: This PR expands aidevops security UX by adding a secret-hygiene scanner, a lightweight supply-chain IoC check, and a persistent advisory system that surfaces active advisories in the session greeting until dismissed.

Changes:

  • Added secret-hygiene-helper.sh to scan for common plaintext credential locations, suspicious Python .pth files, unpinned deps, and risky MCP auto-download configs
  • Added an initial advisory file (litellm-2026-03) describing the March 2026 LiteLLM compromise and suggested checks
  • Updated aidevops-update-check.sh to run the hygiene startup check and to display non-dismissed advisories in the greeting
  • Extended aidevops security routing so no-arg runs “posture + hygiene”, with subcommands for targeted scans and advisory dismissal
  • Pinned Python dependencies in requirements.txt to exact versions to reduce supply-chain risk
  • Updated docs/help text and agent deployment to include advisories and the new security workflow

Technical Notes: Advisories are stored under ~/.aidevops/advisories and tracked via a local dismissed.txt; the scanner is designed to avoid printing secret values while flagging risky locations/IoCs.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

first_line=$(head -1 "$advisory_file" | sed 's/^[[:space:]]*//')
if [[ -n "$first_line" ]]; then
local entry
entry=$(printf '%s Run in your terminal: secret-hygiene-helper.sh scan | Dismiss: secret-hygiene-helper.sh dismiss %s' "$first_line" "$adv_id")
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The greeting text suggests running secret-hygiene-helper.sh ..., but helpers are typically invoked via aidevops/_dispatch_helper and may not be on PATH, so this can lead users to a “command not found” dead-end. Consider emitting the stable entrypoints (e.g., aidevops security scan / aidevops security dismiss <id>) consistently in advisories and startup warnings.

Severity: medium

Other Locations
  • .agents/advisories/litellm-2026-03.advisory:15
  • .agents/advisories/litellm-2026-03.advisory:21
  • .agents/scripts/secret-hygiene-helper.sh:481
  • .agents/scripts/secret-hygiene-helper.sh:505
  • .agents/scripts/secret-hygiene-helper.sh:509

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

local found_suspicious=0

# Find all Python site-packages directories
for py in /opt/homebrew/opt/python@*/bin/python3.* /usr/local/bin/python3.*; do
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The .pth audit only iterates Homebrew and /usr/local Python installs; common system installs like /usr/bin/python3* (and other distributions) won’t be scanned, which could miss IoCs on many Linux hosts. Since this is a security detector, gaps in interpreter discovery can materially reduce coverage.

Severity: high

Other Locations
  • .agents/scripts/secret-hygiene-helper.sh:475

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

for py in /opt/homebrew/opt/python@*/bin/python3.* /usr/local/bin/python3.*; do
[[ -x "$py" ]] || continue
local sp
sp=$("$py" -c "import site; print(site.getsitepackages()[0])" 2>/dev/null) || continue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Using site.getsitepackages()[0] scans only the first site-packages directory and doesn’t cover user site-packages (site.getusersitepackages()), so .pth IoCs from pip install --user (or multi-path installs) can be missed. This is especially relevant given the advisory notes that .pth executes on every Python startup.

Severity: high

Other Locations
  • .agents/scripts/secret-hygiene-helper.sh:478

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

local perms
perms=$(get_perms "$aws_creds")
local key_count
key_count=$(grep -c "aws_access_key_id\|aws_secret_access_key\|aws_session_token" "$aws_creds" 2>/dev/null) || key_count=0
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These grep counts rely on the \| alternation escape in basic regex mode; on some grep variants this isn’t supported (or behaves differently), which can silently produce incorrect counts in the reported finding text. If the counts are meant to be reliable cross-platform, this pattern is a portability risk.

Severity: low

Other Locations
  • .agents/scripts/secret-hygiene-helper.sh:181
  • .agents/scripts/secret-hygiene-helper.sh:207
  • .agents/scripts/secret-hygiene-helper.sh:229

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

coderabbitai[bot]
coderabbitai bot previously requested changes Mar 25, 2026
Copy link
Copy Markdown
Contributor

@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: 1

🧹 Nitpick comments (2)
.agents/scripts/secret-hygiene-helper.sh (2)

303-342: Consider broader Python installation discovery.

The current Python path iteration covers Homebrew and /usr/local installations, which handles most macOS setups. However, this may miss:

  • pyenv installations (~/.pyenv/versions/*/)
  • System Python on Linux (/usr/lib/python*/)
  • User-installed Python (~/.local/lib/python*/)

For a "Chill" review, this is acceptable as-is since the most common paths are covered and the script is primarily macOS-focused. Consider expanding coverage in a future iteration if Linux support becomes a priority.

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

In @.agents/scripts/secret-hygiene-helper.sh around lines 303 - 342, The current
for-loop that iterates candidate Python executables (the for py in
/opt/homebrew/... /usr/local/bin/python3.* loop) misses pyenv, system Linux and
user-local installs; update the discovery to also include pyenv-managed
interpreters (expand candidates to ~/.pyenv/versions/*/bin/python3*),
system-wide Linux paths (e.g., /usr/lib/python*/bin/python3*), and user-local
installs (e.g., ~/.local/bin/python3* or ~/.local/lib/python*/*/bin/python3*),
and/or supplement with a fallback like enumerating `which -a python3` results;
keep the rest of the logic unchanged (sp variable from "$py" -c "import
site...", basename_pth checks, and grep/report_finding behavior).

393-399: Version spec regex may have edge cases.

The check grep -qE '>=' && ! grep -qE '==' could produce false positives for specs like package>=1.0,<2.0 (which is actually bounded) or miss patterns like package~=1.0 (compatible release). For the intended purpose of flagging supply-chain risk, this conservative approach is reasonable — flagging more is safer than missing potential issues.

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

In @.agents/scripts/secret-hygiene-helper.sh around lines 393 - 399, The current
check inside the while loop that increments unpinned uses grep -qE '>=' && !
grep -qE '==' which misclassifies bounded specs like "package>=1.0,<2.0" and
misses other operators like "~="; update the conditional in the loop that
touches unpinned to more robustly detect unbounded/loose specs by: consider a
line unpinned if it contains any of the loose operators ('>=', '>', '~=') AND
the line does NOT contain any upper-bound indicators ('<' or '<=' or a comma
followed by '<'); apply this new logic where unpinned is incremented
(referencing the while IFS= read -r line; do ... done <"$req_file" loop and the
unpinned variable) so bounded combos like ">=... , <..." are not flagged while
"~=" and pure >=/> specs without an upper bound are flagged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@requirements.txt`:
- Line 11: Update the dspy pin from dspy==2.6.27 to at least 3.0.4 (preferably
the latest 3.1.3) in requirements.txt to remediate CVE-2025-12695; after
updating, run your dependency install and tests to ensure no breakage. For
diskcache (diskcache==5.6.3) add a note to the security backlog documenting
CVE-2025-69872 and, until a patched release exists, implement operational
mitigations: restrict write access to the cache directory, avoid loading
untrusted pickles, and add CI/monitoring to flag any future diskcache upgrades.
Ensure both changes are recorded in the PR and changelog.

---

Nitpick comments:
In @.agents/scripts/secret-hygiene-helper.sh:
- Around line 303-342: The current for-loop that iterates candidate Python
executables (the for py in /opt/homebrew/... /usr/local/bin/python3.* loop)
misses pyenv, system Linux and user-local installs; update the discovery to also
include pyenv-managed interpreters (expand candidates to
~/.pyenv/versions/*/bin/python3*), system-wide Linux paths (e.g.,
/usr/lib/python*/bin/python3*), and user-local installs (e.g.,
~/.local/bin/python3* or ~/.local/lib/python*/*/bin/python3*), and/or supplement
with a fallback like enumerating `which -a python3` results; keep the rest of
the logic unchanged (sp variable from "$py" -c "import site...", basename_pth
checks, and grep/report_finding behavior).
- Around line 393-399: The current check inside the while loop that increments
unpinned uses grep -qE '>=' && ! grep -qE '==' which misclassifies bounded specs
like "package>=1.0,<2.0" and misses other operators like "~="; update the
conditional in the loop that touches unpinned to more robustly detect
unbounded/loose specs by: consider a line unpinned if it contains any of the
loose operators ('>=', '>', '~=') AND the line does NOT contain any upper-bound
indicators ('<' or '<=' or a comma followed by '<'); apply this new logic where
unpinned is incremented (referencing the while IFS= read -r line; do ... done
<"$req_file" loop and the unpinned variable) so bounded combos like ">=... ,
<..." are not flagged while "~=" and pure >=/> specs without an upper bound are
flagged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 377cba40-3402-4851-8abd-894638b28b69

📥 Commits

Reviewing files that changed from the base of the PR and between 773d54b and 1d2622c.

📒 Files selected for processing (10)
  • .agents/AGENTS.md
  • .agents/advisories/litellm-2026-03.advisory
  • .agents/scripts/aidevops-update-check.sh
  • .agents/scripts/commands/security-scan.md
  • .agents/scripts/secret-hygiene-helper.sh
  • .gitignore
  • README.md
  • aidevops.sh
  • requirements.txt
  • setup-modules/agent-deploy.sh

@marcusquinn
Copy link
Copy Markdown
Owner

Dispatching worker to address CodeRabbit review feedback.

  • Model: sonnet (default round-robin)
  • Branch: feature/security-advisory-system
  • Scope: Fix CVE-2025-12695 in requirements.txt (dspy pin), document CVE-2025-69872 (diskcache), resolve merge conflict
  • Attempt: 1 of 1
  • Direction: Address the actionable CodeRabbit comment (requirements.txt CVE fix) and resolve the merge conflict with main. Nitpick comments (Python path discovery, version regex) are optional improvements.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the security posture of the aidevops framework by introducing a new secret-hygiene-helper.sh script for scanning plaintext secrets, Python .pth files (supply chain attack indicators), unpinned dependencies, and MCP server configurations. It unifies all security checks under a single aidevops security command, implements a system for delivering and managing security advisories (including a specific advisory for the LiteLLM supply chain incident), and enforces strict dependency pinning to exact versions (==) in requirements.txt to prevent supply chain attacks. Documentation across AGENTS.md, README.md, and security-scan.md has been updated to reflect these new capabilities and the rationale behind the security improvements. Security advisory files are now deployed during agent setup.

marcusquinn added a commit that referenced this pull request Mar 25, 2026
- requirements.txt: update dspy-ai and dspy from 2.6.27 to 3.1.3 to
  remediate CVE-2025-12695 (fix available in dspy>=3.0.4)
- requirements.txt: document CVE-2025-69872 (diskcache==5.6.3 unsafe
  pickle deserialization) with operational mitigations — no patched
  release exists yet; monitor for upstream fix
- secret-hygiene-helper.sh: expand Python path discovery in scan_pth_files
  to include pyenv (~/.pyenv/versions/*/bin/python3*), Linux system paths
  (/usr/bin/python3.*, /usr/lib/python3*/bin/python3*), user-local installs
  (~/.local/bin/python3*), and PATH-based discovery via 'which -a python3';
  deduplicate site-packages directories to avoid scanning the same dir twice
- secret-hygiene-helper.sh: fix unpinned dep detection to correctly handle
  bounded specs (>=1.0,<2.0 is safe) and flag compatible-release (~=) which
  allows minor/patch upgrades; avoids false positives on bounded ranges
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 511 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Mar 25 02:24:45 UTC 2026: Code review monitoring started
Wed Mar 25 02:24:46 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 511

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 511
  • VULNERABILITIES: 0

Generated on: Wed Mar 25 02:24:49 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

marcusquinn and others added 2 commits March 25, 2026 03:26
…ain hardening

- Add secret-hygiene-helper.sh: scans for plaintext secrets (AWS, GCP, Azure,
  k8s, Docker, npm, PyPI, SSH keys, .env files), Python .pth supply chain IoCs,
  unpinned dependencies, and MCP server auto-download risks. Never exposes
  secret values — only reports locations and key names. All remediation commands
  directed to separate terminal sessions, never AI chat.

- Add advisory system: .agents/advisories/*.advisory files deployed via
  setup.sh, shown in session greeting until user dismisses with
  'secret-hygiene-helper.sh dismiss <id>'. First advisory: LiteLLM PyPI
  supply chain attack (March 24, 2026).

- Pin all Python deps in requirements.txt to exact versions (==) to prevent
  supply chain attacks via malicious PyPI uploads. Previously used >= which
  would auto-upgrade to compromised versions.

- Integrate secret-hygiene startup-check and advisory display into the
  session greeting (aidevops-update-check.sh) and cache for Plan+ agents.

- Update setup.sh agent-deploy to copy advisory files to ~/.aidevops/advisories/

Context: LiteLLM v1.82.7/v1.82.8 contained credential stealers distributed
via compromised PyPI maintainer account. DSPy depends on litellm>=1.64.0
(unpinned), amplifying the attack surface. The malware used Python .pth files
which execute on every Python startup regardless of imports.
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 511 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Wed Mar 25 02:29:30 UTC 2026: Code review monitoring started
Wed Mar 25 02:29:30 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 511

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 511
  • VULNERABILITIES: 0

Generated on: Wed Mar 25 02:29:33 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@alex-solovyev
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@sonarqubecloud
Copy link
Copy Markdown

@alex-solovyev alex-solovyev dismissed coderabbitai[bot]’s stale review March 25, 2026 02:32

Actionable item addressed: dspy updated to 3.1.3 (CVE-2025-12695) in f0c47d0. Dismissing stale CHANGES_REQUESTED to unblock merge.

@marcusquinn marcusquinn merged commit d46d76f into main Mar 25, 2026
26 of 27 checks passed
@marcusquinn marcusquinn deleted the feature/security-advisory-system branch March 25, 2026 02:33
@marcusquinn
Copy link
Copy Markdown
Owner

Completed via merge at 2026-03-25T02:33:18Z.

  • Model: supervisor pulse (no worker needed — merge-only action)
  • Attempts: 1 (waited for Framework Validation CI to complete, ~6 min)
  • Duration: ~6 minutes from pulse start to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Auto-created from TODO.md tag needs-review-fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants