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.
git clone --depth 1 https://github.com/SyntaxArc/archipy-pluginWrote 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.
[](https://agentmods.dev/rules/syntaxarc/archipy-plugin/config-and-di)<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/config-and-di"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/config-and-di/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.
<a href="https://agentmods.dev/rules/syntaxarc/archipy-plugin/config-and-di"><img src="https://agentmods.dev/badge/rules/syntaxarc/archipy-plugin/config-and-di.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00981 | $0.00981 |
| Opus 5.5 | $0.00392 | $0.00392 |
| Sonnet 5.5 | $0.00196 | $0.00196 |
| Haiku 4.5 | $0.00098 | $0.00098 |
Grade A, and why
config-and-di 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 4d 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.
How it starts
The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Config and Dependency Injection
BaseConfig
import logging
from archipy.configs.base_config import BaseConfig
from archipy.configs.environment_type import EnvironmentType
logger = logging.getLogger(__name__)
class AppConfig(BaseConfig):
"""Application configuration. Inherits ArchiPy sections (REDIS, FASTAPI, UVICORN, GRPC, ...)."""
def customize(self) -> None:
"""Apply service-specific defaults after sources load."""
super().customize()
self.FASTAPI.PROJECT_NAME = "my-service"
self.UVICORN.RELOAD = self.ENVIRONMENT == EnvironmentType.LOCAL
config = AppConfig()
BaseConfig.set_global(config)
logger.info("Config loaded for environment: %s", config.ENVIRONMENT)
- Call
BaseConfig.set_global(config)once at bootstrap (typically importingapp_configfrom the DI container). - Read elsewhere via
BaseConfig.global_config(). - Document required env vars in
.env.example; never commit secrets. - Env overrides use nested delimiter:
FASTAPI__PROJECT_NAME,FASTAPI__SERVE_PORT,UVICORN__RELOAD, … - Preserve ArchiPy's settings-source priority: secret files → Vault → pyproject → TOML → environment →
.env→ defaults. Do not add scatteredos.environreads that bypass it. - Raise
ConfigurationError/InvalidArgumentErrorfromarchipy.models.errorsfor config validation failures; do not invent ad-hoc config exceptions.
FastAPIConfig (config.FASTAPI) and UvicornConfig (config.UVICORN)
config.FASTAPI drives AppUtils.create_fastapi_app and the bind address; config.UVICORN holds the server settings
that AppUtils.uvicorn_config() turns into uvicorn.run arguments (archipy >= 5.25.0; the same names on FASTAPI are
deprecated):
| Area | Fields |
|---|---|
Bind (FASTAPI) |
SERVE_HOST, SERVE_PORT |
Server (UVICORN) |
RELOAD, WORKERS_COUNT, TIMEOUT_KEEP_ALIVE, TIMEOUT_GRACEFUL_SHUTDOWN, BACKLOG, LIMIT_*, WS_*, ACCESS_LOG, DATE_HEADER, SERVER_HEADER |
Proxy (UVICORN) |
PROXY_HEADERS, FORWARDED_ALLOW_IPS |
TLS (UVICORN) |
SSL_KEYFILE, SSL_CERTFILE (set together), SSL_CA_CERTS |
| App / docs | PROJECT_NAME, OPENAPI_URL, DOCS_URL, RE_DOC_URL, … |
| Middleware flags | GZIP_MIDDLEWARE_IS_ENABLED, TRUSTED_HOST_MIDDLEWARE_*, HTTPS_REDIRECT_MIDDLEWARE_IS_ENABLED, CORS fields |
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.
- 4d ago Changed · +4 lines · +184 tokens per session f50aec46a72f
- 1mo ago Changed · +1 lines · +18 tokens per session 895b13587d36
- 1mo ago Changed · +1 tokens per session 2f2298199aae
- 2mo ago Changed · +6 lines · +127 tokens per session 779c386428a4
- 2mo ago First seen · 75 lines · 651 tokens per session scan A 91fa45cfc6b7
config-and-di is a cursor rule published in the GitHub repository SyntaxArc/archipy-plugin (3 stars, last pushed 5d ago), licensed MIT. It adds 981 tokens to every session, about $0.0039 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.
config-and-di compared with cursor rules from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| config-and-diSyntaxArc/archipy-plugin | Cursor rule | 3 | 5d ago | MIT | A | 981 | Cursor |
| python-flask-json-guide-cursorrules-prompt-filePatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 185 | Cursor |
| py-fast-apiPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 720 | Cursor |
| python-django-best-practices-cursorrules-prompt-fiPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 698 | Cursor |
| pythonPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 734 | Cursor |
| python-fastapi-best-practices-cursorrules-prompt-fPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 486 | Cursor |
| fastapiPatrickJS/awesome-cursorrules | Cursor rule | 41k | 5mo ago | CC0-1.0 | A | 427 | Cursor |