api-route-expectations

api-route-expectations is a cursor rule for Cursor from paperclipai/paperclip. It costs 0 tokens per session (463 once invoked), scanned A, original, MIT.

A repository rule for HTTP API routes that read or change company data. It requires company access checks, actor permissions, activity logs for changes, and consistent error responses.

In plain words
What is it for?
Use it when creating or modifying server routes, especially routes involving board users, agent API keys, company records, or data-changing actions.
Why use it?
It helps prevent one company's users or agents from accessing another company's data and keeps API behaviour predictable.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when creating or modifying server routes, especially routes involving board users, agent API keys, company records, or data-changing actions.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/paperclipai/paperclip/api-route-expectations
About the project

Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.

paperclipai/paperclip · 118,214 stars · on GitHub · paperclip.ing

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.

Clone the repo
git clone --depth 1 https://github.com/paperclipai/paperclip

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-route-expectations

README.md
[![agentmods](https://agentmods.dev/badge/rules/paperclipai/paperclip/api-route-expectations/github.svg)](https://agentmods.dev/rules/paperclipai/paperclip/api-route-expectations)
Your own site
<a href="https://agentmods.dev/rules/paperclipai/paperclip/api-route-expectations"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/api-route-expectations/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-route-expectations

Your own site · 80×15
<a href="https://agentmods.dev/rules/paperclipai/paperclip/api-route-expectations"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/api-route-expectations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 463 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00463
Opus 5.5 $0.00000 $0.00185
Sonnet 5.5 $0.00000 $0.00093
Haiku 4.5 $0.00000 $0.00046

Measured 19d ago against content hash 586cba5f4057, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-route-expectations 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 19d 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.

rules/api-route-expectations.mdc · 51 lines

What it actually says

API route expectations

Scope and purpose

This rule applies to new or changed HTTP routes under server/src/routes/. Paperclip is a multi-company control plane, so each route must keep one company's data away from another company's actors.

Auth model

  • The base path is /api.
  • Board access is treated as full-control operator context.
  • Agent access uses bearer API keys (agent_api_keys), hashed at rest.
  • Agent keys must not access other companies.

Requirements

When you add or change an endpoint that reads or writes company data:

  • Apply company access checks. Use the helpers in server/src/routes/authz.ts, such as assertCompanyAccess, instead of a new check.
  • Enforce actor permissions (board vs agent), for example with assertBoard or assertBoardOrAgent.
  • Write an activity log entry for each mutation.
  • Return consistent HTTP errors. The common codes are 400/401/403/404/409/422/500. Other codes are valid when they are the correct status, such as 429 for rate limits and 503 while the server starts or drains.

Instance-level routes such as health.ts, liveness.ts, ready.ts, public-mcp.ts, and org-chart-svg.ts have no company to check. Do not add a company access check to a route that serves no company data.

The API reference for callers is in docs/api/. Update it when a public endpoint changes.

Review criteria

Flag a route that reads or writes company data without a company access check. Flag a route that lets an agent key reach another company. Flag a mutation with no activity log entry. Flag an error response with an incorrect status code or an error that hides a failure behind a success status. Do not flag a correct status code only because it is not in the common list. Do not flag an instance-level route for a missing company check.

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. 19d ago First seen · 51 lines · 0 tokens per session scan A 586cba5f4057

Subscribe to this mod's changes

api-route-expectations is a cursor rule published in the GitHub repository paperclipai/paperclip (118,214 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 463 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-11-11.

Related

api-route-expectations compared with cursor rules from other repositories

api-route-expectations next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
api-route-expectationspaperclipai/paperclipCursor rule118kyesterdayMITA0Cursor
backend-architectureEricLortie/laborforge-releaseCursor rule74mo agononeA1,021Cursor
titanclip-serverCES-Ltd/TitanClipCursor rule137mo agononeA0Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor