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.26

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.26
File Size Uploaded Provenance Actions
septr-0.1.26.tar.gz 60.6 kB With provenance Details for septr-0.1.26.tar.gz

Built distribution (wheel)

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

Total release size: 110.4 kB

Release files / septr-0.1.26.tar.gz

Download URL septr-0.1.26.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5de78fd4b56006d746fb0f5e1b5d29a7b394d2711d744a75999fafa4b8dbffc7
BLAKE2b-256 checksum
How to use checksums
74f2798eac332555ad0c622e81d937c349f83ce8a079963358ac21fd4e7ce59c
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.26-py3-none-any.whl

Download URL septr-0.1.26-py3-none-any.whl
Size 49.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9000ea674e092459f2ff3d0a5cd66dda9cdc865150915451694e7058f0e3d74a
BLAKE2b-256 checksum
How to use checksums
c73fc099dfb88f3c1449b4654eeac2e35a3d7dd5815d2bde7a4205acedb9adf3
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.26

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.26.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