Skip to main content

septr — runtime security middleware for Python

Protects FastAPI and Flask apps at runtime: secrets leaking in responses, BOLA/IDOR, missing auth, business-logic tampering, PII, prompt injection, SSRF, and missing rate limits. Auto-verified against the Septr backend, with per-engine SOC 2 evidence for your dashboard.

Install

pip install septr

Add your key to .env:

SEPTR_API_KEY=septr_live_...

Telemetry, heartbeat, and auto-verification are on by default whenever SEPTR_API_KEY is set. Set "telemetry": False to run detection only locally.

FastAPI

from fastapi import FastAPI
from septr import create_septr
import os

app = FastAPI()

create_septr(app, {
    "apiKey": os.getenv("SEPTR_API_KEY"),
})

(from septr.adapters.fastapi import create_septr works too.)

Flask

from flask import Flask
from septr import create_septr_flask
import os

app = Flask(__name__)
# ... your routes ...
create_septr_flask(app, {"apiKey": os.getenv("SEPTR_API_KEY")})

(from septr.adapters.flask import create_septr works too.)

Config

Option Type Default Description
apiKey str env SEPTR_API_KEY Backend API key
telemetry bool True Send detections + heartbeat to the dashboard
telemetry_url str https://app.septr.dev/v1/events Telemetry endpoint
projectId str derived from key Project id; auto-read from septr_live_* keys
strictMode bool False Block instead of detect
secrets bool True Secret/PII detection + response scrubbing
bola bool True BOLA/IDOR detection
rateLimit bool True Per-route rate limiting
inputSanitize bool True SQLi/XSS/NoSQLi sanitization
ssrf bool True SSRF heuristics
promptInjection bool True Prompt-injection shielding
aiRateLimit bool True Rate limiting for AI endpoints
tamper bool True Business-logic tamper detection
missingAuth bool True Missing-auth detection
publicRoutes list[str] [] Path prefixes treated as public (e.g. ["/api/v1/feed"])
publicRoutesExact list[str] [] Exact paths treated as public (e.g. ["/"])
stripFields list[str] [] Fields to strip from responses
maxResponseScanBytes int 262144 Max response size scanned (bytes); larger responses stream through unscanned
maxRequestInspectBytes int 262144 Max request body inspected (bytes); larger bodies stream through untouched
engineFailureThreshold int 3 Consecutive engine failures before the breaker skips that engine
engineBudgetMs float 50.0 Per-engine time budget; slower calls count as failures
disabled bool False Emergency bypass — pass every request through untouched
securityHeaders bool True Report responses missing security headers (disable when another layer manages them)

Environment variables

  • SEPTR_API_KEY — your project key
  • SEPTR_TELEMETRY_URL — override the telemetry endpoint (e.g. your local backend's /v1/events endpoint for development)
  • SEPTR_HEARTBEAT_INTERVAL_MS — heartbeat cadence in ms (default 60000; set 0 to disable heartbeats)
  • SEPTR_ENV — environment label sent with events (default production)
  • SEPTR_SILENCE_ENV_WARNING — set to 1 to silence the fail-loud missing-key warning
  • SEPTR_DISABLED=true — emergency bypass: pass every request through untouched (no scanning, no blocking) while the SDK stays installed

License

MIT

Metadata

Release files for septr 0.1.29

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for septr 0.1.29
File Size Uploaded Provenance Actions
septr-0.1.29.tar.gz 60.6 kB With provenance Details for septr-0.1.29.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for septr 0.1.29
File Interpreter ABI Platform Actions
septr-0.1.29-py3-none-any.whl Python 3 none any Details for septr-0.1.29-py3-none-any.whl

Total release size: 110.4 kB

Release files / septr-0.1.29.tar.gz

Download URL septr-0.1.29.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
aa6adc09a2a634e49cdd02f3d7f1502e9cb16393ea709db25bbedc44f778c980
BLAKE2b-256 checksum
How to use checksums
cfe24827b1b4620a9f63198fc0a4c98b309196e6b4062c17a358260c3667ed64
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Release files / septr-0.1.29-py3-none-any.whl

Download URL septr-0.1.29-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15484cd06ac2cc9f3b5037e2b6b07ffad5f300fb97be18275d00718cd0ceb577
BLAKE2b-256 checksum
How to use checksums
f3f8c03087d7b323ebb2179c3dcede9090458e8c726e89912dc964ed06fbbf02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

Security for septr 0.1.29

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for septr-0.1.29.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page