nvidia/fix-security-issue
Implement a fix for a reviewed security issue. Takes a directly requested issue number or scans for issues labeled `topic:security` and `agent:implementation-requested`. Reads the security review from the issue comments and implements the remediation plan. Trigger keywords - fix security issue, remediate security, implement security fix, patch vulnerability.
npx skills add https://github.com/NVIDIA/OpenShell --skill fix-security-issue
Implement a code fix for a security issue that has already been reviewed by the review-security-issue skill.
gh CLI must be authenticated (gh auth status)topic:security. In unattended scan mode it must also have agent:implementation-requested; a direct user request to fix a specific issue does not require that label.review-security-issue) with a Legitimate concern determination and a remediation planAll PR descriptions and comments posted by this skill must begin with the following marker line:
> **🔧 security-fix-agent**
This distinguishes fix-agent content from review-agent comments (🔒 security-review-agent) and human comments.
The user may provide an issue number directly, or ask the agent to find issues to fix.
Strip any leading # and proceed to Step 2 with that issue ID. The user's explicit fix request authorizes implementation; do not refuse solely because agent:implementation-requested is absent.
Scan for open issues labeled topic:security and agent:implementation-requested:
gh issue list --label "topic:security" --label "agent:implementation-requested" --state open --json number,title,labels,updatedAt
Fetch the issue details:
gh issue view <id> --json number,title,body,state,labels,author
Check the issue's labels array from the response above:
topic:security is required because this specialized skill handles security issues.agent:implementation-requested is required only when an unattended agent discovered the issue by scanning the queue.If topic:security is missing, report that this skill only handles security issues and stop. If queue mode selected an issue without agent:implementation-requested, report that it is not ready for unattended pickup and stop.
Never apply agent:implementation-requested yourself. Its absence does not block a direct user request to fix a specific issue.
Once labels are confirmed, fetch the comments to find the security review:
gh issue view <id> --json comments --jq '[.comments[] | select(.body | contains("security-review-agent"))]'
security-review-agent comment is found, report to the user that this issue has not been reviewed yet. Suggest running the review-security-issue skill first. Stop.Before writing code, analyze the remediation plan from the review comment:
If the remediation plan references files or components that no longer exist or have changed significantly, adapt the plan accordingly and note the deviations.
Create a working branch for the fix:
git checkout -b fix/security-<issue-id>-<short-description>
Follow the project's branch naming conventions. The branch name should reference the issue ID.
In queue mode, replace the human request and ready-plan labels with the agent execution state. For an unlabeled direct invocation, do not add an agent-workflow label:
gh issue edit <id> --remove-label "agent:implementation-requested" --remove-label "agent:plan-ready" --add-label "agent:in-progress"
Implement the changes described in the remediation plan. Follow these principles:
After implementing, run the project's pre-commit checks:
mise run pre-commit
Fix any issues that arise before proceeding.
Every security fix must include tests that verify the vulnerability is resolved. Choose the appropriate test level(s) based on the nature of the fix:
Add unit tests when the fix changes a specific function, method, or module in isolation. Place them alongside the existing tests for that module (e.g., same tests/ directory or #[cfg(test)] block for Rust, test_*.py for Python).
Unit tests should cover:
Add integration or end-to-end tests when the vulnerability spans multiple components or is triggered via an API endpoint, CLI command, or network boundary. Place them in the project's existing integration or e2e test directories.
Integration tests should cover:
Name tests descriptively to document the security concern:
test_rejects_sql_injection_in_search_querytest_blocks_path_traversal_in_file_uploadtest_enforces_auth_on_admin_endpointRun the full relevant test suite to confirm both the new tests pass and no existing tests regress:
# Run tests relevant to the changed components
# The specific command depends on the project area affected
If the review identified a specific exploit scenario, verify that it is no longer possible with the fix in place.
Review the documentation requirements in AGENTS.md and update any affected
docs as part of the security fix. If the fix is purely internal, such as
switching to parameterized queries with no external behavior change,
documentation updates may not be needed.
Commit all changes (implementation, tests, and documentation) using conventional commit format:
git add <files>
git commit -m "$(cat <<'EOF'
fix(security): <short description of the fix>
Closes #<issue-id>
<brief explanation of what was vulnerable and how it's fixed>
EOF
)"
git push -u origin HEAD
Create a PR that closes the security issue. Put the full fix summary in the PR description rather than commenting on the issue -- the Closes #<id> directive will auto-close the issue when merged.
gh pr create \
--title "fix(security): <short description>" \
--label "topic:security" \
--body "$(cat <<'EOF'
> **🔧 security-fix-agent**
Closes #<issue-id>
## Security Fix
### Summary
<1-3 sentences describing the security issue and how it was fixed>
### Severity Assessment
- **Impact:** <high / medium / low>
- **Exploitability:** <description of attack vector and prerequisites>
- **Affected components:** <list of affected code paths or services>
### Changes Made
- `<file1>`: <what changed and why>
- `<file2>`: <what changed and why>
### Tests Added
- **Unit:** <test file and what it covers>
- **Integration/E2E:** <test file and what it covers, or "N/A" if not applicable>
### Documentation Updated
- `<doc path>`: <what was updated, or "None needed">
### Verification
<how the fix was verified -- tests passed, exploit scenario tested, etc.>
EOF
)"
Display the PR URL so it's easily clickable:
Created PR [#<number>](https://github.com/OWNER/REPO/pull/<number>)
In queue mode, replace agent:in-progress with agent:pr-opened after the PR is created. For an unlabeled direct invocation, do not add an agent-workflow label:
gh issue edit <id> --remove-label "agent:in-progress" --add-label "agent:pr-opened"
Summarize what was done:
| Command | Description |
| --- | --- |
| gh issue list --label "topic:security" --label "agent:implementation-requested" --state open | Find security issues whose fixes a human requested |
| gh issue view <id> --json number,title,body,state,labels,author | Fetch full issue metadata |
| gh issue view <id> --json comments | Fetch all comments on an issue |
| gh pr create --title "..." --body "..." | Create a pull request |
| gh api user --jq '.login' | Get current GitHub username |
| gh issue view <id> | View issue details |
| mise run pre-commit | Run pre-commit checks |
User says: "Fix security issue #42"
security-review-agent review with determination "Legitimate concern"fix/security-42-input-sanitizationAGENTS.md, if neededCloses #42User says: "Fix any ready security issues"
topic:security + agent:implementation-requestedtest_rejects_sql_injection_in_search_query unit test and e2e test for the search endpointAGENTS.md, if neededCloses #78, report to userUser says: "Fix security issue #99"
security-review-agent review with determination "Not actionable"agent:implementation-requestedUser says: "Fix security issue #55"
["topic:security"] -- missing agent:implementation-requestedUser says: "Fix security issue #60"
topic:security is present and the user directly requested the fixsecurity-review-agent comment foundTake nvidia/fix-security-issue from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.