# Diff Risk Review — Rule-Based PR Gate

> Reads a unified diff against a fixed rule catalog and returns PR-ready findings — committed credentials, swallowed exceptions, removed assertions, muted CI, concatenated SQL, disabled TLS, unpinned deps, dropped timeouts — each with file:line, the line as evidence and a fix. Exit codes usable as a C

Diff Risk Review — Rule-Based PR Gate is a free AI agent skill on Agensi by SHUN, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [SHUN](https://www.agensi.io/creators/66shun66)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.1
- Last updated: 2026-11-23
- Security: scan passed (2026-11-23); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/diff-risk-review-rule-based-pr-gate
- Tags: code-quality-review, security, devops-cloud

## About this skill

A pull request is a list of claims about the future. Most review time goes to the ten changed lines that can page someone at 3am.

This skill reads the diff and nothing else: only changed lines are judged, and the removal side is checked only for deletions that are themselves the risk.

Rules that fire:
- credentials in code, silent catch, bare except, unsafe deserialize
- assertion deleted from a test, test skipped in the same change
- `|| true`, `continue-on-error`, `permissions: write-all`, remote script piped to shell
- SQL built by `+`, `%`, f-string or `.format`
- `verify=False`, `InsecureSkipVerify`, auth set to None
- timeout removed, unbounded loop, mutable default
- debug leftovers, identifiers in log lines, unpinned requirements

Output is risk_review.md (verdict, findings table, per-file table) plus an embedded PR comment block and risk_review.json. Exit codes 0/1/2 map to PASS/WARN/BLOCK, so the same script is a local review pass and a pipeline gate. A false positive is suppressed in the diff with `risk-ok` and a reason.

## Requires

- Python 3.9+
- Git

## Known limitations

Rule-based: finds known shapes, a novel failure mode passes. Reads a diff, not a repository. No secret-history scan, no CVE or licence checks.

## 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 Diff Risk Review — Rule-Based PR Gate skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Diff Risk Review — Rule-Based PR Gate do?

Reads a unified diff against a fixed rule catalog and returns PR-ready findings — committed credentials, swallowed exceptions, removed assertions, muted CI, concatenated SQL, disabled TLS, unpinned deps, dropped timeouts — each with file:line, the line as evidence and a fix. Exit codes usable as a C

### Which AI agents support Diff Risk Review — Rule-Based PR Gate?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Diff Risk Review — Rule-Based PR Gate?

Connect your AI agent to Agensi through MCP, then ask it to use Diff Risk Review — Rule-Based PR Gate on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

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.
