---
name: security-audit-rlm-0740abcafe2a
description: Run and troubleshoot privacy-preserving, local DSPy RLM security audits for large legacy .NET codebases. Use when asked to scan repositories for vulnerabilities, tune RLM/tool limits, fix truncation/stall issues, or produce actionable markdown/json audit outputs without loading entire codebases into model context.
---

# Security Audit RLM

Use this skill to operate `audit.py` as a tool-driven RLM workflow for large repositories.

Repository: `https://github.com/mitkox/megacode`

## Execute

1. Verify prerequisites:
   - `deno --version`
   - model endpoint is reachable (default `http://localhost:8000/v1`)
2. Run a baseline audit:
   - `AUDIT_VERBOSE=1 python audit.py --source-root <repo-path>`
3. Confirm outputs:
   - `security_audit_report.md`
   - `security_audit_metadata.json`
   - `security_audit_manifest.jsonl`

## Tune For Large Legacy Repos

- Lower planner churn:
  - `--max-iterations 8..12`
  - `--rlm-max-llm-calls 60..100`
- Bound REPL noise:
  - `--rlm-max-output-chars 15000..30000`
- Bound tool payloads:
  - `--tool-max-lines 200..400`
  - `--tool-max-chars 20000..40000`
  - `--search-max-files 800..2000`
  - `--search-max-matches 200..600`
- Control runtime:
  - `--timeout-seconds 600..1800`
  - `--retries 1..2`

## Operating Rules

- Keep analysis local when privacy constraints require it.
- Use RLM tool access, not full-context repository injection.
- Keep intermediate output concise and deterministic.
- Prioritize high-severity findings with file/line evidence and concrete fixes.

## Troubleshooting

- If run appears stalled:
  - enable verbose mode
  - reduce `--max-iterations`
  - reduce `--rlm-max-output-chars`
- If model truncates:
  - raise `--lm-max-tokens` if backend supports it
  - reduce tool output and iteration count
- If path/file access errors appear in RLM steps:
  - ensure tool-only repository access is used by the audit flow
  - re-run after confirming current `audit.py` includes `list_manifest/read_file/search_pattern` tools

## Deliverable Format

Ensure report sections remain:

1. Executive Summary
2. Critical Findings (CRITICAL/HIGH)
3. Other Findings (MEDIUM/LOW)
4. Remediation


---
Source attribution: mitkox
Original project: https://github.com/mitkox/megacode/blob/41d1ce2259c1cab03e6a050d716ca8b04b47d156/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Security Audit Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: mitkox
Original project: https://github.com/mitkox/megacode/blob/41d1ce2259c1cab03e6a050d716ca8b04b47d156/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering
Roles: Backend Developer, DevOps / SRE, Security Engineer
Specialties: Backend
Tools: GitHub
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: debf172e5283f0ef57259bc3d85533ee32038b85b3ebcfc651e16abae1a5b269
