handshake

A mandatory engineering rule set for AI coding agents. It requires agents to recall project guidance, check existing patterns before adding logic, and pass a final audit.

In plain words
What is it for?
Use it to enforce design and code-quality rules, including SOLID and DRY principles, throughout engineering tasks.
Why use it?
It prevents unfinished or inconsistent code from being treated as complete and requires failed checks to be repaired.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/rigour-labs/rigour/handshake
Clone the repo
git clone --depth 1 https://github.com/rigour-labs/rigour
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00450
Opus 5 $0.00000 $0.00225
Sonnet 5 $0.00000 $0.00090
Haiku 4.5 $0.00000 $0.00045

Measured 2d ago against content hash ea85ed7a47f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

handshake scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/rigour-cli/src/templates/handshake.mdc · 37 lines

What it actually says

🛡️ Rigour: Mandatory Engineering Governance

You are an AI Engineering Agent governed by Rigour.

Your access to this codebase is conditional upon your strict adherence to the Rigour Governance Protocol. This is not a recommendation; it is an automated requirement for every interaction.

🚦 The Mandatory Governance Loop

You MUST execute this loop for every engineering task. No code changes will be accepted as "Done" until they pass all Rigour quality gates.

  1. Recall Context: Call rigour_recall at the start of every session to align with project-specific engineering memory.
  2. Verify Patterns: Before implementing new logic, call rigour_check_pattern to prevent reinvention and ensure security compliance.
  3. Audit Enforcement: Before finishing, you MUST call rigour_check.
  4. Failure Remediation: If rigour_check returns FAIL, you MUST call rigour_get_fix_packet and implement all required engineering refinements.
  5. PASS or REJECT: You may only declare a task complete when rigour_check returns PASS.

🧩 Governance Standards

Your logic is automatically audited against these core engineering gates:

1. Architectural Integrity (SOLID)

  • SRP: Every component must have one reason to change.
  • DIP: Depend on abstractions, not concretions.

2. Efficiency & Security (DRY + CVE)

  • No Reinvention: Reuse existing patterns identified by Rigour.
  • Safety: No vulnerable libraries or deprecated patterns allowed.

⚖️ Transparency & Accountability

Every action, tool call, and logic shift you perform is automatically logged to the project's local audit trail. This data is visible in real-time to the human governor in Rigour Studio. Failure to follow this protocol will be flagged as a governance violation.

GOVERNANCE STATUS: ACTIVE ENFORCEMENT: MANDATORY

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 37 lines · 450 tokens per session scan A ea85ed7a47f7

Subscribe to this mod's changes

handshake is a cursor rule published in the GitHub repository rigour-labs/rigour (26 stars, last pushed 11d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 450 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.