semgrep-rule-creator

Automate creation of custom Semgrep rules with test-first methodology.

1|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/Ramprasad4121/srp --skill semgrep-rule-creator-ramprasad4121
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: semgrep-rule-creator
Source: https://github.com/Ramprasad4121/srp/tree/main/skills-repos/trailofbits/plugins/semgrep-rule-creator/skills/semgrep-rule-creator
Command: npx skills add https://github.com/Ramprasad4121/srp --skill semgrep-rule-creator-ramprasad4121

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation of custom Semgrep rules, ensuring they are accurate, well-tested, and effective for detecting security vulnerabilities and code patterns.

Core Features & Use Cases

  • Guided Rule Creation: Follows a structured workflow from problem analysis to rule optimization.
  • Test-Driven Development: Emphasizes writing tests first to catch false positives and negatives early.
  • Taint Mode Prioritization: Guides users on leveraging taint mode for robust data flow analysis.
  • Use Case: You need to create a new Semgrep rule to detect instances where user input is directly passed to a dangerous function like eval() in Python. This Skill will guide you through writing the rule, creating test cases for both vulnerable and safe scenarios, and ensuring the rule is optimized.

Quick Start

Use the semgrep-rule-creator skill to generate 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 vulnerability detection?

Creating custom Semgrep rules for security vulnerability detection is automated through a structured workflow that guides you from problem analysis to rule optimization. The process emphasizes a test-first methodology to ensure accurate static analysis detections.

What is taint mode in static analysis and when should I use it for code pattern matching?

Taint mode in static analysis tracks data flow from sources to sinks to identify vulnerabilities. You should use taint mode when creating Semgrep rules to detect patterns where untrusted user input reaches dangerous functions, ensuring robust data flow analysis.

How do I write test cases for Semgrep rules to prevent false positives?

Writing test cases for Semgrep rules to prevent false positives requires a test-driven development approach. You create both vulnerable and safe scenario test cases early in the rule creation process to validate static analysis accuracy and iteratively refine detections.

Can I use Semgrep to detect insecure deserialization in Python code?

Yes, you can use Semgrep to detect insecure deserialization in Python code by generating custom rules. The rule creation process supports identifying specific security vulnerabilities and code patterns in Python through guided static analysis and iterative refinement.

What is the best way to detect user input passed to dangerous functions like eval in Python?

The best way to detect user input passed to dangerous functions like eval in Python is using Semgrep taint mode rules. This approach tracks data flow from user input sources to dangerous sinks, producing production-quality static analysis detections.

Does Semgrep rule creation support iterative refinement for complex vulnerability detection?

Semgrep rule creation supports iterative refinement and optimization for complex vulnerability detection. The guided workflow allows you to continuously test and refine static analysis rules against both vulnerable and safe code scenarios to achieve production quality.