Capture reality. Replay with confidence.

Deterministic HTTP interaction recording, in-memory secret sanitization, and strictly offline replay for Python tests using HTTPX. Stop wrestling with flaky third-party APIs and fragile socket monkey-patchers.

VIEW ON PYPISource
$pip install vexfox
VEXFOX CASSETTE DECKTRANSPORT: HTTPX.CLIENT
TAPE-142OFFLINE REPLAY
VEXFOX // OPTICAL SENSOR 0148 kHz DETERMINISTIC REPLAY
Phase 3: 0ms Offline Playback
SCHEMA V1
> REPLAY fixtures/refunds.json0ms ELAPSED
- Method: POST == POST (MATCH)
- Structural JSON Body: whitespace independent (MATCH)
* Outbound network socket closed. 100% deterministic.
Python 3.11+HTTPX NativeZero Monkey-Patching
Python >= 3.11

Modern typing & syntax

HTTPX Native

Sync & AsyncClient transports

Deterministic Replay

Strictly zero network flakiness

In-Memory Redaction

Scrubbed before disk serialization

Clean Transports

No global socket monkey-patching

ContextVar Isolated

Thread & async coroutine safe

PUBLIC RELEASE // v0.1.0

Install with pip

VEXFOX is published and immediately installable from PyPI. Add it to your test environment or virtualenv with standard packaging tools.

Terminal / Virtualenv
PyPI Published
$pip install vexfox
Works with:poetry add --group dev vexfoxuv add --dev vexfox
Consult the Getting Started guide for setup and pytest integration.
View on PyPI
Package Information

Metadata & Distribution

Package Namevexfox
Current Releasev0.1.0
Package IndexPyPI (pip)
Source CodeGitHub
LicenseMIT License
Python Requirement>= 3.11
PRODUCT ARCHITECTURE STORY

RECORD → SANITIZE → REPLAY

Experience the end-to-end lifecycle of a VEXFOX cassette fixture. Toggle stages manually or run the interactive simulation.

Active Lifecycle Stage // 01. RECORD

Capture live wire interactions at the transport layer

200 OK (Live API: 142ms)Real Network Active (Initial capture)

When running tests in RecordMode.ONCE (or RECORD), VEXFOX intercepts the outgoing HTTP request, allows it to touch the live external API, and captures the exact response headers, status codes, and body bytes.

Transport hook intercepts HTTPX client call
Outbound request permitted once to record real payload
Isolated per thread & async task via ContextVars
Python Context Manager Binding:with vexfox.use_cassette("fixtures/chat.json", mode=RecordMode.ONCE):
wire_intercept.log
INTERACTION #1
// HTTPX Request Dispatched to Live Endpoint
POST https://api.openai.com/v1/chat/completions HTTP/1.1
Content-Type: application/json
Authorization: Bearer sk-proj-demo-live-token-449102
OpenAI-Organization: org-acme-prod
{ "model": "gpt-4o", "temperature": 0.2, "messages": [{"role": "user", "content": "ping"}] }
>> Intercepted live HTTP 200 OK (elapsed: 142ms)
Interactive conceptual demonstration of VEXFOX v0.1.0 engine.100% Deterministic
Determinism vs Flakiness

Why live external APIs corrupt test suites

Every third-party API call in a CI run is a random failure waiting to happen. Latency spikes, rate limits, and payload drift turn fast test suites into unreliable bottlenecks.

CI TEST RUNNER COMPARATOR
VEXFOX: Deterministic & Hermetic

Record wire truth once. Replay hermetically forever.

VEXFOX wraps HTTPX transports cleanly. It records real wire interactions once, scrubs credentials in-memory before disk write, and replays locally in under a millisecond.

Sub-Millisecond Replay Speed
Recorded responses match memory or JSON fixtures instantly without opening outbound OS sockets.
In-Memory Secret Sanitization
Authorization headers, query tokens, and JSON secrets are redacted before cassette serialization.
Clean HTTPX Transport Hook
Scoped per-cassette context. No monkey-patching Python's standard `socket` module.
DIAGNOSTIC VERDICT:0.4ms / 100% HERMETIC PASS
pytest --verbose tests/test_billing.py
VEXFOX REPLAY
platform linux -- Python 3.12.2, pytest-8.1.1, vexfox-0.1.0
rootdir: /workspace/checkout-service
vexfox: RecordMode.REPLAY active -- outbound sockets strictly blocked
collecting ... collected 3 items
PASSED tests/test_billing.py::test_calculate_tax [0.01s]
PASSED tests/test_billing.py::test_charge_customer [0.0004s - REPLAY]
PASSED tests/test_billing.py::test_refund_webhook [0.0003s - REPLAY]
✓ Cassette: fixtures/stripe_charge.json (Schema v1)
✓ Secret sanitization: 3 tokens masked to [REDACTED]
✓ Outbound socket calls prevented: 2 blocked
================ 3 passed in 0.04s (310x faster) ================
Execution time:40 ms (Instant Replay)
✓Zero external network calls during pytest execution in `REPLAY` mode.
Deterministic tests across every branch and runner
Transport Architecture

Clean HTTP interception. Zero socket monkey-patching.

Unlike legacy tools that globally hijack Python's OS socket layer, VEXFOX operates as an explicit, scoped HTTPX transport wrapper with strict ContextVar isolation.

●SIMULATED EXECUTION MODE:
NODE 01ContextVar Isolated

Python Test Runner

pytest / client caller

The test executes standard `httpx.get()` or `await client.post()` calls wrapped in `with vexfox.use_cassette(...)`.

StatusCLICK TO VIEW
NODE 02Clean Transport Hook

HTTPX Transport Wrapper

Zero Monkey-Patching

VEXFOX routes traffic cleanly through `VexfoxSyncTransport` or `VexfoxAsyncTransport` without mutating global socket descriptors.

StatusINSPECTING
NODE 03Secret Safe

In-Memory Sanitizer

Pre-Persistence Filter

Traverses request/response headers, query params, and JSON structures to redact sensitive credentials before disk serialization.

StatusCLICK TO VIEW
NODE 04Atomic Persistence

Cassette Storage Engine

JSON Schema v1

Writes recordings to atomic JSON files with full request metadata, timing, status codes, and sanitized bodies.

StatusCLICK TO VIEW
ACTIVE TRAFFIC ROUTE:record
OUTBOUND NETWORK SOCKET:PERMITTED (ONCE ONLY)
pytest client
HTTPX Transport Hook
VexfoxTransport
Scrub & Persist
Live Call + Sanitizer
INSPECTED NODE: HTTPX Transport Wrappervexfox.transport.VexfoxSyncTransport

Does NOT touch Python socket or patch sys.modules. Only intercepts configured HTTPX clients.

class VexfoxSyncTransport(httpx.BaseTransport):
    def handle_request(self, request: httpx.Request) -> httpx.Response:
        return self._cassette.handle(request)
✕The Legacy Socket-Monkeypatch Danger

Global State Corruption in VCR/Responses

Legacy tools mutate `socket.socket` globally. When parallel test runners (e.g. `pytest-xdist`) run across async coroutines, socket monkey-patching leaks across threads, breaks unrelated database connections, and corrupts telemetry pipelines.

Risk: High flakiness & thread-safety violations
✓The VEXFOX Clean-Transport Standard

Scoped Python Transports via HTTPX

VEXFOX relies strictly on HTTPX's clean pluggable transport interface. Sockets outside the explicitly wrapped client remain completely untouched. Async event loops, database connection pools, and thread pools run in complete safety.

Guarantee: 100% thread-safe & zero global side effects
Verified Capabilities

Engineered for deterministic testing

Every capability in VEXFOX was built to solve the real frustrations of Python engineers maintaining test suites across payment APIs, auth providers, and microservices.

DUAL-STACK TRANSPORTS

Sync & Async HTTPX Native

First-class support for synchronous `httpx.Client` and coroutine-driven `httpx.AsyncClient` via clean transport wrappers without socket monkey-patching.

# Synchronous test with VexfoxSyncTransport
import httpx
import vexfox

with vexfox.use_cassette("fixtures/sync_users.json"):
    client = httpx.Client()
    response = client.get("https://api.github.com/user")
    assert response.status_code == 200
Zero thread contaminationTransport Hook Scoped
SECURITY GUARANTEE

In-Memory Secret Sanitization

Sanitizes sensitive headers, query tokens, and recursive JSON body keys in memory before cassette files ever touch the filesystem.

INTERCEPTED AUTH HEADER
Authorization: [REDACTED]
Target: Bearer, sk_live_*, JWTZero Disk Leakage
Pre-Persistence FilterACTIVE
SCHEMA V1 SPEC

Deterministic Cassette Schema

Persists to standard JSON Schema v1 with atomic file writes. Inspect, format, and validate recorded fixtures right from git diffs.

"version": "1.0",
"req_hash": "sha256:7f9a...",
"status": 200,
"duration_ms": 0.4
Deterministic JSONv1.0 Standard
PYTEST EXTENSION

Automatic Pytest Fixture

Ships with an automatic `vexfox` pytest fixture that manages cassette lifecycles, teardown cleanup, and test isolation per thread and task.

def test_profile(vexfox): with vexfox("user.json"): resp = httpx.get(...)
Zero Setup Fixturepytest-ready
DEVELOPER TOOLKIT

CLI Diagnostics Suite

$ vexfox doctor
✓ Cassettes valid: 14/14
✓ In-memory redaction verified
✓ HTTPX transport hooks healthy
CLI Diagnosticsvexfox --help
Determinism Metric

Sub-millisecond offline replay without socket allocation

Zero network requests during test runs. Eliminates CI flakiness across payment gateways, auth servers, and LLM APIs.

0.4ms
Avg Replay Time
0
Outbound Sockets
Integration Protocol

Minimal setup. Maximum test reliability.

No complex configuration files or global monkey-patching harnesses. A single context manager transforms standard HTTPX calls into deterministic, offline-replayable fixtures.

01

Install the package

Install directly from PyPI via pip, poetry, or uv.

pip install vexfox
02

Wrap test in use_cassette

Pass the cassette file path and optional mode.

with vexfox.use_cassette("fixtures/api.json"):
03

Record once with sanitization

Captures live interaction and scrubs credentials in memory.

pytest tests/test_api.py
04

Replay hermetically offline

Subsequent test executions run without outbound network sockets.

pytest tests/test_api.py # 0.4ms replay
test_suite.py
tests/test_sync.py
10 lines
import httpx
import vexfox

# First test run: calls live API, scrubs tokens, saves cassette.
# Subsequent runs: replays offline in 0.4ms without network sockets.
with vexfox.use_cassette("fixtures/users.json"):
    response = httpx.get("https://api.example.com/v1/users")
    assert response.status_code == 200
    data = response.json()
    assert len(data["users"]) > 0
Deterministic Replay VerifiedPython 3.11+
Security Architecture

Guarding secrets before fixtures touch the disk

Committing real credentials to git repositories is the #1 danger of recording HTTP fixtures. VEXFOX operates in-memory redaction pipelines before serialization.

Header Sanitization

FILTER 01

Automatically replaces Authorization, Proxy-Authorization, Cookie, Set-Cookie, X-Api-Key, X-Auth-Token, and ApiKey with [REDACTED].

Scrub Pattern:Authorization: Bearer [REDACTED]
PRE-PERSISTENCE SCRUB[REDACTED]

Query Parameter Scrubbing

FILTER 02

Redacts sensitive URL parameters such as api_key, token, secret, password, access_token, auth, and client_secret before persistence.

Scrub Pattern:?api_key=[REDACTED]&user_id=42
PRE-PERSISTENCE SCRUB[REDACTED]

Recursive JSON Field Traversal

FILTER 03

Traverses deeply nested JSON request and response dictionaries, redacting sensitive keys like password, token, and private_key.

Scrub Pattern:{"auth": {"token": "[REDACTED]"}}
PRE-PERSISTENCE SCRUB[REDACTED]

High-Entropy Pattern Scanners

FILTER 04

Regex filters automatically catch Bearer tokens, OpenAI API keys (sk-...), Stripe keys (sk_live_...), JWTs, and AWS access keys.

Scrub Pattern:sk_live_... -> [REDACTED]
PRE-PERSISTENCE SCRUB[REDACTED]

Honest Security Boundaries & Realistic Limits

VEXFOX scans supported plain-text and structural JSON payloads. It cannot inspect opaque proprietary binary formats or guarantee detection of novel, non-standard key names without custom regex rules. Always audit recorded cassettes before committing them to public git repositories.

SECURITY DOCS
●VEXFOX v0.1.0 AVAILABLE ON PYPI

Make your tests independent of the network.

Build a more predictable, secret-safe HTTP testing workflow with VEXFOX. Clean HTTPX transports, deterministic replay, and zero flakiness.

$pip install vexfox(click to copy)
MIT License•Python >= 3.11•HTTPX Native