Rag.NET.Security.Audit.Sqlite
1.0.0
dotnet add package Rag.NET.Security.Audit.Sqlite --version 1.0.0
NuGet\Install-Package Rag.NET.Security.Audit.Sqlite -Version 1.0.0
<PackageReference Include="Rag.NET.Security.Audit.Sqlite" Version="1.0.0" />
<PackageVersion Include="Rag.NET.Security.Audit.Sqlite" Version="1.0.0" />
<PackageReference Include="Rag.NET.Security.Audit.Sqlite" />
paket add Rag.NET.Security.Audit.Sqlite --version 1.0.0
#r "nuget: Rag.NET.Security.Audit.Sqlite, 1.0.0"
#:package Rag.NET.Security.Audit.Sqlite@1.0.0
#addin nuget:?package=Rag.NET.Security.Audit.Sqlite&version=1.0.0
#tool nuget:?package=Rag.NET.Security.Audit.Sqlite&version=1.0.0
Rag.NET.Security.Audit.Sqlite
SQLite-backed audit logging for Rag.NET.Security: records retrieval and answer events to a local database file, with the audit behaviour and the answer-engine decorator wired in one call.
Install
dotnet add package Rag.NET.Security.Audit.Sqlite
Setup
using Rag.NET.DependencyInjection;
using Rag.NET.Security;
services.AddRagNet(rag => rag
.UseSqliteAuditLog(o =>
{
o.DatabasePath = "rag-audit.db";
o.LogQueryText = true; // off by default
o.LogAnswerText = true; // off by default
}));
LogQueryText and LogAnswerText are off by default: the audit record captures that a retrieval
and an answer happened, with their correlation, without persisting the text unless you ask for it.
UseSqliteAuditLog must be called after AddRagNet — it adds a behaviour to the retrieval pipeline
that AddRagNet registers. Calling it first throws InvalidOperationException naming the problem.
Registration order relative to the answer engines does not matter. The decorator is added to the
answer-engine decoration seam rather than by registering IAnswerEngine, so
rag.UseSqliteAuditLog().UseMapReduceAnswerEngine() and the reverse both audit every answer.
Why this is a separate package
SqliteAuditLog used to live in Rag.NET.Security, which meant Microsoft.Data.Sqlite and a
native SQLitePCLRaw binary shipped to everyone using UseChunkSanitiser, UseRbac or
UsePiiDetection — none of which load it
(#339).
Migrating from 0.1.0
UseAuditLog() no longer exists. Two steps, and no using changes — the namespace is deliberately
still Rag.NET.Security:
- Add a package reference to
Rag.NET.Security.Audit.Sqlite. - Rename
UseAuditLog(…)toUseSqliteAuditLog(…).
Forgetting step 2 is a compile error, not a silent gap. The wiring that registers the audit
behaviour and the answer decorator is internal to Rag.NET.Security and reachable only from a
package that also supplies an IAuditLog, so "auditing configured, nothing recorded" cannot be
expressed. An audit log that silently records nothing is worse than a build error.
Bringing your own log
IAuditLog lives in Rag.NET.Security. This package is one implementation of it; a different
backing store would be a sibling package registering its own IAuditLog and composing the same
internal wiring.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Data.Sqlite (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Rag.NET (>= 1.0.0)
- Rag.NET.Abstractions (>= 1.0.0)
- Rag.NET.Security (>= 1.0.0)
- SQLitePCLRaw.bundle_e_sqlite3 (>= 3.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 79 | 9/15/2026 |