semgrep-rule-creator

Create and validate Semgrep rules with test-driven development.

Updated Feb 16, 2026
One-click install
npx skills add https://github.com/rbkayz/gitskills --skill semgrep-rule-creator-rbkayz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/rbkayz/gitskills/tree/main/skills/registry/trailofbits-semgrep-rule-creator
Command: npx skills add https://github.com/rbkayz/gitskills --skill semgrep-rule-creator-rbkayz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation and rigorous testing of Semgrep rules, ensuring they accurately detect security vulnerabilities and code patterns without false positives.

Core Features & Use Cases

  • Rule Authoring: Guides users through writing Semgrep rules for specific bug patterns, security vulnerabilities, and coding standards.
  • Test-Driven Development: Enforces a test-first approach, requiring comprehensive test cases for both vulnerable and safe code snippets.
  • Taint Mode Prioritization: Encourages the use of taint mode for precise data flow analysis, reducing false positives in injection vulnerability detection.
  • Use Case: Develop a new Semgrep rule to detect instances where user input is directly passed to a dangerous function like eval() in Python, ensuring that only malicious usage triggers an alert.

Quick Start

Use the semgrep-rule-creator skill to write a new Semgrep rule for detecting insecure deserialization in Python.

Frequently Asked Questions about semgrep-rule-creator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create custom Semgrep rules for security vulnerabilities?

To create custom Semgrep rules, you define patterns or taint mode configurations that match insecure code data flows. This process requires writing rule definitions and validating them against test cases to ensure they accurately detect vulnerabilities.

How does taint mode analysis in Semgrep reduce false positives?

Taint mode analysis tracks the flow of untrusted user input through the codebase to dangerous sinks. By prioritizing data flow tracking over simple pattern matching, it significantly reduces false positives when detecting injection vulnerabilities.

How do I test Semgrep rules to ensure they do not trigger false positives?

Testing Semgrep rules requires a test-driven approach where you provide both vulnerable and safe code snippets. Validating the rule against these comprehensive test cases ensures it alerts on malicious patterns while ignoring secure code.

Can I use Semgrep rules for both vulnerability detection and code quality issues?

Yes, you can author Semgrep rules for both vulnerability detection and code quality issues. The rule creation process supports identifying specific bug patterns, security flaws, and coding standards violations across your codebase.

What is the best way to write a Semgrep rule for detecting insecure deserialization in Python?

The best way to detect insecure deserialization in Python is to author a Semgrep rule using taint mode. This tracks untrusted input flowing into dangerous deserialization functions and validates the detection logic with secure and vulnerable test snippets.