relintio-agent (Python)
Note on Features & Quotas: Advanced features (like Bot Challenge and Custom Shield Pages) are tied to your subscription plan. If you exceed your monthly API quota, the agent will operate in a degraded mode (basic protection) before ultimately failing-open to prevent locking you out of your own site. All configuration rules are centrally managed via the dashboard.
Python in-process agent for ASGI runtimes (FastAPI/Starlette/etc).
Install
pip install relintio-agent
FastAPI usage
from fastapi import FastAPI
from relintio_agent.asgi import UltimateProtectorMiddleware
app = FastAPI()
app.add_middleware(
UltimateProtectorMiddleware,
license_key="UP_LIVE_...",
api_url="https://api.relintio.com/v1",
)
Zero-code-ish usage (env wrapper)
If you can change how the app is created (but don't want to paste config into code), wrap the ASGI app using env vars:
import os
from fastapi import FastAPI
from relintio_agent import wrap_asgi_app
app = wrap_asgi_app(FastAPI())
# env:
# UP_LICENSE_KEY=UP_LIVE_...
# UP_API_URL=https://api.relintio.com/v1
Optional: sitecustomize bootstrap
The platform can generate a sitecustomize.py helper inside the Python auto bundle.
If that file is on PYTHONPATH, Python auto-imports it on startup.
Set UP_ASGI_APP="module:app" and it will best-effort wrap that object automatically (fail-open).
Risk Scoring Engine (v0.9.6)
Every request is evaluated using an additive 0-100 signal-based score. Signals include:
| Signal | Weight | Description |
|---|---|---|
| Empty User-Agent | +50 | No UA header sent |
| Short User-Agent | +25 | UA < 20 characters |
| No Accept-Language | +20 | Missing browser locale header |
| Generic Accept | +15 | Wildcard */* only |
| Connection: close | +10 | Non-persistent connection |
| POST without Referer | +15 | Form submission without origin |
| Rate burst | +35 | Token-bucket exhaustion |
Response Tiers
| Tier | Score Range | Behavior |
|---|---|---|
| ALLOW | 0–39 | Request proceeds normally |
| SLOW | 40–59 | 2-second asyncio.sleep to exhaust scanners |
| CHALLENGE | 60–74 | Browser verification challenge |
| DECOY | 75–84 | Serves fake maintenance page |
| BLOCK | 85–100 | Hard block with configured response |
Token-Bucket Rate Limiter
Default: 8 tokens/sec, burst capacity of 24. Route-aware multipliers give extra capacity to static assets. Memory-safe with 5-minute eviction via asyncio-compatible dict.
Notes
- PyPI distribution name:
relintio-agent - Import path:
relintio_agent(recommended) - Legacy import path still supported:
ultimateprotector_agent
Options
license_key(required)api_url(required) e.g.https://api.relintio.com/v1sync_interval_seconds(default:10; jitter and failure backoff are automatic)allow_sample_rate(default:0.01)only_paths: list[str] exact (/checkout) or prefix (/product/*)except_paths: list[str]only_regex: str (Python regex)
Geo Enrichment
When CDN geo headers (CF-IPCountry, etc.) are absent, the agent calls the canonical /v1/agent/geo-lookup endpoint on api.relintio.com.
The server resolves the country using local MaxMind GeoLite2 databases — zero external API calls, zero cost, microsecond latency.
Results are cached in-memory (24h TTL) to minimize round-trips.
Changelog
0.9.3
- Import path alignment -
relintio_agentis now the documented import path, withultimateprotector_agentkept as a compatibility alias. - Version telemetry alignment - Runtime telemetry now reports
0.9.3, matching the PyPI package version and release tag.
0.5.0
- Additive risk-scoring engine — 0-100 signal-based scoring with 7 weighted signals.
- 5-tier graduated response — ALLOW, SLOW (
asyncio.sleep(2.0)), CHALLENGE, DECOY, BLOCK. - Token-bucket rate limiter — Replaces fixed-window counter. 8 tokens/sec, 24 burst, route-aware multipliers.
risk_scoretelemetry — Agent-calculated score forwarded to server in log payload.
0.3.0
- Geo enrichment architecture hardened — The canonical
/v1/agent/geo-lookupendpoint now performs local MaxMind GeoLite2 lookups instead of proxying toipinfo.io. Agent behaviour is unchanged; the improvement is server-side.
0.2.0
- HMAC payload verification — Rules payloads are now authenticated with HMAC-SHA256 before decryption. Requires platform ≥ 2026-04.
X-Agent-Versionheader — Sent on every/verifyrequest for dashboard version tracking.outdatedstatus handling — If the cloud responds withoutdated, the agent fails open and stops protecting until updated.
0.1.1
- Initial stable release with AES-256-CBC encrypted rules sync.
Dashboard Deployment Workflow
- Open Dashboard → Deployment, select Python, and choose FastAPI, Starlette, or ASGI.
- Download the recommended package and register the middleware immediately after creating the ASGI application.
- Restart the server, then open one public route handled by the middleware.
- Enter that exact URL or public IP endpoint in Relintio and select Verify target.
The agent reports runtime kind python and its version on synchronization and heartbeat requests. Configuration revisions are received automatically.
Metadata
Release files for relintio-agent 0.9.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| relintio_agent-0.9.8.tar.gz | 26.0 kB | Without provenance | Details for relintio_agent-0.9.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| relintio_agent-0.9.8-py3-none-any.whl | Python 3 | none | any | Details for relintio_agent-0.9.8-py3-none-any.whl |
Total release size: 54.8 kB
Release files / relintio_agent-0.9.8.tar.gz
| Download URL | relintio_agent-0.9.8.tar.gz |
|---|---|
| Size | 26.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
081e8b7beb0061d492df8953bbb187fbb7ef3627eae8a3a98fb3bedc4e60745d
|
|
BLAKE2b-256 checksum How to use checksums |
12cd81703fd4167bb3b2ddbd3e45aba8659fa172a46cb3b60e3b024466c2e84a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / relintio_agent-0.9.8-py3-none-any.whl
| Download URL | relintio_agent-0.9.8-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a4d9c664e60ec0450cfbc4e701e476a94d9bc56e40b1ae1388b7c17eb50c1454
|
|
BLAKE2b-256 checksum How to use checksums |
80bdceaabbc95b3b23b0276262b4011426b7b2b0d9dc4f7de864e7d667edbe0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Security for relintio-agent 0.9.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.