Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Semgrep Custom Rule Engine

    1

    Generate high-precision Semgrep YAML rules for proprietary security patterns and architectural enforcement.

    $15

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Semgrep Custom Rule Engine

    Semgrep Custom Rule Engine

    Example session with this skill installed

    Create a Semgrep rule to detect and fix instances where developers use the insecure InternalLogger.logRaw() instead of InternalLogger.logSanitized(). It should ignore the tests/ directory.

    • Read your context and instructions
    • Compiled the semgrep custom rule

    I have generated a custom Semgrep rule to enforce the use of sanitized logging across your project. This includes detection logic, a target fix, and a command for local verification.

    Semgrep Custom Rule: enforce-sanitized-logging

    rules:
      - id: enforce-sanitized-logging
        patterns:
          - pattern: InternalLogger.logRaw($MSG)
          - pattern-not-inside: |
              void test_...(...) {
                ...
              }
        message: |
          Insecure logging detected. Use 'InternalLogger.logSanitized()' to prevent 
          log injection and ensure compliance with internal security standards.
        metadata:
          category: security
          severity: ERROR
          technology:
            - java
            - python
            - javascript
        fix: InternalLogger.logSanitized($MSG)
        languages:
          - generic
    

    Testing Command
    Run this command in your terminal to verify the rule against your codebase:

    semgrep --config enforce-sanitized-logging.yaml . --exclude='tests/'
    

    Next steps

    1. Save the YAML block above to a file named semgrep/rules/internal-logging.yaml.
    2. Run the provided testing command to audit existing violations.
    3. Integrate this rule into your CI/CD pipeline to block PRs containing logRaw calls.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Static analysis often misses proprietary patterns and internal API misuse specific to your codebase. This skill generates precise, high-fidelity Semgrep YAML rules to enforce architectural standards and security constraints unique to your organization.

    What it does

    • Rule Construction: Writes YAML definitions using pattern, pattern-inside, and metavariable-regex.
    • Anti-pattern Analysis: Converts your specific code examples into generalized detection logic.
    • Autofix Logic: Formulates automated transformation blocks to bridge the gap between detection and remediation.
    • Severity Mapping: Assigns appropriate metadata and severity classifications based on organizational impact.
    • Validation Commands: Provides exact CLI strings for local testing via ephemeral execution.

    How it works

    1. Input Analysis: You provide a code snippet containing a security flaw or an architectural anti-pattern.
    2. Logic Synthesis: The agent maps these inputs to Semgrep's search syntax, filtering out noise with pattern-not clauses.
    3. Remediation Design: It generates an autofix block to suggest safe code replacements.
    4. Verification: The agent outputs a complete YAML file along with a shell command to test the rule against your workspace.

    Frameworks & tools

    Built for the Semgrep CLI and compatible with polyglot codebases. It uses standard YAML schemas for SAST integration.

    Why this beats prompting it yourself

    Writing Semgrep rules requires deep knowledge of its domain-specific syntax and metavariable logic. This skill avoids the trial-and-error of broken YAML indentation or overly broad patterns that cause developer alert fatigue.

    Use cases

    • Internal API Security: Prevent developers from calling deprecated or dangerous internal functions.
    • Compliance Enforcement: Ensure specific headers or encryption standards are used in every controller.
    • Architecture Guardrails: Block circular dependencies or incorrect service layer abstractions.

    Known limitations

    Restricted to standard Semgrep YAML syntax. It does not perform cross-file taint analysis if the local Semgrep engine version does not support it.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.

    Restricted to standard Semgrep YAML syntax and workspace-confined analysis. Cannot access system paths or global packages.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 4 days ago

    Software
    Zero global installation
    orelevated privileges required.

    File System Read/Write (strictly scoped to current project workspace `./`).

    Permissions

    Read Files

    Target Use Cases: - Create a custom Semgrep rule to catch unvalidated user input. - Write a Semgrep YAML definition to ban raw SQL queries. - Build a company-specific security rule for Semgrep.

    Listed4 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the creation of complex Semgrep YAML rules, handling difficult syntax like metavariable-regex and autofix blocks that are often prone to errors when written manually. It specifically helps security teams enforce internal coding standards that generic, off-the-shelf security rules miss.

    The skill is designed to work with any AI agent platform that supports text-based reasoning and code generation. It outputs standard YAML files compatible with the Semgrep CLI, Semgrep App, and CI/CD pipelines.

    No complex installation is required; once added to your agent, you simply provide a code sample of the pattern you want to detect. The output is a ready-to-use .yaml file that can be executed immediately via the provided CLI commands.

    You receive the core logic for the rule generator, pre-configured to understand Semgrep's latest syntax and best practices. It also includes templates for common security metadata and automated remediation logic.

    Yes, the skill is 'polyglot-aware' and can generate rules for any language Semgrep supports, including Python, Javascript, Go, Java, and C#. It adapts the pattern syntax to match the specific linguistic structures of your provided code snippets.

    While the skill excels at complex single-file patterns and data flow within a function, it is limited by the underlying Semgrep engine's capabilities regarding cross-file inter-procedural analysis. It focuses on high-precision, localized patterns that minimize false positives.

    New in Security