Skip to main content

TraceLock SDK

Guard side-effecting tool calls before they happen, then replay production traces offline.

pip install tracelock
export TRACELOCK_API_KEY="tlk_..."

For a local checkout, install with pip install ./TraceLock/sdk.

One-line wrapper

from tracelock import TraceLockClient, guard_call

client = TraceLockClient()

result = guard_call(
    client,
    "refund_user",
    {"user_id": "u_123", "amount": 50},
    lambda args: stripe.Refund.create(**args),
    idempotency_fields=["user_id", "amount"],
)

If TraceLock returns replay, in_progress, awaiting_approval, or denied, the side effect is not executed. If it returns execute, the wrapper runs the call and records the result/latency automatically.

CLI

tlock --api-key "$TRACELOCK_API_KEY" guard \
  --tool refund_user \
  --args '{"user_id":"u_123","amount":50,"reason":"retry"}' \
  --fields user_id,amount

tlock result --guard-id g_... --result '{"refund_id":"rf_1"}'
tlock export --trace-id tr_... --out trace.json
tlock replay --file trace.json
tlock statement

replay is fully offline: it verifies the Ed25519 signature using the public key embedded in the bundle (or --public-key) and never contacts a live API.

Notes

  • API key env: TRACELOCK_API_KEY
  • Base URL env: TRACELOCK_BASE_URL (default https://tracelock-pied.vercel.app)
  • tlock verify stores the API key in .tlock_key; add that file to .gitignore.

Metadata

Release files for tracelock 0.1.0

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

Source distribution (sdist)

Source distribution for tracelock 0.1.0
File Size Uploaded Provenance Actions
tracelock-0.1.0.tar.gz 7.7 kB Without provenance Details for tracelock-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 16.1 kB

Release files / tracelock-0.1.0.tar.gz

Download URL tracelock-0.1.0.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
595fc1ea875b1bad7ca2cbf90d3f6ab13fd8a09366aaefb7c3ce264367a892ee
BLAKE2b-256 checksum
How to use checksums
729b5c1a173904d52e7edb0c41bd0a5cd50311c69dc50f3ba74142acc0475359
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / tracelock-0.1.0-py3-none-any.whl

Download URL tracelock-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f05b3fdb71d0019afdd33267e1ef63a2879be9cfd27fe4a3905cfc91cec5f162
BLAKE2b-256 checksum
How to use checksums
178f4512632ecc32354621715c9b5d3845eabdec40eeea6c3708df3ca54d11aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for tracelock 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.1.0 This release

2 release files No 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