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
- Event Format - Event schema and canonicalization rules
- Integrations - LangChain and framework usage
- Security - Threat model and verification
- Changelog - Version history
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)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| lightbox_rec-0.1.0.tar.gz | 39.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lightbox_rec-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 66.8 kB
Release files / lightbox_rec-0.1.0.tar.gz
| Download URL | lightbox_rec-0.1.0.tar.gz |
|---|---|
| Size | 39.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31b3bbac771ea38a3fbb2a38158cb98430c3fd9bfcdabf530efb42a15c54ab3f
|
|
BLAKE2b-256 checksum How to use checksums |
422d336ed3611b71340aca81ef2afde43b1ac58a9a446c55d23596400da2c957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
Release files / lightbox_rec-0.1.0-py3-none-any.whl
| Download URL | lightbox_rec-0.1.0-py3-none-any.whl |
|---|---|
| Size | 27.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33b0d89bbc4befd080b4d81e5ec46acd4154079d18a70980d5917b61424c3fb7
|
|
BLAKE2b-256 checksum How to use checksums |
22291f5b1994ede42c320edf74583a00e67135fcc11c7dc2d67100bf23babe06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.8
|
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.