Skip to main content

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 through httpx, httpx2 or aiohttp, which covers the official openai and anthropic SDKs, LiteLLM, DSPy and frameworks built on them.
  • Explicit APIs: Fabric.decision() and its record_* methods, ByteEvidenceRecorder, CallRecorder and 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 the CallRecorder line.

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, plus FABRIC_CAPTURE_POLICY, FABRIC_WIRE_ID_KEY and FABRIC_WIRE_SPOOL_KEY. Without the policy and keys content capture is disabled (metadata continues) and every span says why.

The autoload never prints to the process's stdout or stderr (a child process an agent's tool starts inherits it, and its output is what the model reads). python -m fabric.wire status prints the configuration warnings it would log as one JSON line; FABRIC_WIRE_DIAGNOSTICS=stderr prints them from every autoloaded process.

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

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

Source distribution (sdist)

Source distribution for singleaxis-fabric 0.12.1
File Size Uploaded Provenance Actions
singleaxis_fabric-0.12.1.tar.gz 720.8 kB With provenance Details for singleaxis_fabric-0.12.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for singleaxis-fabric 0.12.1
File Interpreter ABI Platform Actions
singleaxis_fabric-0.12.1-py3-none-any.whl Python 3 none any Details for singleaxis_fabric-0.12.1-py3-none-any.whl

Total release size: 1.5 MB

Release files / singleaxis_fabric-0.12.1.tar.gz

Download URL singleaxis_fabric-0.12.1.tar.gz
Size 720.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9e4ef0e32585a12d4df55eedeec875c9a7152ebad22c13ea7c513249af9b174e
BLAKE2b-256 checksum
How to use checksums
8441944fa00f96cda18ade27e1d985f4affe02e7a780012a4038667c7b1e26ba
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 8, 2026.

Transparency log

Release files / singleaxis_fabric-0.12.1-py3-none-any.whl

Download URL singleaxis_fabric-0.12.1-py3-none-any.whl
Size 806.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d409100d54d2a72eeeaef236b960c1181aafc1457119f5521806e2ec3f588c8
BLAKE2b-256 checksum
How to use checksums
ada8eb7e6b35b3b9a2c182837ff10d1cddd034c7b17211ac5fa42474f3ad62e1
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 8, 2026.

Transparency log

Security for singleaxis-fabric 0.12.1

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 singleaxis_fabric-0.12.1.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 8, 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.

Release history Release notifications | RSS feed

This release

0.12.1 This release

2 release files Full provenance

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