<?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: Oğuzhan TOPCU</title>
    <description>The latest articles on DEV Community by Oğuzhan TOPCU (@oguzhantopcu).</description>
    <link>https://dev.to/oguzhantopcu</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%2F4057111%2F3333980d-ec81-4b06-8830-48c66acec425.png</url>
      <title>DEV Community: Oğuzhan TOPCU</title>
      <link>https://dev.to/oguzhantopcu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/oguzhantopcu"/>
    <language>en</language>
    <item>
      <title>wardcat: On-Premise Data Privacy Architecture for RAG and LLM Projects</title>
      <dc:creator>Oğuzhan TOPCU</dc:creator>
      <pubDate>Fri, 18 Sep 2026 20:53:46 +0000</pubDate>
      <link>https://dev.to/oguzhantopcu/wardcat-on-premise-data-privacy-architecture-for-rag-and-llm-projects-1b2p</link>
      <guid>https://dev.to/oguzhantopcu/wardcat-on-premise-data-privacy-architecture-for-rag-and-llm-projects-1b2p</guid>
      <description>&lt;p&gt;Hey folks! &lt;/p&gt;

&lt;p&gt;I developed and published &lt;strong&gt;wardcat&lt;/strong&gt; on PyPI to solve the security risks of sending enterprise data to third-party LLM APIs and to prevent data leaks in RAG pipelines completely on-premise. Going beyond simple pattern matching, I built a hybrid layered architecture that integrates Regex, SpaCy NER, and local open-weights LLMs (such as Qwen3:14b). Thanks to this architecture, sensitive data in texts is not only detected with high accuracy; texts anonymized using the reversible masking feature can be restored to their original form after LLM processing, and with the is_sensitive() function, prompts are passed through a contextual security filter before being processed.&lt;/p&gt;

&lt;p&gt;To install directly from PyPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;wardcat
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To validate the architecture, here is a concise summary of the benchmark results compared against Microsoft Presidio, which is widely considered the industry standard:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Test Scenario / Corpus&lt;/th&gt;
&lt;th&gt;Presidio&lt;/th&gt;
&lt;th&gt;wardcat &lt;em&gt;(Regex + NER)&lt;/em&gt;
&lt;/th&gt;
&lt;th&gt;wardcat &lt;em&gt;(LLM Layer)&lt;/em&gt;
&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Presidio Corpus&lt;/strong&gt; &lt;em&gt;(1,500 samples - F1)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;0.703&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.759&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Independent Corpus&lt;/strong&gt; &lt;em&gt;(Gretel Finance - F1)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;0.462&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.504&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Challenging Scenarios&lt;/strong&gt; &lt;em&gt;(100 cases - F1)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;0.838&lt;/td&gt;
&lt;td&gt;0.875&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.920&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Sensitivity Classification&lt;/strong&gt; &lt;em&gt;(100 texts - Accuracy)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;63%&lt;/td&gt;
&lt;td&gt;72%&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;88%&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;As clearly shown in the table, while the rule-based (Regex) and linguistic (NER) layers alone outperform Presidio, an F1 score of 0.920 is achieved in challenging cases with the wardcat LLM layer. Especially when understanding the overall sensitivity of a text, the is_sensitive() filter performs far beyond traditional rule engines with 88% accuracy. These results prove how critical it is to use a hybrid, layered architecture to eliminate data leakage rather than relying on a single detection method.  &lt;/p&gt;

&lt;p&gt;If you'd like to secure your own on-premise pipelines, feel free to check out the project. Please feel free to reach out to me to contribute, share new ideas, or ask any questions!&lt;/p&gt;

&lt;p&gt;github: &lt;a href="https://github.com/oguzhantopcu0/wardcat" rel="noopener noreferrer"&gt;https://github.com/oguzhantopcu0/wardcat&lt;/a&gt;&lt;br&gt;
docs:   &lt;a href="https://docs.wardcat.com/" rel="noopener noreferrer"&gt;https://docs.wardcat.com/&lt;/a&gt;&lt;br&gt;
pypi:   &lt;a href="https://pypi.org/project/wardcat/" rel="noopener noreferrer"&gt;https://pypi.org/project/wardcat/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>security</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
