Skip to content

feat: add skill scan results audit trail#406

Merged
marcusquinn merged 3 commits intomainfrom
chore/skill-scan-results
Feb 6, 2026
Merged

feat: add skill scan results audit trail#406
marcusquinn merged 3 commits intomainfrom
chore/skill-scan-results

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 6, 2026

Summary

  • Add .agents/SKILL-SCAN-RESULTS.md with initial Cisco Skill Scanner results (116 skills scanned, 115 safe, 1 false positive in credentials SKILL.md)
  • Update security-helper.sh to automatically log batch scan results to the audit trail after skill-scan all
  • Update add-skill-helper.sh to log per-skill import scan results (safe, blocked, override paths)
  • Update skill-scanner.md docs to reference the new results log

Details

The scan results file provides transparency into security scanning:

  • Latest Full Scan section with summary stats (updated in-place on each batch scan)
  • Scan History table with append-only rows for audit trail
  • Both batch scans (security-helper.sh skill-scan all) and individual imports (add-skill-helper.sh add) append results

The initial scan found 1 CRITICAL false positive: the YARA rule coercive_injection_generic flagged "List all API keys" in the credentials SKILL.md as a data exfiltration pattern. This is a legitimate tool description, not an injection.

Quality

  • ShellCheck: zero violations on modified files
  • All changes are additive (no breaking changes)
  • Logging is non-blocking (silently skips if results file doesn't exist)

Summary by CodeRabbit

  • Chores

    • Security scan results are now automatically recorded to a centralized results log so each scan produces an auditable summary and history.
    • Per-skill and aggregate scan metrics (skills scanned, safe counts, CRITICAL/HIGH/MEDIUM findings) are captured across all scan paths and overrides.
  • Documentation

    • Update-time scanning docs now describe the results log and how scan summaries and history are maintained.

Add .agents/SKILL-SCAN-RESULTS.md with initial scan results (116 skills,
115 safe, 1 false positive). Update security-helper.sh and add-skill-helper.sh
to automatically append scan results on batch scans and skill imports.
Update skill-scanner.md docs to reference the new results log.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 59 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

Adds persistent security scan result logging: a repository Markdown log is created and shell scripts (.agents/scripts/*) now record per-skill and aggregate scan outcomes and metrics to that file; documentation is updated to describe the automatic results log.

Changes

Cohort / File(s) Summary
Scan Results Log File
.agents/SKILL-SCAN-RESULTS.md
New results file added containing latest full-scan summary, findings table, notes, and a history log of past scans.
Documentation
.agents/tools/code-review/skill-scanner.md
Adds "Results log" section describing automatic appending of scan summaries to the results file by scanning scripts.
Per-skill Import Helper
.agents/scripts/add-skill-helper.sh
Adds SCAN_RESULTS_FILE, new log_skill_scan_result() routine, and hooks to record SAFE/BLOCKED/override outcomes and MEDIUM/HIGH/CRITICAL counts for per-import flows.
Batch Scanner / Security Helper
.agents/scripts/security-helper.sh
Adds SCAN_RESULTS_FILE constant and update_scan_results_log(...) to append aggregate scan metrics and history rows; tracks CRITICAL/HIGH/MEDIUM and safe counts. Note: duplicate update_scan_results_log definition present and needs review.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant CLI as Add-skill / Scanner CLI
  participant Helper as security-helper.sh / add-skill-helper.sh
  participant Repo as .agents/SKILL-SCAN-RESULTS.md
  participant Analyzer as Skill Analyzer

  CLI->>Analyzer: run skill scan (per-skill or batch)
  Analyzer-->>Helper: return findings (CRITICAL/HIGH/MEDIUM/INFO)
  Helper->>Helper: compute counts, determine outcome (SAFE/BLOCKED/override)
  Helper->>Repo: append entry / update history row with timestamp and metrics
  Helper-->>CLI: continue flow (allow/import or block) 
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

Scans write their tales upon the page,
Each finding, timestamp, gentle sage,
From helper script to log's embrace,
History keeps the security trace,
DevOps notes the steady pace.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add skill scan results audit trail' directly and clearly summarizes the main change—introducing an audit trail for skill scan results across multiple scripts and documentation.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/skill-scan-results

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

Summary of Changes

Hello @marcusquinn, 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 introduces a robust audit trail for skill security scanning, significantly improving transparency and traceability of security assessments. By automating the logging of both batch and individual skill import scan results into a dedicated Markdown file, it provides a clear, human-readable record of findings, including false positives and user overrides. This enhancement ensures that security posture changes are consistently documented and easily reviewable, without impacting existing functionality.

Highlights

  • Audit Trail for Skill Scan Results: A new Markdown file, .agents/SKILL-SCAN-RESULTS.md, has been introduced to provide a transparent and auditable log of all skill security scan results. This file includes a summary of the latest full scan and an append-only history table.
  • Automated Batch Scan Logging: The security-helper.sh script has been updated to automatically log the results of batch skill scans (e.g., skill-scan all) to the new audit trail file, including overall statistics and severity counts.
  • Per-Skill Import Scan Logging: The add-skill-helper.sh script now logs the outcomes of individual skill import security scans (safe, blocked, or user-overridden) to the audit trail, enhancing visibility into each skill's security posture upon import.
  • Documentation Update: The skill-scanner.md documentation has been updated to reference the new scan results log, guiding users to the location of the audit trail.
  • Initial Scan Findings: The initial scan results included in the new audit file highlight a critical false positive where a YARA rule incorrectly flagged a legitimate tool description as a data exfiltration pattern.
Changelog
  • .agents/SKILL-SCAN-RESULTS.md
    • Added a new file to serve as a centralized audit trail for skill security scan results.
    • Includes sections for 'Latest Full Scan' (summary statistics) and 'Scan History' (append-only table).
    • Populated with initial scan data, noting a critical false positive in the 'credentials' skill.
  • .agents/scripts/add-skill-helper.sh
    • Added SCAN_RESULTS_FILE variable to reference the new audit trail file.
    • Integrated calls to a new log_skill_scan_result function within scan_skill_security to record outcomes for safe scans, scans with critical/high findings (skipped or user-overridden), and blocked imports.
    • Implemented the log_skill_scan_result function to format and append individual skill scan results to SKILL-SCAN-RESULTS.md.
  • .agents/scripts/security-helper.sh
    • Added SCAN_RESULTS_FILE variable.
    • Introduced a new update_scan_results_log function to manage updates to the 'Latest Full Scan' section and append entries to the 'Scan History' table in SKILL-SCAN-RESULTS.md.
    • Modified cmd_skill_scan to track total critical, high, and medium findings during batch scans.
    • Added a call to update_scan_results_log at the end of cmd_skill_scan to log comprehensive batch scan results.
  • .agents/tools/code-review/skill-scanner.md
    • Added a new 'Results log' subsection under 'Security Scanning'.
    • Provided details on the purpose and location of the .agents/SKILL-SCAN-RESULTS.md file and how it is updated by scan operations.
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for this pull request.
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 23:30:12 UTC 2026: Code review monitoring started
Fri Feb 6 23:30:13 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 23:30:13 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 23:30:15 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 23:30:18 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@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 introduces an audit trail for skill security scans, which is a great addition for transparency and security monitoring. The changes involve creating a markdown file for the log, and updating helper scripts to populate it after both batch scans and individual skill imports.

My review found a couple of issues:

  • A high-severity bug in add-skill-helper.sh that would lead to incorrect data being logged in the audit trail.
  • A medium-severity portability issue in security-helper.sh related to the use of sed, which would cause silent failures on Linux systems.

I've provided suggestions to fix both issues. Once these are addressed, the changes will be in good shape.

Copy link
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: 2

🤖 Fix all issues with AI agents
In @.agents/scripts/security-helper.sh:
- Around line 377-415: The update_scan_results_log function uses macOS-only
in-place sed flags (sed -i '' ...) which will fail on GNU sed and is masked by
|| true; replace the in-place sed calls (the three sed lines that update Date,
Skills scanned, and Safe) with a portable approach such as writing sed output to
a temp file and atomically moving it back (e.g., run sed "s/.../.../"
"$results_file" > "$results_file.tmp" && mv "$results_file.tmp" "$results_file")
or detect GNU vs BSD sed and set the correct -i flag accordingly; ensure all
three substitutions use the same portable method and preserve exit status so
failures are not silently ignored.

In @.agents/SKILL-SCAN-RESULTS.md:
- Around line 14-20: The severity table in SKILL-SCAN-RESULTS.md isn't updated
by the update_scan_results_log() function in security-helper.sh, so add logic in
update_scan_results_log() to compute the latest counts and perform targeted
replacements for the five severity rows ("Critical", "High", "Medium", "Low",
"Info"); specifically, after computing the counts use sed (or awk/perl) to
replace the lines matching the table rows (e.g. the lines starting with "|
Critical |", etc.) with the new counts, ensuring the replacements target only
those rows so the rest of the file is untouched; alternatively, if you prefer
not to change the file, add a clear note in SKILL-SCAN-RESULTS.md that the
summary table is only accurate for the initial scan and the history table is the
source of truth.
🧹 Nitpick comments (3)
.agents/scripts/security-helper.sh (1)

515-522: Severity counting via jq is correct but could yield unexpected arithmetic on parse failure.

If jq fails or returns empty (e.g., malformed scanner output), the $(...) falls back to "0" via || echo "0", which is good. However, if jq outputs a non-numeric string (unlikely but defensive), the arithmetic on lines 520-522 would error under set -e.

This is a minor edge case given the || echo "0" fallback, but worth noting for the zero-tech-debt standard.

.agents/scripts/add-skill-helper.sh (2)

30-30: Consider making SCAN_RESULTS_FILE readonly for consistency with security-helper.sh.

In security-helper.sh (line 15), this is declared readonly. Here it's a plain variable. Minor inconsistency.

♻️ Suggested fix
-SCAN_RESULTS_FILE=".agents/SKILL-SCAN-RESULTS.md"
+readonly SCAN_RESULTS_FILE=".agents/SKILL-SCAN-RESULTS.md"

586-621: log_skill_scan_result is well-designed — non-blocking, graceful, and correctly gated.

The early return when repo_root is empty or the results file doesn't exist ensures this never disrupts the main import flow. Clean implementation.

One note: the severity-to-column mapping (lines 607-615) attributes all findings to the max severity column. This is an approximation — a skill with 3 CRITICAL + 2 HIGH findings would log critical=5, high=0. Since scan_skill_security doesn't pass per-severity breakdowns, this is an acceptable simplification for per-import logging, but worth a brief inline comment for future maintainers.

📝 Optional: add clarifying comment
+    # Approximate: attributes all findings to the max severity column
+    # (per-severity breakdown not available in single-skill import context)
     if [[ "$max_severity" == "CRITICAL" ]]; then
         critical="$findings"

Address review feedback: pass critical/high/medium counts separately
instead of attributing total findings to the max severity level.
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 23:34:40 UTC 2026: Code review monitoring started
Fri Feb 6 23:34:40 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 23:34:40 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 23:34:42 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 23:34:45 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.agents/scripts/add-skill-helper.sh (1)

560-564: ⚠️ Potential issue | 🟡 Minor

Missing audit log entry for non-interactive blocked imports.

Every other CRITICAL/HIGH exit path (skip-security at Line 543, user override at Line 570, user cancel at Line 575) logs via log_skill_scan_result, but the non-interactive block silently returns 1 without recording the event. This leaves a gap in the audit trail for the exact scenario most likely to be debugged later (CI/pipeline blocks).

Proposed fix
         # In non-interactive mode (piped), block by default
         if [[ ! -t 0 ]]; then
             log_error "Import blocked due to security findings (use --skip-security to override)"
+            log_skill_scan_result "$skill_name" "import BLOCKED (non-interactive)" "$critical_count" "$high_count" "$medium_count" "$max_severity"
             return 1
         fi

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 23:36:55 UTC 2026: Code review monitoring started
Fri Feb 6 23:36:55 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 23:36:55 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 23:36:57 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 23:37:00 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

marcusquinn added a commit that referenced this pull request Feb 7, 2026
…on failure/block (t147.5, t150)

On task failure or block, the supervisor now auto-creates a diagnostic
subtask (e.g., t001.diag) that investigates the root cause. When the
diagnostic task completes, the parent task is re-queued with fresh retries.

Self-healing features:
- is_self_heal_eligible(): checks task type, heal attempts, failure type
- create_diagnostic_subtask(): creates diag task with failure context
- check_diagnostic_completions(): re-queues parents after diag success
- attempt_self_healing(): scans for healable tasks during pulse
- cmd_self_heal: manual trigger for specific task or batch

Eligibility rules prevent infinite loops:
- Diagnostic tasks cannot self-heal (no recursion)
- Max 1 heal attempt per task (configurable via SUPERVISOR_MAX_HEAL_ATTEMPTS)
- auth_error, out_of_memory, merge_conflict require human intervention

DB schema: adds parent_task_id, is_diagnostic, heal_attempts columns
with automatic migration for existing databases.

Also triages PR #406 review threads (t147.5): all 3 threads already
fixed in prior PRs. Replied with evidence on each thread.
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.

1 participant