# SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)

> Baseline, tune, and gate SAST scanners to eliminate noise and block real security flaws in CI.

SAST Setup & Tuning (Semgrep / SonarQube / CodeQL) is a paid AI agent skill on Agensi by Mr Vempire, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $10 (one-time purchase)
- Creator: [Mr Vempire](https://www.agensi.io/creators/mr-vempire)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Version: 1.0
- Last updated: 2026-11-30
- Security: scan passed (2026-11-30); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/sast-setup-tuning-semgrep-sonarqube-codeql
- Tags: code-review, security, semgrep, sonarqube, codeql, sast

## About this skill

Security tools often flood developers with false positives, leading teams to ignore or disable scanners entirely. This skill implements a systematic process to silence the noise, baseline your codebase, and implement a CI gate that only blocks on real issues.

### What it does
- **Baseline measurement** runs a default scan to quantify noise, identify high-volume rules, and calculate findings per 1,000 lines of code.
- **Scope optimization** filters out noise by excluding test fixtures, generated code, migrations, and vendored assets from the scan path.
- **Rule curation** selects language-specific rulesets and justifies every deactivation with sampled evidence and measured false-positive rates.
- **Severity tuning** promotes high-signal rules like SQL injection to blocking status while demoting style nits to non-blocking warnings.
- **CI gate integration** configures diff-aware gating so that legacy debt does not block new pull requests.
- **Audit reporting** generates a structured gate report documenting enforcement decisions, threshold logic, and pass/fail verdicts.

### How it works
1. Run a baseline scan using Semgrep, SonarQube, or CodeQL to identify the noisiest rules and triage a sample of findings.
2. Apply exclusions for non-production code and generated files using tool-specific ignore configurations.
3. Use the provided templates to curate a ruleset, promoting high-signal rules and documenting justifications for any disabled checks.
4. Deploy a diff-aware CI workflow that gates pull requests based on new findings in changed lines only.

### Frameworks & tools
This skill supports Semgrep, SonarQube, and CodeQL. It includes configuration templates for GitHub Actions and Python scripts for processing JSON or SARIF output into markdown reports.

### Why this beats prompting it yourself
Generic prompts often result in a "turn everything on" approach that kills developer productivity with noise. This skill follows a specific measurement-first methodology that requires evidence for every rule change, ensuring your security gate is defensible and sustainable.

### Use cases
- Tuning a noisy Semgrep installation that developers are currently ignoring.
- Setting up a CodeQL security-and-quality gate for a new TypeScript project.
- Reducing SonarQube false positives in a legacy Python codebase with many test fixtures.
- Creating a standardized SAST gate report for a security compliance audit.

### Known limitations
Does not prove exploitability or replace manual code review. Requires the codebase to be in a buildable state for deep data-flow analysis tools like CodeQL.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the SAST Setup & Tuning (Semgrep / SonarQube / CodeQL) skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill help reduce the high volume of false positives in my security scans?

The skill provides a systematic framework to reduce false positives by baselining existing debt, excluding non-production code (like test fixtures), and curating rules based on actual signal-to-noise ratios.

### Which specific SAST scanners and file formats are supported?

It is compatible with Semgrep, SonarQube, and CodeQL, providing specific configuration templates and processing scripts for each tool's JSON or SARIF output.

### What technical assets are included in the purchase of this skill?

You receive specialized configuration templates for GitHub Actions, Python-based reporting scripts for SARIF data, and the structured measurement-first methodology for tuning rulesets.

### Will implementing this gate block my developers from merging due to old, existing security debt?

No, the skill implements diff-aware gating, which ensures that only new security flaws introduced in a pull request block the build, rather than flagging legacy code.

### What are the technical requirements for running the tuning scripts and CI gates?

The skill is designed to run within modern CI/CD environments like GitHub Actions and works alongside AI agents capable of executing Python scripts or managing YAML configurations.

### Does this skill replace the need for manual security code reviews?

While the skill automates noise reduction and reporting, it does not replace manual code review or prove exploitability; it focuses on making automated scanners defensible and productive.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
