This repository was archived by the owner on Mar 21, 2026. It is now read-only.
feat: Audit Logging Integration - #50
Merged
Merged
Conversation
## Providers Crate - Add AuditedBackend wrapper for LLM backends - Logs LLM request/response events with token usage - Logs errors on failed inferences - Optional via 'audit' feature flag - 2 new tests ## Agents Crate - Add AuditedExecutor wrapper for ToolExecutor - Logs tool executions with parameters and results - Logs approval decisions (approved/denied/skipped) - Optional via 'audit' feature flag - 3 new tests ## Dashboard Crate - Add audit module with REST API endpoints - GET /api/audit/events - list events with filtering - GET /api/audit/stats - aggregated statistics - HTTP request audit middleware - Optional via 'audit' feature flag - 4 new tests ## Audit Types - Add AuditEvent::llm_response() convenience constructor All audit integrations are behind feature flags for opt-in usage.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Integrates the existing audit crate into the production code path, enabling comprehensive audit logging for LLM operations, tool execution, and HTTP requests.
Changes
Providers Crate (
auditfeature)LlmRequestevents before inferenceLlmResponseevents with token usage after inferenceErrorevents on failuresAgents Crate (
auditfeature)ToolCallevents with parameters and resultsApprovalDecisionevents for denied/skipped toolsErrorevents for approval errorsDashboard Crate (
auditfeature)GET /api/audit/events- List events with filtering (event_type, trace_id, session_id, agent_id, pagination)GET /api/audit/stats- Aggregated statistics by event typeAudit Types Enhancement
AuditEvent::llm_response()convenience constructorTesting
Usage
Feature Flags
All integrations are opt-in via feature flags:
rust-ai-agents-providers/auditrust-ai-agents-agents/auditrust-ai-agents-dashboard/audit