- Home
- Skills
- Code Quality & Review
- SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)
SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)
by Mr Vempire
Baseline, tune, and gate SAST scanners to eliminate noise and block real security flaws in CI.
$10
SAST Setup & Tuning (Semgrep / SonarQube / CodeQL)
Example session with this skill installed
Baseline our Python repo with Semgrep. It is currently throwing 400 findings, mostly in the migrations and tests folders. We need a tuned config and a gate report.
- Read your context and instructions
- Compiled the sast setup
I have completed the baseline scan and tuning for the Python repository. I identified that 65% of the findings were located in migrations/ and tests/, which have now been excluded. After triaging a sample of 30 findings, I disabled 3 high-noise rules with false-positive rates above 80% and promoted SQL injection checks to blocking severity.
Tuned SAST Gate Report
| Metric | Baseline (Untuned) | Tuned Result |
|---|---|---|
| Total Findings | 412 | 84 |
| Findings per 1k LoC | 18.4 | 3.7 |
| False Positive Rate (Sample) | 72% | 12% |
| CI Gate Status | FAIL | PASS |
Rule Enforcement Decisions
- Excluded Paths:
**/migrations/*,**/tests/*,**/venv/*. - Promoted to ERROR:
python.sqlalchemy.security.sqlalchemy-execute-variables,python.lang.security.audit.dangerous-subprocess-use-audit. - Disabled:
python.django.security.audit.xss.direct-usage-with-safe(Reason: 14 findings in sample, 13 were false positives in template fragments). - Demoted to WARNING:
python.lang.maintainability.is-literal-too-long.
Tuned Configuration (semgrep.yaml)
rules:
- id: python-sqli-blocking
pattern: $DB.execute(..., $VAR)
message: Potential SQL Injection detected.
severity: ERROR
languages: [python]
- id: secrets-check
pattern-regex: "(?i)password\\s*=\\s*['\"](?P<password>[^'\"]+)['\"]"
message: Hardcoded credential found.
severity: ERROR
languages: [python]
Next steps
- Commit the
semgrep.yamland.semgrepignorefiles to the root directory. - Update your GitHub Actions workflow using the provided
ci-gate.ymltemplate. - Monitor the gate in warn-only mode for 7 days before switching to blocking.
Connects securely to your tools. The creator never sees your data.
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
- Run a baseline scan using Semgrep, SonarQube, or CodeQL to identify the noisiest rules and triage a sample of findings.
- Apply exclusions for non-production code and generated files using tool-specific ignore configurations.
- Use the provided templates to curate a ruleset, promoting high-signal rules and documenting justifications for any disabled checks.
- 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
- 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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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 5 days ago
Permissions
What's inside
Frequently Asked Questions
New in Code Quality & Review
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Code Quality & Review.