{
  "markdown": "# Rigour\n\n[![npm version](https://img.shields.io/npm/v/@rigour-labs/cli?color=cyan&label=cli)](https://www.npmjs.com/package/@rigour-labs/cli)\n[![cli downloads](https://img.shields.io/npm/dm/@rigour-labs/cli?color=blue&label=cli+downloads)](https://www.npmjs.com/package/@rigour-labs/cli)\n[![mcp downloads](https://img.shields.io/npm/dm/@rigour-labs/mcp?color=blue&label=mcp+downloads)](https://www.npmjs.com/package/@rigour-labs/mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![MCP Registry](https://img.shields.io/badge/MCP-Listed-green)](https://rigour.run)\n[![OWASP](https://img.shields.io/badge/OWASP-Project-red)](https://rigour.run)\n\n**Your AI agent just tried to commit an AWS secret. Rigour blocked it in <100ms.**\n\n**Agent Transaction Firewall (v6):** treat the agent as an untrusted proposer. Rigour decides—deterministically—what it may write, run, call, and ship. No AI judge on the allow/deny path.\n\n## Try it now (zero config)\n\n```bash\nnpx rigour-scan\n```\n\nWorks on any repo. No init, no config, no setup. Instant results in your terminal:\n\n```\n  HARDCODED SECRET DETECTED\n  AWS_SECRET_ACCESS_KEY found in src/config.ts:23\n\n  + 22 more violations across 847 files (2.1s)\n\n  Score        ████░░░░░░░░░░░░░░░░  34/100\n  AI Health    ███░░░░░░░░░░░░░░░░░░  28/100\n\n  Gates:  ✅ file-size  ❌ security  ❌ ast  ✅ deps\n\n  Brain: learned 12 patterns · trend: improving ↑\n```\n\n## Add to your AI IDE (30 seconds)\n\n```json\n{ \"mcpServers\": { \"rigour\": { \"command\": \"npx\", \"args\": [\"-y\", \"@rigour-labs/mcp@latest\"] } } }\n```\n\n| IDE / Agent | MCP Tools | Live Dashboard | Real-Time Feed |\n|---|---|---|---|\n| **Claude Desktop** | ✅ | ✅ MCP App | ✅ Logging |\n| **VS Code Copilot** | ✅ | ✅ MCP App | ✅ Logging |\n| **ChatGPT** | ✅ | ✅ MCP App | ✅ Logging |\n| **Goose** | ✅ | ✅ MCP App | ✅ Logging |\n| **Claude Code** | ✅ | — | ✅ Logging |\n| **Cursor** | ✅ | — | ✅ Logging |\n| **Cline** | ✅ | — | ✅ Logging |\n| **Windsurf** | ✅ | — | ✅ Logging |\n| **Codex** | ✅ | — | ✅ Logging |\n\nThen install hooks so writes are checked in real time:\n\n```bash\nnpx @rigour-labs/cli hooks init --tool cursor   # or claude, cline, windsurf\n# or via MCP: rigour_hooks_init\n```\n\n## Does the firewall run automatically?\n\n**Short answer:** quality gates + DLP + mediated `rigour_run` paths run when MCP/hooks are installed. It does **not** yet sit in front of every third-party MCP tool (GitHub/Slack/etc.)—that gateway is designed but not the default proxy.\n\n| Surface | Automatic once installed? | What you get |\n|---|---|---|\n| **MCP server** (`@rigour-labs/mcp`) | Yes for Rigour tools the agent calls | `rigour_check`, Fix Packets, memory DLP, agent register, Studio events |\n| **`rigour_run` / `rigour_run_supervised`** | Yes when those tools are used | Typed argv allowlist (no free-form `shell: true`), fail-closed human arbitration (timeout = deny), one-time Studio token |\n| **IDE hooks** (Cursor/Claude/Cline/Windsurf) | Yes after `hooks init` | Per-write checks (secrets, imports, size, protected paths). If agents are registered, set `RIGOUR_AGENT_ID` so scope binds to the writer (fail-closed; no union-allow) |\n| **`rigour_agent_register`** | Yes when called | Rejects `**/*` / sensitive globs unless operator scopes or `RIGOUR_ALLOW_AGENT_SCOPE_AUTHORITY=1` |\n| **CLI firewall** | On demand / CI | `firewall adversarial`, `firewall transact`, `firewall admit` |\n| **Third-party MCP proxy** | Not yet | Capability broker + `McpGateway` interfaces exist; Rigour is not yet a MITM for all MCP servers |\n\n```\nAgent proposes action\n        ↓\nHooks / MCP mediation (when on the path)\n        ↓\nDeterministic deny/allow + rule id\n        ↓\nStudio evidence  ·  CI attestation (admit)\n```\n\n## Agent Transaction Firewall\n\n```bash\nnpx @rigour-labs/cli firewall status\nnpx @rigour-labs/cli firewall adversarial   # deterministic corpus — unexpected allows fail CI\nnpx @rigour-labs/cli firewall transact --agent <id> --scope 'packages/foo/**'\nnpx @rigour-labs/cli firewall admit         # CI: valid attestation + PASS + bound git tree\nnpx @rigour-labs/cli studio                 # Firewall tab: decisions, attestation, mediation health\n```\n\n**Guarantees (on mediated paths):** fail-closed arbitration · typed commands · per-agent scope · signed attestation bound to commit/tree · adversarial replay as regression fuel—not an AI red-team product.\n\nSee [ADR 001](docs/adr/001-agent-transaction-firewall.md).\n\n## Live governance dashboard (MCP App)\n\nIn supported editors, a real-time dashboard appears automatically as your agent works:\n\n```\n┌─ Rigour Governance ──────────────────────────┐\n│  Score: 94/100  ✅ PASS                      │\n│                                               │\n│  14:32:01  rigour_check → FAIL (34/100)       │\n│  14:32:03  fix_packet → 8 fixes               │\n│  14:32:15  rigour_check → 71/100 (+37)        │\n│  14:32:22  rigour_check → ✅ PASS 94/100      │\n│                                               │\n│  Brain: 47 patterns · trend: improving ↑      │\n└───────────────────────────────────────────────┘\n```\n\nNo extra commands. The dashboard appears when the agent calls Rigour tools. Watch your agent self-heal in real time. Open **Firewall** in Studio for allow/deny decisions and mediation status (`partial` until the MCP gateway is fully wired).\n\n## What it catches\n\n| Category | Gates |\n|---|---|\n| **Security** | Hardcoded secrets (29+ patterns), SQL injection, XSS, CSRF, prototype pollution, Shannon entropy |\n| **Structural** | File size, cyclomatic complexity, method count, parameter count, nesting depth, TODO/FIXME |\n| **AI Drift** | Hallucinated imports, phantom APIs, context drift, retry loop detection |\n| **Governance** | Agent team isolation, checkpoint supervision, memory DLP |\n| **Firewall** | Out-of-scope writes, undeclared MCP tools, disallowed shell, fail-closed timeouts |\n\nAST-based. Not heuristics. **TypeScript, JavaScript, Python, Go, Ruby, C#, Java, Kotlin, Rust.**\n\n## How it works\n\n```\nAgent writes code → Hooks / gates fire → FAIL? → Fix Packet (JSON)\n                                           ↓\n                                    Agent reads exact instructions\n                                           ↓\n                                    Agent fixes → PASS ✓\n\nMediated run (rigour_run) → typed allowlist → human arbitration (fail-closed)\n                                           ↓\n                                    execute or deny + evidence\n```\n\nVoluntary `rigour_check` is a **quality workflow**, not the security boundary. Hard guarantees require installed hooks/MCP mediation and (for CI) `firewall admit`.\n\n## The Brain — learns your codebase\n\nEvery scan reinforces patterns. Patterns decay when absent. At `strength: 0.9`, they promote to hard rules. Your project's own immune system — trained locally, zero telemetry.\n\n```\nFirst week:  catches 12 violations\nFirst month: catches 8 violations  ← learning your patterns\nThird month: catches 3 violations  ← your agents have adapted\n```\n\n## How it's different\n\n| | Rigour | ESLint | “AI security agents” |\n|---|---|---|---|\n| Runs locally, zero telemetry | ✅ | ✅ | often ❌ |\n| Learns YOUR codebase (Brain) | ✅ | ❌ | ❌ |\n| Agent self-healing (Fix Packets) | ✅ | ❌ | ❌ |\n| Deterministic execution firewall | ✅ | ❌ | usually LLM judge |\n| Works offline (GGUF sidecar) | ✅ | ✅ | ❌ |\n| AI-native drift detection | ✅ | ❌ | ❌ |\n| MCP-native | ✅ | ❌ | varies |\n\n## Used in production\n\n- **19,000+ total installs** across CLI and MCP\n- **Organically forked by Alibaba iFlow**\n- **OWASP project** — listed\n- **Cursor MCP directory** — listed\n\n## Quick reference\n\n```bash\nnpx rigour-scan                              # zero-config scan\nnpx @rigour-labs/cli init                    # add gates to your project\nnpx @rigour-labs/cli hooks init --tool cursor\nnpx @rigour-labs/cli check                   # run gates\nnpx @rigour-labs/cli check --deep            # + local AI analysis\nnpx @rigour-labs/cli check --deep --provider claude -k sk-ant-xxx  # cloud AI\nnpx @rigour-labs/cli studio                  # monitoring + Firewall tab\nnpx @rigour-labs/cli firewall adversarial\nnpx @rigour-labs/cli firewall admit\n```\n\n## Architecture\n\n| Package | Purpose |\n|---|---|\n| `@rigour-labs/core` | Gate engine, AST, Fix Packets, Brain, **firewall kernel** |\n| `@rigour-labs/cli` | `init`, `check`, `scan`, `run`, `studio`, `firewall` |\n| `@rigour-labs/mcp` | MCP server — governance tools for agent integration |\n| `rigour-scan` | Zero-config shortcut: `npx rigour-scan` |\n\n**Stack:** TypeScript strict, web-tree-sitter, Zod, Vitest.\n\n---\n\n**[Full docs](https://docs.rigour.run)** | **[Technical Spec](docs/SPEC.md)** | **[Philosophy](docs/PHILOSOPHY.md)** | **[Firewall ADR](docs/adr/001-agent-transaction-firewall.md)**\n\nMIT © [Rigour Labs](https://github.com/rigour-labs) — Built by [Ashutosh](https://github.com/erashu212)\n\n*If Rigour caught something real in your codebase — [tell us](https://github.com/rigour-labs/rigour/discussions).*\n",
  "bytes": 8995,
  "sha": "601952f58c42ee89fe6f41cfc39ec71d1aca1bacddf1f81729372674e5669366",
  "repo_slug": "rigour-labs/rigour",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_rigour_labs_rigour_c29cecca/readme"
}