Skip to main content

Lightbox

Flight recorder for AI agents. Append-only, tamper-evident tool execution logs.

What it is / isn't

  • Records tool calls (send_email, read_file, api_call) - not LLM prompts/responses
  • Append-only JSONL with SHA-256 hash chaining
  • Offline verification - no network needed
  • Local-first - sessions are portable directories you can zip and share
  • Not a debugger, profiler, or execution controller - recording only

Quickstart

pip install lightbox-rec

SDK Usage

from lightbox import Session

session = Session()
session.emit("send_email", {"to": "user@example.com"}, {"success": True})
session.emit("read_file", {"path": "/data.txt"}, {"content": "Hello"})

LangChain Integration

from lightbox.integrations.langchain import wrap

agent = wrap(your_agent)  # Automatically records tool calls
agent.invoke({"input": "Do the thing"})

CLI

lightbox list                    # Show all sessions
lightbox show <session>          # Display events
lightbox replay <session>        # Animated playback
lightbox verify <session>        # Check integrity

Where logs live

~/.lightbox/sessions/<session_id>/
    events.jsonl     # Append-only event log
    meta.json        # Session metadata

Override with LIGHTBOX_DIR environment variable.

Exit codes (verify)

Code Status Meaning
0 VALID All checks pass
1 TAMPERED Hash mismatch or chain break
2 TRUNCATED Incomplete last line (crash mid-write)
3 PARSE_ERROR Invalid JSON in event file
4 NOT_FOUND Session doesn't exist

Redaction

from lightbox import Session, RedactionConfig

config = RedactionConfig(
    redact_keys=["api_key", "password"],  # Always redact
    max_inline_bytes=64 * 1024,           # Hash content over 64KB
)
session = Session(redaction_config=config)

Documentation

License

MIT - see LICENSE

Metadata

Release files for lightbox-rec 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 lightbox-rec 0.1.0
File Size Uploaded Provenance
lightbox_rec-0.1.0.tar.gz 39.5 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 66.8 kB

Security for lightbox-rec 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