PRGuard

PRGuard vs Semgrep

Patterns Require Configuration.
PRGuard Requires a Sentence.

Semgrep deserves real credit: it made custom static rules something you write in minutes, not an engineering project.

The difference with PRGuard isn’t effort — it’s expressiveness. A Semgrep rule is still a pattern that matches code shapes, per language.

A PRGuard rule is a sentence about what the code should mean, judged by an LLM against every change.

Semgrep

Fast, deterministic patterns you write per language.

PRGuard

Plain-language standards judged semantically — one rule, every language.

The verdict

Patterns for precision, sentences for meaning — a strong pair.

Where Each One Earns Its Place.

What Semgrep is built for

Fast, precise pattern enforcement.

  • Custom rules in readable YAML, written in minutes — syntax-aware matching that understands code structure, not just text
  • Deterministic and fast enough to run in CI on every commit, with a large public rule registry to start from
  • An open-source engine you can run locally, with commercial tiers adding deeper analysis like cross-file taint tracking
  • The natural home for rules that are genuinely patterns: banned APIs, dangerous function calls, framework misuse
  • In its commercial platform, Semgrep Assistant adds AI triage and the Multimodal engine hunts complex security flaws

What PRGuard is built for

Standards a pattern can’t hold.

  • Rules written as plain-language sentences, judged semantically — one rule covers every language you ship, no per-language variants
  • Rules anyone can write — product, compliance, and QA define standards without learning a rule syntax, and each sentence doubles as a readable policy when audit season comes
  • The AI is included — no LLM API key to bring, no separate token bill, and a prompt-injection screen in front of every audit
  • Findings first, fixes on request — approve an AI fix and PRGuard commits it onto your PR’s own branch, or opens a fix PR when a push has none, with an audit trail from first flag to the re-audit that closes it
  • Every fix must clear a quality gate — and when the everyday model can’t, PRGuard can automatically escalate to a stronger reasoning model, so premium AI is spent only on the fixes that need it

The Same Rule, Both Ways.

Take two standards most teams actually have:

“Payment webhook handlers must be idempotent” and “Never log plain-text credit card numbers.”

One is architecture, one is compliance — both are intent, not syntax.

idempotent-webhook.yaml Semgrep
rules:
  - id: idempotent-webhook
    languages: [python]
    pattern: |
      def $HANDLER(request):
        ...
        $DB.create(...)
    # matches only the code shapes you
    # thought to write down, in Python
    message: handler may not be idempotent
    severity: WARNING
Precise on the shape you anticipated — silent on the handler written a way you didn’t. A new rule for every language you ship.
Context Studio · payments.md PRGuard

Payment webhook handlers must be idempotent.

Judged by meaning, not shape — even in code it has never seen. One rule, every language.

The honest trade-off: Semgrep’s pattern fires identically every run; PRGuard’s judgment is an LLM’s, which is why a human approves every fix before it lands. Patterns for precision, sentences for meaning.

Caught Without a Pattern.

No pattern to write, no per-language variants. Here is PRGuard enforcing that one sentence on a pull request — recognising a non-idempotent handler by what the code means, and explaining the consequence in plain language.

non-idempotent-handler

Payments

Details

billing/webhooks.py:14

A retried webhook charges the customer twice. Stripe redelivers events after timeouts, and nothing here records what has already been processed.

Non-idempotent payment handler: in handle_webhook(), the charge is written at line 14 without checking ProcessedEvent. Because event.id is never recorded, a redelivered event re-executes the whole charge path — violating your rule that payment webhook handlers must be idempotent.

Copy
Replace the direct charge write in handle_webhook() with a guard: ProcessedEvent.objects.get_or_create(stripe_id=event.id), returning early when the event was already processed.

View rule: payments.md

Unassigned Assign

Illustrative example. Findings are advisory by default — a person approves every fix before it lands.

Side by Side.

Semgrep PRGuard
Rules come from Patterns authored in YAML, per language, from your own rules or the public registry Plain-language context files your whole team writes
Analysis Deterministic pattern matching at the core; AI-assisted detection in its commercial platform LLM reasoning over the diff plus your rules — semantic judgment, human-approved before anything lands
Custom standards Fast to write for patterns — but still patterns, per language, and Semgrep’s AI features don’t extend to your custom rules Write a sentence once — it applies across every language
Typical catches Banned APIs, dangerous calls, taint flows, known misuse patterns A non-idempotent handler, personal data in a log line, a violated architecture decision, a broken money-handling convention
AI cost Core matching is static, so it spends no tokens; AI features vary by tier AI is the engine, and it’s included — no API key, no separate token bill
Fixes Rule-defined autofix; AI-drafted fixes arriving in its commercial platform Findings always; fixes on request — approve an AI fix and PRGuard commits it onto your PR’s branch (or opens a fix PR), then re-audits to close the finding
Price Free open-source CLI; commercial tiers for deeper analysis, and your own hosting or their cloud $10 trial, then flat plans with a metered AI credit allowance included

Comparison last reviewed July 2026. Semgrep ships continuously, so its capabilities may have changed since — if anything here is out of date, tell us and we’ll fix it.

Fair question

“But doesn’t Semgrep have AI now?”

It does, and it has moved well past triage. Semgrep Assistant auto-triages findings and drafts fixes, and the newer Multimodal detection pairs AI reasoning with its rules to catch complex security flaws. For vulnerability hunting, that’s genuine capability.

The nuance is whose rules the AI serves: by Semgrep’s own documentation, those AI features run on Semgrep’s detections — they aren’t available for the custom rules you write, which remain per-language patterns.

PRGuard starts from the other end: the rule is your sentence — your architecture, compliance, and business standards — judged semantically on every change.

Semgrep’s AI hunts known classes of vulnerability; PRGuard’s AI enforces the standards your team wrote.

A Strong Pair.

If a standard is genuinely a pattern — a banned API, a dangerous call — Semgrep is the right tool and always will be.

PRGuard picks up where patterns stop: the intent-level standards your team debates in review, written once in plain language and enforced on every PR and push, with the AI included in the price.

Before You Decide.

Do I need to drop Semgrep to use PRGuard?

No — they pair well.

Keep Semgrep for rules that genuinely are patterns: banned APIs, dangerous calls, framework misuse.

Add PRGuard for the intent-level standards a pattern can’t express, checked on every pull request and push.

How is a PRGuard rule different from a Semgrep rule?

A Semgrep rule is a pattern that matches code shapes, written per language.

A PRGuard rule is a plain-language sentence judged semantically — so one rule covers every language, and it recognises violations in code shaped nothing like anything it has seen.

Is my private code used to train the AI?

No — not by PRGuard. We don’t build or train models of our own, and we never use your code or governance rules to train anything.

Your data stays scoped to your organisation, and diffs are processed in memory for the audit — never written to our database.

The audit runs through the major AI providers’ commercial APIs, whose current terms exclude data submitted this way from training their models, and we choose those channels deliberately for that reason. Those providers are third parties under their own terms, which are outside our control, so our privacy policy spells out exactly what is sent and to whom.

The AI credits are included.

AI usage is part of your subscription, not a bill on the side. Every plan includes a set monthly AI credit allowance, and each audit draws from it — no separate API key to bring, no separate token invoice. And if a busy month needs more, top-up credits are available anytime and roll over.

Start Governing Your Code Today.

Set up in under 5 minutes.