feat(audit): add audit logging for box operations#403
Merged
Conversation
RocksDB-style EventListener for box operations. All callbacks default to no-op — users implement only the events they care about. - EventListener trait: on_box_created/started/stopped/removed, on_exec_started/completed, on_file_copied_in/out - AuditEventListener: built-in impl that records events in ring buffer - Register at runtime level via BoxliteOptions::event_listeners - Users own and query their listener directly (no per-box audit_log API) - Zero overhead when no listeners attached - 4 unit tests + 3 integration tests
6 tasks
lilongen
pushed a commit
to lilongen/boxlite
that referenced
this pull request
Mar 27, 2026
… mapping Bridge the Rust EventListener trait (boxlite-ai#403) to Python via PyO3, enabling push-based lifecycle callbacks (on_box_started, on_exec_completed, etc.). Replace generic PyRuntimeError with 15 typed exception classes inheriting from BoxliteError, using exhaustive match for compile-time completeness. Key changes: - PyEventListener bridge with duck-typing (missing methods silently skipped) - map_boxlite_err() maps all 18 BoxliteError variants to typed Python exceptions - event_listeners parameter on BoxliteOptions, propagated through RuntimeImpl - 165 Python tests covering exception hierarchy, isolation, and exports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6 tasks
lilongen
pushed a commit
to lilongen/boxlite
that referenced
this pull request
Apr 2, 2026
… mapping Bridge the Rust EventListener trait (boxlite-ai#403) to Python via PyO3, enabling push-based lifecycle callbacks (on_box_started, on_exec_completed, etc.). Replace generic PyRuntimeError with 15 typed exception classes inheriting from BoxliteError, using exhaustive match for compile-time completeness. Key changes: - PyEventListener bridge with duck-typing (missing methods silently skipped) - map_boxlite_err() maps all 18 BoxliteError variants to typed Python exceptions - event_listeners parameter on BoxliteOptions, propagated through RuntimeImpl - 165 Python tests covering exception hierarchy, isolation, and exports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
lilongen
pushed a commit
to lilongen/boxlite
that referenced
this pull request
Apr 21, 2026
… mapping Bridge the Rust EventListener trait (boxlite-ai#403) to Python via PyO3, enabling push-based lifecycle callbacks (on_box_started, on_exec_completed, etc.). Replace generic PyRuntimeError with 15 typed exception classes inheriting from BoxliteError, using exhaustive match for compile-time completeness. Key changes: - PyEventListener bridge with duck-typing (missing methods silently skipped) - map_boxlite_err() maps all 18 BoxliteError variants to typed Python exceptions - event_listeners parameter on BoxliteOptions, propagated through RuntimeImpl - 165 Python tests covering exception hierarchy, isolation, and exports Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
boxlite/src/audit/module withAuditRecorderandAuditEventtypesLiteBox::audit_log()public APIstart(),exec(),stop(),copy_into(),copy_out()audit_log()bindingTest plan
#[ignore], needs runtime