<?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: Pedro Dawybida França</title>
    <description>The latest articles on DEV Community by Pedro Dawybida França (@pedrodawybida).</description>
    <link>https://dev.to/pedrodawybida</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%2F3014439%2Fa8de6bda-ba06-4c79-affd-73bbdcc1793f.jpeg</url>
      <title>DEV Community: Pedro Dawybida França</title>
      <link>https://dev.to/pedrodawybida</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pedrodawybida"/>
    <language>en</language>
    <item>
      <title>I Built an Ultra-Fast (&lt;0.1ms) Go Reverse Proxy to Guard Autonomous AI Agents</title>
      <dc:creator>Pedro Dawybida França</dc:creator>
      <pubDate>Mon, 27 Jul 2026 16:41:14 +0000</pubDate>
      <link>https://dev.to/pedrodawybida/i-built-an-ultra-fast-01ms-go-reverse-proxy-to-guard-autonomous-ai-agents-26gp</link>
      <guid>https://dev.to/pedrodawybida/i-built-an-ultra-fast-01ms-go-reverse-proxy-to-guard-autonomous-ai-agents-26gp</guid>
      <description>&lt;p&gt;Autonomous AI Agents powered by frameworks like LangChain, CrewAI, AutoGen, and OpenAI SDK are revolutionizing automation through &lt;strong&gt;Tool-Calling&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;However, giving an LLM unsupervised access to execute raw HTTP endpoints or database operations introduces severe security and privacy risks. An unguided AI agent could trigger destructive mutations (&lt;code&gt;DELETE /transactions&lt;/code&gt;) or leak sensitive customer data (&lt;code&gt;GET /customers&lt;/code&gt;) violating privacy laws (such as LGPD) and central bank cybersecurity resolutions (CMN 5.274 / BACEN 538/2025).&lt;/p&gt;

&lt;p&gt;To solve this, I built and open-sourced &lt;strong&gt;Aegis Core&lt;/strong&gt; 🛡️.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 What is Aegis Core?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Aegis Core&lt;/strong&gt; is an open-source, ultra-low latency HTTP reverse proxy written in Go that sits between your AI Agents and your internal backend APIs.&lt;/p&gt;

&lt;p&gt;It evaluates every incoming agent tool-call against $O(1)$ in-memory compliance policy rules, &lt;strong&gt;proactively blocking dangerous requests&lt;/strong&gt; before they reach your backend, and recording immutable JSON audit logs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;flowchart LR
    A[🤖 AI Agent / LLM Tool-Call] --&amp;gt;|Bearer Token + HTTP Req| B[🛡️ Aegis Core Proxy]
    B --&amp;gt;|Check Policy O1| C{Compliance Valid?}
    C --&amp;gt;|YES - ALLOWED| D[🟢 Internal Backend API]
    C --&amp;gt;|NO - BLOCKED| E[🔴 403 Forbidden Response]
    B --&amp;gt;|Immutable JSON Log| F[📜 audit_bacen.log]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚡ Engineering &amp;amp; Architecture Highlights
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Ultra-Low Overhead (~0.08ms per request)
&lt;/h3&gt;

&lt;p&gt;Benchmarked using Go's native testing package (&lt;code&gt;go test -bench&lt;/code&gt;), Aegis adds under &lt;strong&gt;0.1ms&lt;/strong&gt; latency overhead per request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;BenchmarkAegisProxy-10    14493    81553 ns/op    40859 B/op    95 allocs/op
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Thread-Safe Audit Logging
&lt;/h3&gt;

&lt;p&gt;The audit logger uses a &lt;code&gt;sync.Mutex&lt;/code&gt; lock to guarantee atomic JSON line writes under heavy concurrent HTTP request loads without log corruption or race conditions.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Graceful Shutdown &amp;amp; Health Endpoints
&lt;/h3&gt;

&lt;p&gt;The server handles OS interrupt signals (&lt;code&gt;SIGINT&lt;/code&gt;, &lt;code&gt;SIGTERM&lt;/code&gt;) cleanly via &lt;code&gt;signal.Notify&lt;/code&gt; and &lt;code&gt;context.WithTimeout&lt;/code&gt;, closing active connections and flushing log files safely.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Embedded Visual Web Console
&lt;/h3&gt;

&lt;p&gt;It serves an embedded glassmorphism Web Console at &lt;code&gt;http://localhost:8080/_aegis/dashboard&lt;/code&gt; for live inspection, policy card viewing, and interactive tool-call simulations out of the box.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Quickstart: Running the 5-Second Interactive Demo
&lt;/h2&gt;

&lt;p&gt;You can test Aegis blocking non-compliant requests in seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/pedrodawybida/aegis-core.git
&lt;span class="nb"&gt;cd &lt;/span&gt;aegis-core
make demo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The demo script:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Spawns a mock backend banking API on port 9000.&lt;/li&gt;
&lt;li&gt;Builds and starts Aegis Core on port 8080.&lt;/li&gt;
&lt;li&gt;Tests 4 compliance scenarios (Allowed POST, Blocked LGPD GET, Blocked BACEN DELETE, Blocked CFM GET).&lt;/li&gt;
&lt;li&gt;Displays the generated immutable JSON audit log in real time.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🛠️ Zero-Code Integration Example
&lt;/h2&gt;

&lt;p&gt;Developers don't need to rewrite their agent logic. Simply update your OpenAI SDK or HTTP client's &lt;code&gt;base_url&lt;/code&gt; to point to Aegis:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://aegis-proxy.internal:8080&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Point to Aegis Proxy
&lt;/span&gt;    &lt;span class="n"&gt;default_headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Authorization&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Bearer ia-fintech-support&lt;/span&gt;&lt;span class="sh"&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;h2&gt;
  
  
  🔗 Try it out &amp;amp; Contribute!
&lt;/h2&gt;

&lt;p&gt;Aegis Core is 100% Open-Source under the MIT License.&lt;/p&gt;

&lt;p&gt;⭐ &lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/pedrodawybida/aegis-core" rel="noopener noreferrer"&gt;github.com/pedrodawybida/aegis-core&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback on Go concurrency, performance benchmarks, and security rules! Feel free to star the repo or open an issue! 🚀&lt;/p&gt;

</description>
      <category>go</category>
      <category>ai</category>
      <category>security</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
