本文へスキップ
Skillpedia
セキュリティ6.5k · #13900

patcher-overview

できること

このスキルは、確認済みのセキュリティ問題を最小限のコード変更で修正し、そのうえで再チェックを行うエージェントを導きます。Decepticonのセキュリティパイプラインの開発者向けです。

使う場面

  • ✓セキュリティスキャナーが確認したバグに、小さく的を絞った修正が必要なとき。
  • ✓提案された修正を、完了とする前にもう一度テストしたいとき。
  • ✓修正がリグレッションを起こし、取り消して再試行する必要があるとき。

スキルのリンク

https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/plugins/patcher/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“検索ページでSQLインジェクションを確認しました。最も小さい修正を書いて、それが機能するかを確認してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは各バグの周辺のコードを読み、安全な方法を使う最小限の変更を提案します。その変更を適用し、概念実証とテストを再実行してから受け入れます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Patcher Skill

You fix validated findings and prove the fix holds. Minimal diffs, one concern at a time, mandatory patch_verify before claiming done.

Iteration loop

while not patched and attempts < 3:
    1. kg_query(kind="vulnerability", min_severity="medium")
       → pick validated=True, patched!=True
    2. Read the function around (file, line)
    3. Design minimal fix (validate / escape / parameterize / safe API)
    4. patch_propose(vuln_id, diff, commit_message) → patch_id
    5. Apply diff via Edit or bash patch
    6. (optional) bash: run repo tests, abort on failure
    7. patch_verify(patch_id, poc_command, success_patterns,
                    test_cmd=optional)
    8. if status == "verified": done
       elif status == "tests_failed": revert, retry
       elif status == "regressed": revert, analyze, retry
    attempts += 1

Diff style

  • Unified diff. Use git diff --no-color output or write one by hand.
  • Minimal hunk. One concern. No formatting. No renames. No "while I'm here" cleanups. No new files (unless adding one regression test).
  • Safe-API preference.
Bug class Preferred fix
SQL injection Parameterized query / ORM.filter(), NOT escaping
Command injection Arg-list subprocess, shell=False
Path traversal os.path.realpath + prefix check
SSRF Allowlist + resolve → check not private/loopback
Deserialization Switch to safe loader (yaml.safe_load, JSON, etc.)
Broken auth Move check to pre-hook, not inside handler
Reflected XSS Framework auto-escape, remove Markup/safe
  • Add a regression test in the same diff when the repo has a test directory for the affected module. One test that exercises the fixed path is sufficient.

Commit message format

Conventional commits. Example:

fix(auth): use constant-time comparison in verify_hmac

Prevents timing side-channel recovery of the HMAC. CWE-208.

Decisive-completion rule

Only report "patched" after patch_verify.status == "verified". A green test suite is NOT sufficient — the PoC must actually fail.

If all 3 attempts fail, STOP on the finding, record a note via kg_add_node on the vuln (patch_attempts=3, last_failure=...) and return to the orchestrator. Do not spiral.

よくある質問

ファイル全体を書き換えますか?

いいえ。一度に一つの懸念事項に対して作業し、無関係な整理はせず、変更は最小限にします。

SQLインジェクションに推奨される修正は何ですか?

入力を手作業でエスケープするのではなく、パラメータ化されたクエリやORMのフィルターを使います。

テストが失敗したらどうなりますか?

エージェントは変更を元に戻し、結果を分析して、最大三回まで再試行します。

詳細

作者による元の説明

Stage 4 patch generation playbook. Minimal diffs for validated findings with mandatory patch_verify. Load at patcher-agent startup.

repo: BitterSecurity/Decepticon

人気

GitHubのスター
6.5k
ランキング
#13900
ライセンス
Apache-2.0
更新日
2026/11/1

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル