<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AiTraceDev</title>
    <description>The latest articles on DEV Community by AiTraceDev (@aitracedev_21).</description>
    <link>https://dev.to/aitracedev_21</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4076476%2F6905dd19-8b81-41ac-8575-cac3dabd355b.png</url>
      <title>DEV Community: AiTraceDev</title>
      <link>https://dev.to/aitracedev_21</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aitracedev_21"/>
    <language>en</language>
    <item>
      <title>How I built tamper-proof audit trails for AI decisions in .NET</title>
      <dc:creator>AiTraceDev</dc:creator>
      <pubDate>Thu, 13 Aug 2026 14:31:32 +0000</pubDate>
      <link>https://dev.to/aitracedev_21/how-i-built-tamper-proof-audit-trails-for-ai-decisions-in-net-429i</link>
      <guid>https://dev.to/aitracedev_21/how-i-built-tamper-proof-audit-trails-for-ai-decisions-in-net-429i</guid>
      <description>&lt;p&gt;Every time your app calls an LLM, a question hangs in the air: if something goes wrong, can you prove exactly what happened?&lt;/p&gt;

&lt;p&gt;Not a log file. Not a database record someone could edit. Actual cryptographic proof.&lt;/p&gt;

&lt;p&gt;That is the problem I built AiTrace.NET to solve.&lt;/p&gt;

&lt;p&gt;The problem with regular logging&lt;/p&gt;

&lt;p&gt;Application logs are great until they become evidence. A log file can be edited, deleted, or backdated. When a client disputes an AI-generated output, a timestamp in a database means nothing without proof of integrity.&lt;/p&gt;

&lt;p&gt;What AiTrace does differently&lt;/p&gt;

&lt;p&gt;Each decision record gets SHA-256 hashed. The hash of the previous record is embedded in the next one, creating a chain. Break the chain by modifying or removing any record, and verification fails immediately.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 1. Register in ASP.NET Core&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Services&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;AddAiTrace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;o&lt;/span&gt; &lt;span class="p"&gt;=&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;StoreContent&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;o&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;BasicRedaction&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// 2. Inject and log a decision&lt;/span&gt;
&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DecisionService&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;IAuditStore&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt; &lt;span class="nf"&gt;LogAsync&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;LogDecisionAsync&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;AiDecision&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;Prompt&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Summarize the contract."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;Output&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"The contract covers..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;Model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"gpt-4o"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;UserId&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"user-42"&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One NuGet package. No external service. No database required. Records are plain JSON files in a local folder you control.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;dotnet add package AiTrace --prerelease&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Who this is for&lt;/p&gt;

&lt;p&gt;Any .NET team using LLMs in a context where auditability matters: legal tech, fintech, healthcare, insurance, or any regulated space where "the AI said so" is not an acceptable answer.&lt;/p&gt;

&lt;p&gt;What is next&lt;/p&gt;

&lt;p&gt;The Pro tier adds RSA-SHA256 signatures per record, compliance reports, and sealed evidence bundles ready for legal review.&lt;/p&gt;

&lt;p&gt;The core package is MIT, open source, and free forever.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/aitrace-dotnet/AiTrace.NET" rel="noopener noreferrer"&gt;https://github.com/aitrace-dotnet/AiTrace.NET&lt;/a&gt;&lt;br&gt;
NuGet: &lt;a href="https://www.nuget.org/packages/AiTrace/0.1.0-preview.10" rel="noopener noreferrer"&gt;https://www.nuget.org/packages/AiTrace/0.1.0-preview.10&lt;/a&gt;&lt;br&gt;
Docs: &lt;a href="https://aitrace-dotnet.github.io/AiTrace.NET/" rel="noopener noreferrer"&gt;https://aitrace-dotnet.github.io/AiTrace.NET/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>csharp</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
