using-archipy-utils

using-archipy-utils is a cursor rule for Cursor from SyntaxArc/archipy-plugin. It costs 0 tokens per session (677 once invoked), scanned A, original, MIT.

A guide to ArchiPy's reusable helper functions and application factories. The helpers handle tasks such as dates, strings, passwords, tokens, files, tracing, and rate limits, while the factories create configured FastAPI or gRPC applications.

In plain words
What is it for?
Use it when you need common data or security helpers, or when starting a FastAPI HTTP service or gRPC server with ArchiPy's standard configuration and middleware.
Why use it?
It prevents duplicated utility code and avoids inconsistent setup for HTTP and gRPC services. It also keeps helpers free from database access, network calls, and business rules.

Cursor rule for Cursor

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

Good fit Use it when you need common data or security helpers, or when starting a FastAPI HTTP service or gRPC server with ArchiPy's standard configuration and middleware.

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

README.md
[![agentmods](https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-utils.svg)](https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-utils)
Your own site
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/using-archipy-utils"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/using-archipy-utils.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 677 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.00677
Opus 5 $0.00000 $0.00338
Sonnet 5 $0.00000 $0.00135
Haiku 4.5 $0.00000 $0.00068

Measured 7d ago against content hash 2153cc51eb84, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

using-archipy-utils 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 7d 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-utils.mdc · 63 lines

How it starts

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

Using ArchiPy Utils

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

Prefer ArchiPy Utils

Before writing a custom util, check whether ArchiPy already provides it under archipy.helpers.utils:

  • TracingUtils, RateLimitUtils
  • DatetimeUtils, StringUtils, JWTUtils, PasswordUtils, FileUtils, ErrorUtils
  • Also: BaseUtils, TOTPUtils, KeycloakUtils, PrometheusUtils
  • Import from concrete submodules (e.g. archipy.helpers.utils.jwt_utils) — package __init__ does not re-export
  • AppUtils — FastAPI / gRPC app factories (see below)

AppUtils (FastAPI + gRPC)

uv add "archipy[fastapi]"   # HTTP
uv add "archipy[grpc]"      # gRPC (sync + async)

Prefer ArchiPy factories — do not hand-roll bare FastAPI() / grpc.server() when extras are installed:

Method Use
AppUtils.create_fastapi_app(config?) HTTP app; wires CORS/GZip/TrustedHost/HTTPS redirect, metrics, APM, exception handlers from BaseConfig.FASTAPI
AppUtils.create_grpc_app(config) Sync gRPC server; exception + optional trace/metric/rate-limit interceptors
AppUtils.create_async_grpc_app(config) Async gRPC (grpc.aio); same interceptor auto-registration

Rules:

  • Pass BaseConfig.global_config() (or injected config); do not duplicate middleware/interceptor setup AppUtils already does.
  • FastAPI + uvicorn always driven by config.FASTAPI (FastAPIConfig) — never hardcode host/port/reload/proxy settings.
  • Sync servicers → create_grpc_app; async servicers → create_async_grpc_app — do not mix.
  • Enable features via config flags (e.g. FASTAPI.GZIP_MIDDLEWARE_IS_ENABLED, GRPC_RATE_LIMIT.IS_ENABLED) rather than manually appending stock ArchiPy middleware/interceptors.
  • Custom gRPC interceptors: pass customized_interceptors=; do not bypass the exception interceptor.

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

Custom Utils

Read the full file on GitHub · 63 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. 7d ago First seen · 63 lines · 677 tokens per session scan A 2153cc51eb84

Subscribe to this mod's changes

using-archipy-utils is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (2 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 677 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-31.