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.

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.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.11.1
File Size Uploaded Provenance Actions
singleaxis_fabric-0.11.1.tar.gz 711.1 kB With provenance Details for singleaxis_fabric-0.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 1.5 MB

Release files / singleaxis_fabric-0.11.1.tar.gz

Download URL singleaxis_fabric-0.11.1.tar.gz
Size 711.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7887406644ab3e6ced283af1759f108038ecb941d5607220094cc950ee1eea8c
BLAKE2b-256 checksum
How to use checksums
dddebef7fbcd9211ccc13bec6a7dcb08c0dec860e2a0292573cd3eabd8c75b76
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 6, 2026.

Transparency log

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

Download URL singleaxis_fabric-0.11.1-py3-none-any.whl
Size 796.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
225cb0c99325ab44464d3db7f277d5446cb09f9621e7e17e149ac0477d9a605f
BLAKE2b-256 checksum
How to use checksums
583021904f41bcf1f642362b458bd4e849a07781dec24d58f0b942aca2345895
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 6, 2026.

Transparency log

Security for singleaxis-fabric 0.11.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.11.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 6, 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.11.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