SingleAxis Fabric SDK for Python
singleaxis-fabric records what a Python AI agent does, protects the record
inside the process before it reaches disk, and delivers it to storage you
own. It never blocks, alters or delays the agent.
CAPTURE -> PROTECT -> DELIVER
It provides:
- Zero-code wire capture (
fabric.wire): the exact request and response bytes of every model call sent throughhttpx,httpx2oraiohttp, which covers the officialopenaiandanthropicSDKs, LiteLLM, DSPy and frameworks built on them. - Explicit APIs:
Fabric.decision()and itsrecord_*methods,ByteEvidenceRecorder,CallRecorderand byte-boundary adapters, for activity the application reports itself. python -m fabric.reconstruct: an offline verifier that states whether each run's record is complete and unaltered.- Qualified-run mode (
fabric.qualified_run): opt-in, receipt- and witness-backed verification for theCallRecorderline.
Requires Python 3.11+. Linux and macOS; node mode (the production profile) needs POSIX.
Install
pip install "singleaxis-fabric[otlp]"
Extras: otlp (OTLP exporter and spool encryption; needed for node mode),
s3 (boto3, for reading an S3 store with fabric.reconstruct; agents never
need it), mcp (MCP client instrumentation), signing (Ed25519 for
qualified-run mode). Wire capture uses whichever of httpx, httpx2 and
aiohttp your application already installs.
Zero-code wire capture
Installing the package enables nothing. Turn capture on per process:
export PYTHONPATH="$(python -m fabric.wire --print-autoload-path)${PYTHONPATH:+:$PYTHONPATH}"
export FABRIC_WIRE_AUTOLOAD=1
then choose where records go:
- Local profile (development):
FABRIC_WIRE_STORE=file:///abs/dir,FABRIC_TENANT_ID, and an OTLP endpoint for the spans (OTEL_EXPORTER_OTLP_ENDPOINT). - Production profile (node mode):
FABRIC_WIRE_CONTENT_ENDPOINT,FABRIC_WIRE_SPOOL_DIR,FABRIC_TENANT_ID,FABRIC_SOURCE_ID, the Node's OTLP endpoint and credentials, plusFABRIC_CAPTURE_POLICY,FABRIC_WIRE_ID_KEYandFABRIC_WIRE_SPOOL_KEY. Without the policy and keys content capture is disabled (metadata continues) and every span says why.
Or install from code:
from fabric import wire
wire.install_from_env() # what the autoload does; None (one warning) if invalid
with wire.run("order-1234"): # optional run scope, emitted as an r- pseudonym
... # model calls here are captured
wire.flush() # optional; capture also drains at exit
wire.install(...) takes the same settings as keyword arguments (store=,
content_endpoint=, transformations=, ...) and raises on an invalid
configuration.
Matched by default: api.openai.com, api.anthropic.com,
*.openai.azure.com; add other hosts with FABRIC_WIRE_ENDPOINTS. Matched
APIs: chat completions, responses, completions, embeddings, messages.
aiohttp calls are captured too (FABRIC_WIRE_AIOHTTP=0 turns that off).
A model call through requests or urllib3 is not captured; it is
recorded as an uninstrumented_client loss, so its run is partial.
Verify offline:
python -m fabric.reconstruct --spans <span files> --store-root <store> --tenant <tenant>
See the quickstart, deployment and reconstruct.
Explicit APIs
from fabric import Fabric, FabricConfig, install_default_provider
install_default_provider(service_name="my-agent") # metadata-only exporter from OTEL_EXPORTER_OTLP_ENDPOINT
fabric = Fabric(FabricConfig(tenant_id="demo", agent_id="my-agent"))
with fabric.decision(session_id="session-1", request_id="request-1") as decision:
with decision.llm_call(provider="openai", model="gpt-4o-mini") as call:
call.set_usage(input_tokens=5, output_tokens=6, finish_reason="stop")
with decision.tool_call("lookup_order", call_id="tool-1") as tool:
tool.set_arguments('{"order_id": "order-123"}')
tool.set_result('{"status": "shipped"}')
Payloads are hashed, not recorded. Session, user and similar ids are
emitted as keyed pseudonyms and omitted without FABRIC_WIRE_ID_KEY
(FABRIC_IDENTITY_MODE=clear emits them unchanged).
CallRecorder records exact bytes at your dispatcher's final model and
tool boundaries, with call, attempt and stream identity:
from fabric import ByteEvidenceConfig, ByteEvidenceRecorder, CallRecorder, LocalFilesystemContentStore
recorder = ByteEvidenceRecorder(ByteEvidenceConfig(
store=LocalFilesystemContentStore(root="./evidence", tenant_id="demo"),
roles=frozenset({"model.request.messages", "model.output.messages"}),
))
calls = CallRecorder(recorder, run_id="run-1", agent_id="support-agent", source_id="host-a")
reply = calls.call(request_bytes, send_to_model, kind="model")
recorder.close()
Privacy is set per content role (BytePrivacyPolicy, or a
DeploymentPolicy with ContentProtector). Masking is done by a
redaction service you run beside the application
(FABRIC_REDACTION_ENDPOINT, a Unix socket or loopback port; protocol
contracts/redaction/v1); you name the transformation by id and version.
Fabric runs no customer code, and a failure withholds the content.
Full reference: explicit APIs, privacy and security, qualified-run mode.
Not in this package
Framework adapters and auto-instrumentation extras were removed in v0.8; wire capture replaces them. The package contains no evaluation, scoring or control code, and nothing in it can block or change an agent's request. See limitations and the changelog.
Development
uv sync --all-extras --dev
uv run pytest
uv run ruff check src tests
uv run mypy src
Metadata
Release files for singleaxis-fabric 0.11.0
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 |
|---|---|---|---|---|
| singleaxis_fabric-0.11.0.tar.gz | 698.9 kB | With provenance | Details for singleaxis_fabric-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| singleaxis_fabric-0.11.0-py3-none-any.whl | Python 3 | none | any | Details for singleaxis_fabric-0.11.0-py3-none-any.whl |
Total release size: 1.5 MB
Release files / singleaxis_fabric-0.11.0.tar.gz
| Download URL | singleaxis_fabric-0.11.0.tar.gz |
|---|---|
| Size | 698.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6803e42fad9e742025f635a80e1344d5b492254f2d385787ff4fd78011db3eea
|
|
BLAKE2b-256 checksum How to use checksums |
af9a0fb86aab2aaeeacd0da7b58e449c6229ffec04be6548b4ce564a6d5426ec
|
| 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 Nov 5, 2026.
Transparency logRelease files / singleaxis_fabric-0.11.0-py3-none-any.whl
| Download URL | singleaxis_fabric-0.11.0-py3-none-any.whl |
|---|---|
| Size | 783.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9cd8c68deb4748576deaac2a5b569b0ec993df17f58d628bb346389a2ffa6a95
|
|
BLAKE2b-256 checksum How to use checksums |
0916c3e542e6d191b2706eaf20308d90935bc0f5cb3060e6fecf8c21e95e5889
|
| 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 Nov 5, 2026.
Transparency logSecurity for singleaxis-fabric 0.11.0
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.
Attestation for singleaxis_fabric-0.11.0.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 Nov 5, 2026.
Transparency logA 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.