using-archipy-interceptors

using-archipy-interceptors is a cursor rule for Cursor from SyntaxArc/archipy-plugin. It costs 496 tokens per session, scanned A, original, MIT.

Coding rules for ArchiPy interceptors, which are hooks that run around requests or remote procedure calls for shared concerns such as logging, authentication context, and metrics.

In plain words
What is it for?
Use them when configuring or writing FastAPI or gRPC interceptors, middleware, request logging, metrics, authentication context, and related cross-cutting behavior.
Why use it?
They clarify how to use built-in middleware and keep shared request handling separate from data access and business rules.

Cursor rule for Cursor

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

Good fit Use them when configuring or writing FastAPI or gRPC interceptors, middleware, request logging, metrics, authentication context, and related cross-cutting behavior.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/syntaxarc/archipy-plugin/using-archipy-interceptors
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/SyntaxArc/archipy-plugin

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 using-archipy-interceptors

README.md
[![agentmods](https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-interceptors/github.svg)](https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-interceptors)
Your own site
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-interceptors"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-interceptors/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 using-archipy-interceptors

Your own site · 80×15
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-interceptors"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-interceptors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 496 This file is loaded in full into every session.
When invoked 496 The same file — it is already loaded in full.
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.00496 $0.00496
Opus 5.5 $0.00198 $0.00198
Sonnet 5.5 $0.00099 $0.00099
Haiku 4.5 $0.00050 $0.00050

Measured 1mo ago against content hash d58556f32008, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

using-archipy-interceptors 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 1mo 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/using-archipy-interceptors.mdc · 46 lines

How it starts

The opening of the file, as written. The whole thing — 46 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Using ArchiPy Interceptors

Helpers stay pure: no database/network I/O, no constructing adapters, no domain business rules.

Role

Interceptors are cross-cutting request/RPC/middleware hooks (metrics, auth context, logging enrichment). They are not repositories and not use-cases.

Prefer ArchiPy / AppUtils

Use ArchiPy interceptors under archipy.helpers.interceptors (FastAPI / gRPC) before inventing new ones.

Prefer AppUtils auto-registration for stock interceptors/middleware:

  • FastAPI: AppUtils.create_fastapi_app wires middleware/exception handlers and instruments through archipy[otel,fastapi] when OTEL.IS_ENABLED.
  • gRPC: create_grpc_app / create_async_grpc_app append exception, optional OTel traces (contrib), ArchiPy metrics (rpc.server.call.duration when OTEL.METRICS_ENABLED), and gRPC rate-limit interceptors. Do not hand-roll those stock hooks; metrics install is independent of traces.
  • FastAPI rate limiting is not shipped by ArchiPy 5.x; use fastapi-redis-sdk when required.

Do not manually re-wire stock ArchiPy interceptors unless customizing beyond config flags.

Live: https://syntaxarc.github.io/ArchiPy/tutorials/helpers/interceptors/

Custom Interceptors

  • Live under helpers/interceptors/.
  • Keep them framework-aware but business-logic-free.
  • Wire via DI container, framework registration, or customized_interceptors= on gRPC AppUtils — do not have adapters import interceptors at module level to register themselves.
  • Sync and async variants stay separate when both exist.
  • Raise/map through archipy.models.errors; do not invent ad-hoc exception classes or leak framework/driver errors.

Do Not

  • Embed use-case logic inside interceptors.
  • Call databases or downstream services directly; inject context already resolved at the appropriate boundary.
  • Perform multi-step domain writes here (that belongs in logics/ with atomic boundaries).
  • Leak infrastructure exceptions — map to domain/HTTP/gRPC errors at the appropriate boundary.

Read the full file on GitHub · 46 lines

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. 1mo ago Changed · +2 tokens per session d58556f32008
  2. 2mo ago Changed · +6 lines · +116 tokens per session 14a0a5cbfdc6
  3. 3mo ago First seen · 40 lines · 378 tokens per session scan A a71ca4c92076

Subscribe to this mod's changes

using-archipy-interceptors is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (3 stars, last pushed 23d ago), licensed MIT. It adds 496 tokens to every session, about $0.0020 per session on Opus 5.5. 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-31.

Related

using-archipy-interceptors compared with cursor rules from other repositories

using-archipy-interceptors next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
using-archipy-interceptorsSyntaxArc/archipy-pluginCursor rule323d agoMITA496Cursor
python-flask-json-guide-cursorrules-prompt-filePatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A185Cursor
py-fast-apiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A720Cursor
python-django-best-practices-cursorrules-prompt-fiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A698Cursor
pythonPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A734Cursor
python-fastapi-best-practices-cursorrules-prompt-fPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A486Cursor
fastapiPatrickJS/awesome-cursorrulesCursor rule41k6mo agoCC0-1.0A427Cursor