<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Apurv Garg on Medium]]></title>
        <description><![CDATA[Stories by Apurv Garg on Medium]]></description>
        <link>https://medium.com/@apurv_61269?source=rss-446a5595b134------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BNICoRQOnC1yaQtubDm4Bg.png</url>
            <title>Stories by Apurv Garg on Medium</title>
            <link>https://medium.com/@apurv_61269?source=rss-446a5595b134------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:04:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@apurv_61269/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[From Packets to Agent Chains: eBPF for AI Runtime Security]]></title>
            <link>https://medium.com/@apurv_61269/from-packets-to-agent-chains-ebpf-for-ai-runtime-security-699337ff602d?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/699337ff602d</guid>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Wed, 25 Feb 2026 07:00:54 GMT</pubDate>
            <atom:updated>2026-02-25T07:00:54.606Z</atom:updated>
            <content:encoded><![CDATA[<h4>Reconstructing multi-step agent workflows from runtime signals, without app instrumentation or inline latency.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z-d2VXWURfpDbOej.png" /></figure><h3>TL;DR</h3><ul><li><strong>Problem</strong>: AI agents chain multiple tools autonomously. Each action is authorized individually, but workflow combinations can violate policy</li><li><strong>Challenge</strong>: Traditional monitoring sees encrypted HTTPS calls, not semantic intent (which LLM, what data, which tools)</li><li><strong>Solution</strong>: Extended our eBPF protocol intelligence layer to parse AI protocols (OpenAI API, Pinecone, vector DBs) and reconstruct multi-step agent chains</li><li><strong>Technical Approach</strong>: FSM-based parsers in userspace extract LLM calls, tool invocations, and PII propagation. Aggregator stitches into complete workflows</li><li><strong>Results</strong>: 5M+ network calls/day monitored with &lt;2% CPU overhead, &gt;99% extraction accuracy, zero inline latency</li><li><strong>Impact</strong>: Chain-level policy enforcement catches violations traditional tools miss: data exfiltration, prompt injection, and unauthorized tool use</li></ul><p><em>This post builds on our </em><a href="https://akashmandal001.substack.com/p/ebpf-data-monitoring-protocol-intelligence-layer"><em>original eBPF intelligence layer</em></a><em> work, extending database protocol parsing to the AI agent ecosystem. In the agentic era, the security unit of work is the chain. A single autonomous workflow spans LLM calls, vector searches, database queries, and external APIs. Each action is authorized individually, but combinations can violate policy. This post shows how we adapted our eBPF-based intelligence layer to reconstruct multi-step agent workflows and translate raw runtime telemetry into semantic actions: which model, what tools, which data, where it went, all without adding latency to your AI applications.</em></p><h3>The Problem: When Every Permission Passes But the Chain Violates Policy</h3><p>Consider a team using <a href="https://openclaw.ai/">OpenClaw</a>, an open-source AI assistant that autonomously executes tasks across their infrastructure. The agent has all the right permissions: it can query the customer database (read access granted), call its configured LLM API (credentials configured), create Jira tickets (OAuth token valid), and upload files to S3 (IAM role assigned). Every authorization check passes.</p><p>Thanks for reading! Subscribe for free to receive new posts and support my work.</p><p>Then your security team notices something: the agent queried 10,000 customer records, sent them all to the LLM in a series of API calls, compressed the responses, and uploaded the archive to a personal S3 bucket. Each individual action was authorized. The chain was data exfiltration.</p><p>Traditional security tools miss this:</p><ul><li>Your API gateway logged 10,000 database queries (normal volume for a busy support workload)</li><li>Your network firewall saw HTTPS traffic to api.openai.com (expected for an AI feature)</li><li>Your DLP might catch the S3 upload if it can decrypt and inspect the payload, but it won’t tell you the data originated from database queries, was processed by LLM calls, and represents a policy violation</li></ul><p><strong>The root cause: agents need broad permissions to function, so individual authorization checks pass. Risk emerges from the sequence and destination of actions, not from any single permission.</strong></p><h3>Building on Database Protocol Intelligence</h3><p>In our <a href="https://akashmandal001.substack.com/p/ebpf-data-monitoring-protocol-intelligence-layer">previous work on eBPF protocol intelligence</a>, we built a three-layer architecture for database monitoring: kernel-level capture, user-space FSM parsing, and centralized intelligence aggregation. That same architecture extends naturally to AI observability — the kernel capture stays identical, the FSM parsers target AI protocols (OpenAI API, Anthropic, vector DBs) instead of databases, and the aggregator adds chain reconstruction logic.</p><p>The key difference: AI agents orchestrate multi-step workflows autonomously. A single task spans:</p><ul><li>LLM decides which tools to invoke</li><li>Database queries retrieve customer data</li><li>Vector searches pull similar cases from knowledge base</li><li>LLM synthesizes response with retrieved context</li><li>Agent pushes results to Jira, Slack, external APIs, file systems</li></ul><p>The risk lives in the chain. You can’t catch it by auditing individual API calls.</p><h3><strong>Why existing approaches fall short:</strong></h3><ul><li><strong>Tools and frameworks evolve too fast</strong>: LangChain, LlamaIndex, custom frameworks have no standard instrumentation</li><li><strong>Workflows cross boundaries</strong>: Microservices, databases, vector stores, external SaaS APIs</li><li><strong>Encryption hides semantics</strong>: TLS is universal in production. You see “HTTPS to api.openai.com” instead of “GPT-4 call with 2000 tokens of customer PII”. As we explored in <a href="https://akashmandal001.substack.com/p/the-ssltls-trap-why-your-database">our SSL/TLS monitoring deep-dive</a>, traditional approaches to encrypted traffic lack protocol-aware parsing.</li><li><strong>Application instrumentation doesn’t scale</strong>: Asking every team to propagate request context perfectly becomes an org-wide migration project</li></ul><p><strong>The solution: runtime observation.</strong> Observe where actions execute, parse protocols to extract semantics, stitch events into chains, evaluate workflow-level policies.</p><p>That’s the intelligence layer we built on eBPF. Kernel-level capture for visibility. Finite state machines for protocol parsing. Cross-service correlation for chain reconstruction. Policy evaluation on workflows, not individual calls.</p><h3>The Runtime Intent Stack</h3><p>To make sense of agentic workflows, we need to transform raw runtime data through multiple layers of intelligence. Here’s the mental model:</p><p><strong>Layer 1: Sensing</strong> — Capture raw runtime events using eBPF: network packets, process spawns, DNS lookups, syscalls. This is where most eBPF projects stop.</p><p><strong>Layer 2: Chaining</strong> — Stitch events into execution graphs using process trees, connection keys, and timestamps. A single workflow becomes a connected sequence rather than isolated events.</p><p><strong>Layer 3: Semantics</strong> — Translate low-level bytes into high-level meaning: “LLM API call to GPT-4 with customer PII” instead of “HTTPS POST to api.openai.com with 2KB payload.”</p><p><strong>Layer 4: Judgment</strong> — Evaluate appropriateness using chain-level policies: “This agent queried 1 customer record (normal) then uploaded to pastebin (violation).”</p><p><strong>Layer 5: Action</strong> — Alert security teams, flag policy violations, and provide forensic evidence for investigation. Always post-facto because agents move too fast for inline gating.</p><p>Sensing alone gives you telemetry. Adding semantics enables security.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zc2opJRtYTVy1kZc.png" /></figure><p>Five layers transform a raw “HTTPS POST to api.openai.com” into “GPT-4 call, 2000 PII tokens, tool: query_db”, without touching the application path</p><h3>Inferring Intent from Workflow Patterns</h3><p>Intent signals come from observable, repeatable patterns in the chain:</p><ul><li>sequence of tools used</li><li>sensitivity of data touched</li><li>volume and shape (single row lookup vs bulk export)</li><li>destinations (internal service vs unknown external domain)</li><li>transformations (compression, encoding, file writes)</li><li>time window and repetition (burst behavior, loops, retries)</li></ul><p>This is why runtime chaining matters: intent is rarely contained in a single packet or a single log line.</p><h3>The Architecture: From Packets to Runtime Intent</h3><p>We use the same distributed collector-aggregator architecture from our database monitoring work, adapted for AI protocols:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*a4dm2C1D9kx9eWFU.png" /></figure><p>A DaemonSet collector on every Kubernetes node captures raw packets at the kernel. A centralized aggregator reconstructs the full agent chain, tracks PII, and enforces policy, no instrumentation required</p><h3>From eBPF Capture to Semantic AI Events</h3><h3>Kernel: Stable Connection Tracking</h3><p>The kernel layer is identical to our database monitoring approach (<a href="https://akashmandal001.substack.com/p/how-outsmarting-a-system-constraint">detailed in our performance optimization post</a>): eBPF programs attach process identity (TGID, container context), track socket direction (request vs response), and generate connection keys for chaining. The kernel emits stable anchors. Userspace builds meaning.</p><h3>Userspace: FSMs for AI Protocols</h3><p>We use the same FSM approach from database monitoring, but AI protocols add new challenges: <strong>streaming responses</strong> (SSE tokens arriving incrementally), <strong>tool calls in JSON</strong> (nested function definitions), and <strong>multi-provider variations</strong> (OpenAI vs Anthropic vs Azure OpenAI).</p><p>Here’s the OpenAI API FSM:</p><p><strong>OpenAI API FSM (simplified)</strong></p><pre>IDLE → TLS_HANDSHAKE → HTTP2_CONNECTED → HEADERS_RECEIVED<br>  → CHAT_COMPLETION_REQUEST → DATA_STREAMING → RESPONSE_COMPLETE → IDLE</pre><p>When a connection opens, we’re in IDLE. The TLS handshake moves us to HTTP2_CONNECTED. When we see HEADERS frames with :path=/v1/chat/completions, we transition to CHAT_COMPLETION_REQUEST. As DATA frames arrive, we buffer and parse JSON, extracting the model name, token counts, and tool definitions. When we see the response’s END_STREAM flag, we emit a complete semantic event and return to IDLE.</p><p><strong>Pinecone gRPC FSM (simplified)</strong></p><pre>IDLE → GRPC_HANDSHAKE → SERVICE_READY → QUERY_REQUEST<br>  → QUERY_RESPONSE → RESULT_STREAMING → RESPONSE_COMPLETE → IDLE</pre><p>Vector database protocols use gRPC with protobuf encoding. The FSM detects the gRPC service path (/pinecone.VectorService/Query), parses the protobuf-encoded request to extract embedding dimensions and namespace, then processes the streaming response to count results and detect PII in metadata.</p><p><strong>The AI-specific win</strong>: FSMs handle streaming LLM responses where tokens arrive incrementally over seconds. Regex can’t maintain state across packet boundaries. FSMs can track partial JSON, buffer incomplete messages, and emit complete events when data: [DONE] arrives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e3uAR_8LBRw6mUw2.png" /></figure><p>A single OpenAI streaming response spans dozens of packets. OpenClaw’s FSM stitches TLS, HTTP/2, and JSON fragments into one semantic event, model, tokens, tool calls, and PII flag included</p><p><strong>AI-specific sampling</strong>: Keep every call touching PII, tool chains, or external APIs. Sample routine LLM calls at 1/100. Reduction happens post-extraction by emitting semantic events instead of raw packets.</p><h3>Deep Dive: OpenAI API Protocol Parsing</h3><h4>Wire Protocol and FSM</h4><p>OpenAI API uses HTTP/2 over TLS with JSON payloads. Example request:</p><pre>POST /v1/chat/completions<br>{<br>  &quot;model&quot;: &quot;gpt-4&quot;,<br>  &quot;messages&quot;: [{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;Retrieve customer emails&quot;}],<br>  &quot;tools&quot;: [{&quot;type&quot;: &quot;function&quot;, &quot;function&quot;: {&quot;name&quot;: &quot;query_database&quot;}}]<br>}</pre><p>FSM extracts semantics from HTTP/2 binary frames:</p><p><strong>State: IDLE</strong></p><ul><li>on TLS handshake to api.openai.com → CONNECTED</li><li>on HTTP/2 SETTINGS frame → HTTP2_READY</li></ul><p><strong>State: HTTP2_READY</strong></p><ul><li>on HEADERS frame with :path=/v1/chat/completions → CHAT_REQUEST</li><li>on HEADERS frame with :path=/v1/embeddings → EMBEDDING_REQUEST</li></ul><p><strong>State: CHAT_REQUEST</strong></p><ul><li>on DATA frames → reconstruct JSON body → extract:</li><li>model name (gpt-4, gpt-3.5-turbo, etc.)</li><li>message history (system, user, assistant roles)</li><li>tools/functions defined</li><li>temperature, max_tokens (generation params)</li><li>on END_STREAM flag → REQUEST_COMPLETE</li></ul><p><strong>State: REQUEST_COMPLETE</strong></p><ul><li>on response HEADERS frame → RESPONSE_STREAMING</li><li>on response DATA frames → reconstruct JSON → extract:</li><li>model output (completion text or tool calls)</li><li>token usage (prompt_tokens, completion_tokens)</li><li>tool_calls array (function names and arguments)</li><li>finish_reason (stop, length, tool_calls, content_filter)</li><li>on END_STREAM → emit semantic event → IDLE</li></ul><h3>What We Extract</h3><p>For each LLM API call: protocol, model, tokens (prompt/completion/total), tool_calls, PII presence, security signals (prompt injection patterns, anomalous tool use)</p><p>For each vector query: protocol, embedding_dim, namespace, top_k, PII in metadata, security signals (overly broad queries, namespace violations)</p><p>For each workflow: chain reconstruction, PII propagation tracking, cost attribution, policy violations</p><h3>Aggregator: Chain Reconstruction</h3><p>The aggregator’s job is unique to AI monitoring: <strong>reconstruct multi-step agent workflows</strong>. When OpenClaw queries Postgres, sends results to GPT-4, then creates a Jira ticket, the aggregator correlates these events (even across pods) into a single chain. It tracks PII propagation (customer email from DB → LLM context → Jira → ❌ pastebin) and detects violations traditional tools miss.</p><h3>What This Enables for AI Security</h3><p>Let’s walk through a concrete example.</p><h4>Example: Reconstructing an AI Agent Chain from Runtime Signals</h4><p>Let’s look at a real scenario: an engineering team using <a href="https://openclaw.ai/">OpenClaw</a> for customer support operations. A support engineer instructs the AI assistant to “help resolve ticket for customer #12345,” and OpenClaw autonomously handles it by orchestrating multiple tools and services across their infrastructure. Here’s what we observe at the runtime layer:</p><p><strong>Process tree:</strong></p><p>The collector observed 7 sequential connections from a single OpenClaw worker pod: two OpenAI API calls, a PostgreSQL query, a Pinecone vector search, a Jira API post, a Slack webhook, and finally a curl upload to personal-pastebin.com. A child process compressed the full conversation history, including PII from every prior step, into a gzip file before that final upload.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LfslccqvHExq8BsT.png" /></figure><p>All destinations reachable, all queries authorized. The violation only becomes visible when the chain is reconstructed end to end.</p><h3>Security Questions We Can Now Answer</h3><p>With full chain reconstruction, security teams can answer questions that were previously out of reach:</p><p><strong>1. Was this chain appropriate for support intent?</strong></p><p>The first 6 steps look normal: query customer data, retrieve context, generate response, create ticket. But step 7 (compressing the conversation and uploading to an unknown external domain) is a clear anomaly. The same tools that enable legitimate support also enabled exfiltration. Without chain visibility, you’d see 7 authorized operations. With it, you see a policy violation.</p><p><strong>Alert triggered: “Agent accessed PII and uploaded to unauthorized external destination”</strong></p><p><strong>2. What PII was accessed and where did it propagate?</strong></p><p>We can trace the complete PII flow:</p><ul><li>Step 2: Retrieved customer email and phone from Postgres</li><li>Step 3: Retrieved 5 more customer emails from vector store</li><li>Step 4: All PII sent to OpenAI in a 2000-token context window (external data processor, but authorized)</li><li>Step 5: Customer email included in Jira ticket (authorized SaaS)</li><li>Step 6: Customer email in Slack notification (visibility, authorized)</li><li>Step 7: Compressed archive with full conversation uploaded to pastebin (❌ violation)</li></ul><p>Traditional DLP might catch step 7 if it can inspect the payload. But it won’t tell you the PII came from database queries in steps 2–3, was augmented by LLM in step 4, and should never have reached step 7.</p><p><strong>3. Did the agent stay within authorized tools?</strong></p><p>Individual tool authorizations all passed: OpenClaw has read access to the customer database, the company uses OpenAI API for AI features, and Jira API calls are part of the support workflow. But step 7 used curl to upload to a domain not in the allowed destination list. Every authentication check passed. The workflow outcome violated policy.</p><p><strong>4. Was this autonomous or human-supervised?</strong></p><p>All 7 steps were autonomous. The LLM decided which tools to invoke. No human approval was required. When you combine broad tool access with autonomous decision-making and PII handling, you need behavioral monitoring, not just access control.</p><p><strong>Risk score: HIGH</strong> (autonomous execution + PII handling + unauthorized external destination)</p><h3>1) AI Tool Chaining Visibility (Execution Graph)</h3><p>Traditional APM tells you about service dependencies. AI observability needs to go deeper: which tools did the agent use, in what order, and how did data flow between them?</p><p>We reconstruct complete execution graphs across the entire tool ecosystem:</p><ul><li><strong>LLM APIs</strong>: OpenAI, Anthropic, Azure OpenAI, self-hosted models</li><li><strong>Internal tools</strong>: Databases, microservices, file systems</li><li><strong>External SaaS</strong>: Jira, Slack, Salesforce, Stripe</li><li><strong>Data sinks</strong>: S3, GCS, external APIs, webhooks</li></ul><p>For each workflow, we track:</p><ul><li><strong>Sequence and timing</strong>: Which tool was called when, how long did it take</li><li><strong>Data flow</strong>: Where did PII enter the chain, where did it propagate</li><li><strong>Cost attribution</strong>: Token usage per step, per agent, per team</li><li><strong>Autonomy level</strong>: Were tool calls autonomous or human-approved</li></ul><h3>2) Intent Signals from AI Workflow Patterns</h3><p>Agents can be authorized for every individual action but still produce inappropriate outcomes. The risk emerges from the sequence and destination of actions, not from any single permission.</p><p>By analyzing workflow patterns, we can distinguish normal behavior from anomalies:</p><p><strong>Normal customer support workflow:</strong></p><pre>User request → LLM (plan) → Query DB (1 row) → Vector search (5 docs)<br>→ LLM (synthesize) → Create ticket → Notify via Slack</pre><p>Characteristics: Small data scope (single customer), authorized destinations only, expected tool sequence for support intent.</p><p><strong>Bulk data exfiltration via AI agent:</strong></p><pre>User request → LLM (plan) → Query DB (WHERE 1=1, 10k rows)<br>→ Loop 50 times { Vector search (top_k=1000) → File write }<br>→ Compress → Upload to personal S3</pre><p>Characteristics: Large data scope, loops (unusual for support), file I/O with compression (preparation for export), unauthorized external destination. Every individual step might be authorized, but the chain is a violation.</p><h3>3) Policy Surfaces for Agentic AI Security</h3><p>Traditional access control policies ask “can this role access this resource?” That model breaks down with agents because agents need broad access to do their job. Every individual permission check passes. The policy violation is in the outcome.</p><p>Chain-level policies shift the question to “did this workflow make sense?”</p><p><strong>Data access scope &amp; destinations</strong>: Querying one customer record for a support ticket is expected; pulling 10,000 in a loop is not. Sending data to approved SaaS tools (Jira, Slack) is part of the workflow; uploads to personal cloud storage or unknown domains are not, regardless of whether the connection succeeds.</p><p><strong>Tool sequencing &amp; volume</strong>: A RAG workflow (vector search → LLM) is a normal pattern. An LLM call triggering a database write followed by an external POST is worth a look. Passing a few hundred tokens to an LLM for summarization is routine; 50,000 tokens of customer records in a single call is not.</p><p><strong>Timing &amp; autonomy</strong>: 500 LLM calls in 10 minutes likely means a runaway loop or scripted attack. Database access at 3 AM from a business-hours agent is worth investigating. When broad tool access combines with fully autonomous decision-making and PII handling, behavioral monitoring matters more than access control.</p><h3>4) Real-Time Detection and Post-Facto Investigation</h3><p><strong>Real-time alerts:</strong></p><ul><li>Agent accessed production PII and sent to unauthorized external domain</li><li>Prompt injection pattern detected in user input → tool calls triggered</li><li>Agent entered recursive loop (&gt;20 iterations)</li><li>Anomalous token usage spike (10x normal for this workflow)</li></ul><p><strong>Investigation queries:</strong></p><ul><li>“Show me all LLM calls that included customer PII in the last 24 hours”</li><li>“Which AI agents accessed the production database and what data did they retrieve?”</li><li>“Reconstruct the full workflow for support ticket #12345”</li><li>“Did any agent send data to external domains not in our approved list?”</li></ul><h3>Technical Capabilities and Benchmarks</h3><p>We built an intelligence layer designed for high-throughput AI environments. Our architecture and testing demonstrate capability to handle enterprise-scale workloads.</p><h3>Architecture Designed for Scale</h3><p>The distributed collector-aggregator architecture scales horizontally:</p><ul><li><strong>Collector layer</strong>: DaemonSet deployment scales linearly with cluster nodes</li><li><strong>Aggregator layer</strong>: Stateless horizontal scaling</li><li><strong>Protocol support</strong>: OpenAI, Anthropic, Azure OpenAI, self-hosted models, Pinecone, Weaviate, Qdrant</li><li><strong>Chain reconstruction</strong>: Multi-hop workflows across pods and protocols with configurable depth tracking</li></ul><h3>Performance Summary</h3><p><strong>Key Metrics at Scale</strong>:</p><ul><li><strong>Throughput</strong>: 5M+ network calls per day monitored</li><li><strong>Latency Impact</strong>: Zero inline latency (passive eBPF capture)</li><li><strong>CPU Overhead</strong>: &lt;2% per node at 50K requests/sec</li><li><strong>Extraction Accuracy</strong>: &gt;99.5% for OpenAI API, &gt;98% for vector DB protocols</li></ul><h3>Benchmark Results</h3><p>Large scale deployments and load benchmarks validate performance characteristics:</p><p><strong>Latency Benchmarks (p95)</strong></p><ul><li><strong>eBPF capture</strong> (Packet to userspace): <strong>&lt;1ms</strong></li><li><strong>FSM parsing</strong> (OpenAI HTTP/2 extraction): <strong>&lt;50ms</strong></li><li><strong>FSM parsing</strong> (gRPC/Protobuf extraction): <strong>&lt;100ms</strong></li><li><strong>Chain correlation</strong> (Cross-pod stitching): <strong>&lt;200ms</strong></li></ul><p>Total end-to-end latency for complete chain reconstruction: <strong>&lt;500ms</strong></p><h3>Performance Design Principles</h3><p>AI agents are latency-sensitive. Adding observability overhead is unacceptable. Our architecture ensures:</p><ul><li><strong>Zero inline latency</strong>: Out-of-band eBPF capture. Application request path never blocked.</li><li><strong>Predictable resource usage</strong>: Bounded memory buffers and configurable sampling rates</li><li><strong>Near real-time alerting</strong>: 5–10 seconds from anomaly detection to alert emission</li><li><strong>Storage efficiency</strong>: Intelligent sampling keeps security-relevant events (PII, anomalies, first-time patterns) while sampling routine traffic</li></ul><p>Our team has deep expertise in eBPF, protocol parsing, and distributed systems. The same technology stack powers our <a href="https://aurva.io/blog/the-ssl-tls-trap-why-your-database-security-goes-blind-in-production">database activity monitoring</a> capabilities at scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FTUY089Vl74wsSu3.png" /></figure><h3>Common Questions</h3><p><strong>Q: How does this differ from application instrumentation (OpenTelemetry, LangSmith)?</strong></p><p>A: Application instrumentation requires code changes across all services and frameworks. Our eBPF approach captures all traffic automatically at the kernel level, regardless of application framework or language. No code changes needed, no gaps in coverage.</p><p><strong>Q: Why use FSMs instead of regex for protocol parsing?</strong></p><p>A: AI protocols use binary framing (HTTP/2, gRPC) and multi-packet messages. Finite State Machines handle stateful, streaming protocols correctly. Regex breaks on binary protocols and cannot track state across packets. FSMs provide deterministic parsing with bounded complexity.</p><p><strong>Q: Can traditional DLP tools catch the same violations?</strong></p><p>A: DLP tools might catch an unauthorized upload if they can decrypt and inspect the payload. But they won’t tell you the data originated from database queries, was processed by an LLM, and represents a multi-step policy violation. Chain context is missing.</p><h3>Key Takeaways</h3><p><strong>The AI Security Paradigm Shift</strong></p><p>Agents have broad permissions by design. Individual authorization checks pass. Risk emerges from workflow patterns: which tools were chained, which data propagated where, which destinations received sensitive context.</p><p>Traditional security asks “who accessed what?” AI security must ask “what did the agent do, step by step, and was the outcome appropriate?”</p><p><strong>Technical Approach Summary</strong></p><p>Runtime intelligence on eBPF enables chain-level visibility through:</p><ul><li><strong>Kernel-level capture</strong>: Passive observation with zero inline latency</li><li><strong>FSM-based parsing</strong>: Extract semantic meaning from binary protocols (OpenAI API, gRPC, vector DBs)</li><li><strong>Cross-service correlation</strong>: Reconstruct multi-hop workflows spanning pods and protocols</li><li><strong>Workflow-level policies</strong>: Detect violations traditional tools miss (data exfiltration, unauthorized destinations, anomalous patterns)</li></ul><p><strong>What This Enables: Traditional vs eBPF Intelligence</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fRrdkWGV_N45Djrn.png" /></figure><p><strong>The agents are here. The intelligence layer shows what they’re actually doing.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=699337ff602d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identity Chaining: The Best Security Control You Can’t Buy]]></title>
            <link>https://medium.com/@apurv_61269/identity-chaining-the-best-security-control-you-cant-buy-7e45c0fcf1ac?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/7e45c0fcf1ac</guid>
            <category><![CDATA[data-access-layer]]></category>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Sun, 01 Feb 2026 09:13:51 GMT</pubDate>
            <atom:updated>2026-02-01T09:15:15.189Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>A runtime, post-access view of identity → action → data touched across services, tools, and agents.</strong></h4><p>Security teams learned to love identity. If you can tie actions to a user or service principal, you can reason about least privilege, investigate incidents, and enforce policy.</p><p>Then agents arrived, and changed the bar.</p><p>“Who had access” is no longer the hard question. The hard question is: <strong>what actually happened after access was granted</strong>, across a chain of services and tools that does not reliably preserve identity context.</p><p>That gap has a name: <strong>identity chaining</strong>.</p><p>Identity chaining is the ability to reliably answer, for any sensitive action:</p><ul><li>Who initiated this chain?</li><li>Which services and tools executed it?</li><li>Which identities were used along the way (human, service account, workload identity, agent identity)?</li><li>What data was accessed, transformed, and sent out?</li><li>What was the final outcome?</li></ul><p>It is one of the most important controls you can have in modern systems, and also the one you usually cannot buy off the shelf.</p><p>Because identity chaining is not a feature. It is a contract.</p><h3>The quiet assumption behind most security tooling</h3><p>A lot of enterprise security tooling implicitly assumes identity flows cleanly through your stack:</p><ul><li>The user authenticates.</li><li>The service authorizes.</li><li>Logs show the actor.</li><li>Downstream systems record who did what.</li></ul><p>In simple systems, that is mostly true.</p><p>In real systems, identity context decays after the first hop.</p><p>A user action triggers a web service. That service calls a worker. The worker calls a job runner. The job runner queries a database and hits a third-party API. Somewhere along the way, the original “who” gets replaced by a “what”: a token, a role session, a workload identity, an access key, a service account.</p><p>Everything is technically legitimate. And yet the most important detail is missing.</p><p>You cannot reliably tell whether that database query was:</p><ul><li>a customer support workflow,</li><li>a background job,</li><li>a misconfigured service,</li><li>a compromised internal tool,</li><li>or an agent doing something that is technically allowed, but clearly wrong.</li></ul><p>This is why investigations drag. This is why blast radius is hard to assess. Agents amplify the problem by making chains longer, faster, and less predictable.</p><h3>Why identity chaining matters more in an agentic world</h3><p>Agentic systems chain tools by design. A single user request can fan out into:</p><ul><li>multiple internal services</li><li>multiple databases</li><li>multiple SaaS systems</li><li>multiple third parties</li><li>multiple delegated tokens and sub-agents</li></ul><p>Even when you do the “right” things (scoped tokens, JIT, least privilege, tool gating), one reality remains: <strong>Authorization ≠ Appropriateness.</strong> Authorization is a permissions check; appropriateness depends on intent and context.</p><p>Agents often need broad permissions to be useful. Their actions are not fully predictable. The security requirement shifts from “was this allowed?” to “what did the chain do, who initiated it, and how quickly can we contain outcomes?”</p><p>That is identity chaining.</p><h3>How Facebook solved identity chaining (and why it does not port easily)</h3><p>I’ve seen identity chaining done well at Facebook.</p><p>It did not come from buying a product. It came from enforcing a standard: every service call was expected to carry viewer context, a structured identity context that captured the originating user, the calling service, the session, and often the reason for access.</p><p>The key was enforcement:</p><ul><li>platform teams defined the standard</li><li>core libraries made it easy to comply</li><li>reviews and production requirements made it mandatory</li><li>teams that ignored it paid an operational cost</li></ul><p>That is what it takes for identity chaining to be reliable.</p><p>Most enterprises cannot replicate this quickly because:</p><ul><li>they do not run one platform stack</li><li>they do not have one service framework</li><li>they do not own every service end to end</li><li>they cannot force every team to propagate identity context consistently</li><li>they cannot refactor a large legacy estate to pass context cleanly</li></ul><p>Many vendors say they support identity chaining. In practice, most can only display identity where it already exists.</p><p>Reliable chaining requires identity context to exist everywhere it needs to exist, consistently.</p><p>That is why it is so hard to buy.</p><h3>Why app-layer propagation rarely happens</h3><p>App-level identity propagation is the cleanest solution. It is also the hardest organizational change to execute.</p><p>Doing it properly requires standardizing:</p><ul><li>context propagation across HTTP, gRPC, and async queues</li><li>structured identity formats and delegation rules</li><li>consistent attribution in downstream systems</li><li>protection against spoofed or forged context</li></ul><p>This is not an installation step. It is a multi-quarter platform program, and it competes with feature delivery. Many organizations only prioritize it after a major incident.</p><p>So the practical question becomes: what can you do without changing every app?</p><h3>The pragmatic path: runtime stitching without app changes</h3><p>If you cannot enforce identity chaining as a contract, you can infer it from what you can observe.</p><p>This is where runtime comes in.</p><p>At Aurva, the approach we’ve taken is:</p><ol><li>Capture runtime telemetry across the environment without requiring app changes</li><li>Reconstruct flows between processes, services, databases, and third parties</li><li>Stitch chains using correlation signals such as timestamps, process lineage, connection metadata, and request patterns</li><li>Attach data context (what data was touched) and egress context (where it went)</li><li>Assign confidence, and improve chaining accuracy over time</li></ol><p>This is not as clean as native viewer context propagation. But it has clear advantages:</p><ul><li>it works in heterogeneous environments</li><li>it covers legacy services</li><li>it does not require every app team to comply</li><li>it produces real-time, end-to-end evidence that security teams can use immediately</li></ul><p>For most security teams, “good enough to act” is better than “perfect but never deployed.”</p><h3>What is solved today, and what is still hard</h3><p>Identity chaining has layers.</p><p>Some layers are tractable today:</p><ul><li>mapping process-to-process and service-to-service flows</li><li>identifying access to databases and sensitive stores</li><li>detecting unusual access patterns and risky third-party destinations</li><li>building investigation timelines quickly</li></ul><p>Other layers remain hard:</p><ul><li>tying every downstream action back to the originating user when identity was never propagated</li><li>disambiguating high-throughput systems where many requests look similar</li><li>reconstructing causality across complex async workflows</li><li>standardizing agent identity handoff across frameworks and toolchains</li></ul><p>We have solved the telemetry and flow visibility problem. Exact chaining is still an evolving frontier. The right strategy is incremental accuracy with immediate operational value.</p><h3>What security teams should do now</h3><p>If you are deploying AI and agentic systems, treat identity chaining as a first-class requirement.</p><p>Three practical steps:</p><ol><li>Stop treating logs as the source of truth :<br><em>Logs help, but they were not built to reconstruct chains across heterogeneous systems.</em></li><li>Instrument for chain-of-custody, even if it starts probabilistically : <br><em>You need to answer “what happened” quickly, with evidence.</em></li><li>Design for post-facto containment :<br><em>For agentic systems, scalable control often looks like: detect quickly, then contain outcomes (revoke tokens, quarantine data products, block egress, rotate credentials, invalidate derived artifacts, require approvals).</em></li></ol><p>If you can do app-level identity propagation, do it. It is still the gold standard.</p><p>But do not wait for perfect propagation before you start protecting data. Most breaches happen in the gaps between “we assume identity follows the request” and “we can prove it did.”</p><blockquote><em>Identity chaining is the control that makes investigations and containment possible in modern stacks.<br>In the agentic era, the bar is simple: can you prove what the chain did with access, and can you contain outcomes fast?</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e45c0fcf1ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Identity Chain: Why Agents Break the Perimeter]]></title>
            <link>https://medium.com/@apurv_61269/the-identity-chain-why-agents-break-the-perimeter-7188b4ccb31d?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/7188b4ccb31d</guid>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[runtime-permissions]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Mon, 19 Jan 2026 21:07:59 GMT</pubDate>
            <atom:updated>2026-01-20T00:53:19.546Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Why “identity is the perimeter” breaks for agents, and what runtime context must capture to secure them.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aT6Iqe5Fz83KHptlnKXJ8g.png" /></figure><p>The “identity is the perimeter” narrative is everywhere in agentic security.</p><p>Agents need broad permissions to work autonomously. They integrate with systems like HRIS, query databases, access internal tools, and make decisions across multiple data sources. Traditional security validates identity at the gate, but has limited visibility into what agents actually do with those permissions.</p><p>The execution chain between the user prompt and the final answer is opaque. If you do not model the identity chain, “just add more IAM” becomes either unusable or ineffective.</p><h3>The real problem: agents need broad access to be useful</h3><p>PAM and JIT were built for predictable, human-shaped access patterns. Request access, get approved, perform a known task, revoke access.</p><p>Agents do not work this way.</p><p>An agent answering “Give me insights on team performance” might:</p><ul><li>query org structure</li><li>pull compensation data</li><li>join with performance reviews</li><li>access internal notes</li><li>synthesize across all sources to generate an answer</li></ul><p>You cannot predict this access path upfront. The agent discovers what it needs as it reasons through the problem. If you lock down permissions with strict JIT, the agent cannot function. If you grant broad standing permissions so it can work, you lose the security boundary.</p><p>This is not a failure of identity management. This is the inherent tension of autonomous systems.</p><h3>Most security tools validate authorization decisions:</h3><ul><li>PAM/JIT: “Did we approve this identity to access this resource?”</li><li>IAM logs: “Service account authenticated to database”</li><li>CASB: “API call authorized”</li></ul><pre>What they miss is the execution chain:<br><br>User prompt:&quot;Give me team performance insights&quot;<br> ↓<br>Agentstep: calls HRIS API, retrieves employee records<br> ↓<br>Agentstep: queries compensation database, accesses salary fields<br> ↓<br>Agentstep: joins with performance reviews, combines sensitive datasets<br> ↓<br>Agent response:&quot;Here&#39;s the summary&quot;</pre><p>From an identity perspective, every step was authorized.</p><p>From a runtime perspective, the agent accessed more data than necessary and combined sensitive information in ways that violate governance policies.</p><p>Traditional security sees: “Agent accessed HRIS, agent queried employee DB”</p><p>Runtime visibility sees: “Agent pulled salary records at scale, joined with performance data, exposed compensation information the requester should not have seen”</p><h3>A real example I heard from a CTO</h3><p>A CTO at a public company told me their workplace assistant had an HRIS integration with the permissions needed to answer org and people questions.</p><p>A user asked an innocuous question about their team.</p><p>The assistant pulled compensation fields too broadly and exposed salary information to the requester. The permissions were valid. The access was authorized. But the behavior violated governance expectations.</p><p>They only discovered this when someone noticed the exposed data.</p><p>There was no runtime visibility into what the assistant was actually doing with HRIS permissions. No alert that sensitive salary fields were accessed at scale. No policy enforcement tied to the data flow between the HRIS connector and the user session.</p><blockquote>The question security teams are asking is simple :<br>What else is happening that we do not know about?</blockquote><h3>The identity chain problem in practice</h3><p>When people say “the agent’s identity,” they usually mean one thing. In real systems, multiple identities show up across a single user request.</p><ol><li>User to agent (delegation)<br>The agent acts on behalf of the user via OAuth or session inheritance.</li><li>Agent to service (workload identity)<br>The agent uses a service identity to access backends (IAM roles, service accounts, API keys).</li><li>Agent to tool server (translation boundary)<br>The agent calls a tool server, and the tool server executes the request using its own service identity.</li></ol><p>This is where context gets lost. IAM logs show a legitimate service principal, but the initiating user, original prompt, and intermediate agent steps are not reliably attached.</p><p>Even with allowlisted tools, prompt injection and indirect prompt contamination can drive confused deputy behavior. The tool server faithfully executes a harmful request under a valid identity, and authorization logs stay clean.</p><h3>Why PAM and JIT fail for agents</h3><p>PAM and JIT were built for predictable workflows. Approve access, perform task, revoke access.</p><p>Agents are nondeterministic. The same prompt can trigger different execution paths each time:</p><pre>Run 1: queries HRIS, accesses 50 records<br>Run 2: same prompt, accesses 500 records including compensation fields<br>Run 3: same prompt, joins HRIS plus performance data and exports results</pre><p>You cannot precompute least privilege for a workflow that changes every run.</p><ul><li>Make JIT strict and you interrupt execution mid-flight. Usability collapses. Teams bypass controls.</li><li>Loosen JIT and you grant broad standing permissions. You are back to the original problem.</li></ul><p>Either way, you have either added friction or increased blast radius.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g5bKnjTonDI2x3cTWOzv9g.png" /></figure><p>This is also why traditional CASB and DLP struggle:</p><ul><li>They inspect traffic, not agency.</li><li>They enforce static policies, not contextual ones.</li></ul><h3>What you actually need: runtime visibility</h3><p>Security for agents is not “more identity controls.” It is visibility into what agents do with the permissions you grant them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0QE_bD6d-ee5uazhMBfUQ.png" /></figure><p>For every action in the execution chain, capture:</p><ul><li><strong>Action:</strong> tool invoked, API called, query executed</li><li><strong>Principal: </strong>which role, service account, or token was used</li><li><strong>Data accessed: </strong>sensitivity class, fields, volume</li><li><strong>Destination: </strong>user session, temp file, external API, webhook</li><li><strong>Attribution:</strong> initiating user, original prompt, agent session or trace ID</li></ul><p>Then enforce policies based on behavior:</p><ul><li>alert if salary fields are accessed at scale in a single session</li><li>block joining sensitive HRIS fields with outbound destinations</li><li>flag large sensitive exports to temp files or webhook-like sinks</li></ul><p>These policies cannot be enforced at the identity layer. They require runtime visibility.</p><h3>Takeaway</h3><p>Identity matters in the agentic era, but “identity is the perimeter” is incomplete.<br>Agents need broad permissions to be useful. The risk is not unauthorized access. It is authorized access used in unauthorized ways.</p><p>The organizations getting this right are not adding more identity controls. They are building runtime visibility into agent behavior and data access patterns, so they can answer:</p><ul><li>what sensitive data did the agent touch</li><li>did it access more than needed</li><li>where did the data go</li><li>did the behavior match governance policy</li></ul><p>This requires runtime telemetry, data access monitoring, and contextual policy enforcement. The framing needs to shift from “lock down identities” to “see and govern what agents actually do.”</p><p><em>Disclaimer: I’m CEO of Aurva, an AI security company focused on runtime visibility for agentic systems. These views are based on my experience building AI systems at Meta and working with security teams deploying agents in production.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7188b4ccb31d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From 550 to 5,500 TPS: Beating TLS Fragmentation in an eBPF Data Path]]></title>
            <link>https://medium.com/@apurv_61269/from-550-to-5-500-tps-beating-tls-fragmentation-in-an-ebpf-data-path-49f4d4a12eac?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/49f4d4a12eac</guid>
            <category><![CDATA[ebpf]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[logging-and-monitoring]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Mon, 12 Jan 2026 00:30:49 GMT</pubDate>
            <atom:updated>2026-01-12T00:30:49.695Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>When your eBPF program is bottlenecked not by your code, but by how you prove it’s safe</strong></h4><h3>What We Do at Aurva: Real Time Data Access Monitoring with eBPF</h3><p>Our platform captures data access in real time for AI security and data protection. We track which agents and applications access sensitive data, audit potential exfiltration, detect anomalous access patterns, and discover shadow AI systems touching production databases.</p><p>We use eBPF to observe traffic and execution context with near zero deployment friction:</p><ul><li><strong>Universal coverage:</strong> Works across data stores by observing traffic and process context, which is critical for discovering shadow AI and monitoring agentic access.</li><li><strong>Protocol agnostic at the transport layer:</strong> We observe socket syscalls for all traffic. For TLS, the kernel sees ciphertext, so we additionally instrument common TLS libraries to capture plaintext at the encryption boundary.</li><li><strong>Zero touch deployment:</strong> No database plugins, no log parsing, no application changes. This matters when you need coverage for third party tools and fast moving AI apps.</li><li><strong>Runtime visibility:</strong> We can attribute access to the process, container, service account, and runtime context behind it, including LLM generated queries and tool based retrieval.</li></ul><p>At a high level, we collect a stream of payload fragments plus context (process, connection tuple, timestamps, direction). Userspace reconstructs higher level intents like queries and requests, classifies sensitivity, and correlates them into broader access patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ElHTGoJI-MCZV1hD" /></figure><p>This approach works well, but it creates a class of scaling problems that show up in high throughput systems, especially when TLS is involved.</p><h3>The Wall: 550 TPS and Dropping Events</h3><p>We hit a hard ceiling during load testing with a realistic agent workload.</p><p>Our setup simulated an AI powered customer support system: multiple LLM agents querying a MySQL database over TLS to retrieve customer information, transaction history, and support tickets.</p><p>Everything looked fine until we crossed roughly <strong>500 to 600 transactions per second</strong>. At that point, loss spiked suddenly.</p><p>The culprit was our <strong>ring buffer</strong>, the fixed size queue used to move events from the kernel to userspace. It was filling faster than userspace could drain it. Once full, telemetry was dropped, and we lost visibility into what the agents were accessing.</p><p>For a security monitor, even small drop rates create blind spots. Exfiltration, policy violations, and anomalous access can hide inside the missing slice.</p><p>What made this puzzling was the contrast with non TLS traffic. The same workload without TLS ran at <strong>5,500+ TPS</strong> with no drops. With TLS enabled, CPU crossed two cores at 500 to 600 TPS. Memory looked fine. Userspace parsing and classification latency looked normal.</p><p>So the bottleneck was earlier. It was in how we were packaging and transporting telemetry across the kernel to userspace boundary.</p><h3>The Investigation: Tracing Ring Buffer Bloat</h3><p>We added instrumentation to track what was actually consuming ring buffer capacity. That is when it clicked.</p><p>With TLS, what you conceptually think of as “one query response” often arrives as many small fragments. Large result sets get split across many syscalls. In our test, typical MySQL TLS response fragments were often <strong>4 to 40 bytes</strong>, sometimes smaller.</p><p>Those fragments might contain:</p><ul><li>Partial row and field data</li><li>Column metadata and headers</li><li>Small chunks from multi row results</li></ul><p>Our program was emitting an event for every fragment. And each event carried:</p><ul><li>About <strong>200 bytes</strong> of metadata (connection ID, process and thread IDs, protocol, IPs, timestamps, direction)</li><li>A <strong>fixed 1,024 byte payload buffer</strong> reserved for the fragment</li></ul><p>So a 20 byte fragment reserved roughly <strong>1,224 bytes</strong> in the ring buffer. Most of it was padding.</p><p>That is the key point. The ring buffer was not full of “data”. It was full of repeated metadata and empty payload space.</p><p>At 500 to 600 QPS, we were pushing tens of megabytes per second into the ring buffer, with the bulk being wasted capacity. Once the buffer filled, we dropped events, and lost visibility.</p><p>A natural question here is: “Why not use variable sized ring buffer records instead of a fixed 1KB payload?”</p><p>Even if we shrink the record to metadata plus fragment_size, we still pay the per fragment cost of metadata and userspace wakeups. The scaling issue was not only bytes. It was also the number of events crossing the boundary.</p><p>We needed fewer, denser events.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9T1N7W7O4EatBdLJ" /></figure><h3>The Obvious Solution: Accumulate Fragments in Kernel Space</h3><p>The fix seemed straightforward. Accumulate small fragments per connection in kernel space, then flush in larger chunks.</p><p>Instead of sending every 20 byte fragment immediately, we would:</p><ol><li>Maintain a per connection accumulation buffer in kernel space</li><li>Append fragments as they arrive</li><li>Flush to userspace only when we reach a target batch size (for example 1KB), or on context changes</li></ol><p>This amortizes fixed overhead. One metadata snapshot can cover dozens of fragments.</p><p>In our workload, that shifts the math from:</p><ul><li><strong>Before:</strong> 100 fragments × 1,224 bytes ≈ 122KB per query response</li><li><strong>After:</strong> 1 batched event × about 1,224 bytes ≈ 1.2KB per query response</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V0V9hrmz4cVtDtS0Muq00A.png" /></figure><p>Problem solved, right?</p><p>Not quite.</p><h3>The eBPF Verifier: When “Correct” Is Not Enough</h3><p>In eBPF, you do not just write correct code. You write code the verifier can prove is safe.</p><p>The verifier is a kernel component that statically analyzes the program before it is allowed to run. It must be convinced that your program cannot read or write out of bounds, cannot dereference invalid pointers, and cannot loop forever. If it cannot prove safety, your program will not load.</p><p>To accumulate fragments, you naturally write code like:</p><pre>bpf_probe_read_user(&amp;buf[offset], size, src);<br>offset += size;</pre><p>A human reads this as safe if you guard it with:</p><pre>if (offset + size &lt; CAPACITY) {<br>    bpf_probe_read_user(&amp;buf[offset], size, src);<br>}</pre><p>But the verifier often cannot retain relationships between variables the way humans do. In many contexts, it treats offset and size as independent unknowns with ranges, and it must be able to prove safety in the worst case.</p><h3>The “A + B &lt; capacity” Problem</h3><p>In our case:</p><ul><li>offset could be anywhere from 0 to 1023</li><li>size could be anywhere from 1 to 1024</li><li>buffer capacity was 1024</li></ul><p>The verifier effectively reasons:</p><ul><li>Worst case offset = 1023 and size = 1024</li><li>offset + size = 2047</li><li>2047 does not fit in a 1024 byte buffer</li><li>Reject</li></ul><p>Our runtime checks did not help because the verifier could not prove that the check enforces a safe relationship for all paths.</p><p>This is a known limitation and has been discussed widely in eBPF communities. The takeaway is simple: the verifier needs bounds it can prove statically, not bounds you can justify logically at runtime.</p><h3>The Breakthrough: Make the Buffer Bigger Than You Use</h3><p>We had two options:</p><ol><li>Reduce the maximum possible ranges of offset and size so their sum always fits in 1KB</li><li>Increase the buffer capacity so the verifier’s worst case sum fits</li></ol><p>Option 1 was not realistic for our workload. Fragment sizes vary. Response patterns vary. We needed flexibility.</p><p>Option 2 was counterintuitive but effective. We allocated a <strong>2KB buffer</strong> to support a <strong>1KB flush size</strong>.</p><ul><li>Worst case verifier sum: 1023 + 1024 = 2047</li><li>Buffer size: 2048</li><li>Result: provably safe</li></ul><p>We still flush at 1KB. We do not actually try to fill 2KB in normal operation. The extra space exists primarily to satisfy the verifier’s static reasoning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DVQFFD2_fj4iLRMj3jaBdA.png" /></figure><p>This “over allocate for proof” trade off is often cheap in practice. Even at 10,000 concurrent connections, 2KB per connection is about 20MB of memory, which is typically acceptable on modern hosts. In return, we get stable, lossless telemetry at production throughput.</p><h3>Additional Verifier Friendly Moves</h3><p>We also made array offsets trivially provable using masking:</p><pre>// BUFFER_SIZE must be a power of 2<br>buf[offset &amp; (BUFFER_SIZE - 1)] = data;</pre><p>Two important notes:</p><ol><li>This requires BUFFER_SIZE to be a power of two (1024, 2048, 4096).</li><li>In valid execution, our logic keeps offset within the flush range, so the mask is effectively a no op. It is there to make the bound obvious to the verifier, not to change semantics.</li></ol><h3>How the Accumulation Works</h3><p>At a high level, we maintain a per connection accumulator in kernel space. Each accumulator holds:</p><ul><li>A snapshot of security relevant metadata captured once per batch</li><li>Small state about the batch</li><li>The accumulation buffer itself</li></ul><pre>Per-connection accumulator:<br>├─ Metadata snapshot (captured once per batch)<br>│  ├─ Connection ID<br>│  ├─ Thread ID<br>│  ├─ Protocol type<br>│  └─ Traffic direction<br>├─ Buffer state<br>│  └─ Current fill level (0 to MAX_FLUSH_SIZE bytes)<br>└─ Accumulation buffer (2 * MAX_FLUSH_SIZE bytes allocated)</pre><p>In our implementation:</p><ul><li>MAX_FLUSH_SIZE = 1024</li><li>Accumulation buffer allocated size is 2048 to satisfy the verifier</li><li>We flush to userspace as 1024 byte batches</li></ul><p>When a fragment arrives, we look up the accumulator for that connection and append.</p><p>If the security context changes mid stream (for example a different thread, direction change, or protocol state change), we flush immediately so each batch stays context consistent.</p><pre>static __always_inline void on_fragment_captured(<br>    void *ctx,<br>    uint64_t connection_id,<br>    const char *fragment,<br>    uint32_t fragment_size,<br>    struct metadata_t *metadata)<br>{<br>    // Look up accumulator state<br>    struct accumulator_t *accumulator =<br>        bpf_map_lookup_elem(&amp;accum_map, &amp;connection_id);<br><br>    if (!accumulator) {<br>        bpf_map_update_elem(&amp;accum_map, &amp;connection_id,<br>                            &amp;ZERO_ACCUMULATOR, BPF_ANY);<br>        accumulator = bpf_map_lookup_elem(&amp;accum_map, &amp;connection_id);<br>        if (!accumulator)<br>            return;<br>    }<br><br>    // Flush when stream context changes<br>    if (stream_context_changed(accumulator, metadata)) {<br>        flush_to_userspace(ctx, accumulator, metadata);<br>        update_accumulator_metadata(accumulator, metadata);<br>    }<br><br>    uint32_t remaining = fragment_size;<br><br>    // If closing or fragment too large, flush and send directly<br>    if (metadata-&gt;source_fn == CLOSE ||<br>        remaining &gt; MAX_ACCUM_COPY_SIZE) {<br>        flush_to_userspace(ctx, accumulator, metadata);<br>        send_to_userspace(ctx, fragment, fragment_size, metadata);<br>        return;<br>    }<br><br>    // Flush if accumulator is already full<br>    if (accumulator-&gt;fill_level &gt;= MAX_CHUNK_SIZE - 1) {<br>        flush_to_userspace(ctx, accumulator, metadata);<br>    }<br><br>    // Compute available space in the accumulation window<br>    uint32_t space_available =<br>        (MAX_CHUNK_SIZE - 1) - accumulator-&gt;fill_level;<br><br>    // Compute verifier-safe destination offset<br>    uint32_t safe_offset =<br>        accumulator-&gt;fill_level &amp; (MAX_CHUNK_SIZE - 1);<br><br>    // Compute number of bytes we can safely copy<br>    uint32_t bytes_to_copy = space_available;<br>    if (bytes_to_copy &gt; remaining)<br>        bytes_to_copy = remaining &amp; (MAX_CHUNK_SIZE - 1);<br><br>    // Extra cap required for older kernels (e.g. RHEL 8, kernel 4.18)<br>    if (bytes_to_copy &gt; MAX_ACCUM_COPY_SIZE)<br>        bytes_to_copy = MAX_ACCUM_COPY_SIZE;<br><br>    // Copy fragment slice into accumulation buffer<br>    bpf_probe_read_user(<br>        &amp;accumulator-&gt;buffer[safe_offset],<br>        bytes_to_copy,<br>        fragment<br>    );<br><br>    accumulator-&gt;fill_level += bytes_to_copy;<br>    remaining -= bytes_to_copy;<br><br>    // Flush once we reach the flush threshold<br>    if (accumulator-&gt;fill_level &gt;= MAX_FLUSH_SIZE) {<br>        flush_to_userspace(ctx, accumulator, metadata);<br>        accumulator-&gt;fill_level = 0;<br>    }<br><br>    // If leftover data remains, flush and send it directly<br>    if (remaining &gt; 0) {<br>        flush_to_userspace(ctx, accumulator, metadata);<br>        send_to_userspace(<br>            ctx,<br>            fragment + bytes_to_copy,<br>            remaining,<br>            metadata<br>        );<br>    }<br>}</pre><p>The key insight is structural: we allocate a <strong>2048-byte accumulation buffer</strong>, but flush data to userspace using a <strong>separate 1024-byte security event</strong>.</p><p><strong>Before this change</strong>, we sent a full 1024-byte security event for every tiny fragment, wasting space and CPU while creating blind spots in AI security monitoring. <strong>With accumulation</strong>, we pack dozens of fragments into a single comprehensive security event, dramatically reducing ring buffer pressure while maintaining complete visibility into AI agent data access patterns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImaoB6DSeNWUHoAZ6gDPug.png" /></figure><h3>Results: About 10x Throughput, Zero Drops</h3><p>After deploying kernel space accumulation:</p><p><strong>Throughput:</strong></p><ul><li><strong>Before</strong>: 500–600 TPS (with packet drops)</li><li><strong>After</strong>: 5,500+ TPS (no packet drops)</li><li><strong>Improvement</strong>: 1000% (yes, ten times better)</li></ul><p><strong>CPU Utilization:</strong></p><ul><li><strong>Before</strong>: 2+ cores at 500–600 TPS</li><li><strong>After</strong>: 1.6 cores at 5,500+ TPS</li><li><strong>Impact</strong>: Higher throughput with less CPU</li></ul><p><strong>Memory Usage:</strong></p><ul><li>No noticeable change at runtime</li><li>Slight increase for accumulator buffers (~20MB for 10,000 connections)</li><li>Offset by reduced ring buffer pressure and fewer userspace wakeups</li></ul><p>The ring buffer went from overflowing at 500 TPS to handling 5,500+ TPS comfortably; enough to monitor dozens of concurrent AI agents accessing sensitive data. The bottleneck was never our data classification or policy enforcement logic: it was the sheer volume of tiny, wasteful security events we were pumping into the ring buffer.</p><p>By accumulating fragments before sending, we turned 100 mostly-empty 1KB events into 1 full, information-dense 1KB security event.</p><p>And the CPU improvement? That came from reduced context switches and userspace processing. Every ring buffer event triggers a userspace wakeup for security analysis. Fewer events = fewer interruptions = better CPU efficiency = lower cost for comprehensive AI security monitoring.</p><h3>Why This Matters for Security and beyond?</h3><p>This problem isn’t tied to database monitoring, a single protocol, or even AI security specifically. It shows up anytime an eBPF program needs to <strong>move a high-frequency stream of small, variable-sized payload fragments from kernel space to user space</strong>.</p><p>You can run into the same bottleneck if you’re using eBPF for:</p><ul><li>Observability or tracing</li><li>Traffic inspection or monitoring</li><li>Any system emitting high-volume, variable-sized events</li></ul><p>And it becomes especially painful in AI-heavy workloads, where systems generate thousands of micro-interactions per second, such as:</p><ul><li>AI agents and autonomous systems (tool calls, API calls, data access patterns)</li><li>LLM applications (prompt and response flows, retrieval access, outbound calls)</li><li>RAG systems (auditing which documents and chunks get retrieved)</li><li>Shadow AI discovery (detecting unapproved tools touching production systems)</li><li>Data loss prevention (inspecting sensitive payloads flowing to models or third parties)</li></ul><p>In all these cases, <strong>fixed per-event overhead</strong> (metadata, buffer reservation, userspace wakeups) adds up fast. A naive design can hit throughput limits long before CPU or memory become the issue. The result is usually one of two bad choices: scale back visibility (blind spots) or over-provision infrastructure (cost).</p><h3>Conclusion: Design for What the Verifier Can Prove</h3><p>The fix was not faster parsing or better classification. It was changing how telemetry crosses the kernel to userspace boundary.</p><p>We got about 10x throughput improvement by accumulating small fragments in kernel space, then flushing dense batches to userspace. The thing that almost blocked us was the verifier. A 1KB accumulation buffer was logically correct, but it was not provably safe under the verifier’s static reasoning. Over allocating the buffer to 2KB made the worst case bounds provable while keeping runtime behavior unchanged.</p><p>The broader lesson is simple: in eBPF, safety proof is part of the design. Once we shaped our data layout and control flow around what the verifier can reason about, the accumulation strategy worked exactly as intended, and we regained lossless visibility at production scale.</p><blockquote>Thanks for reading. If you are building eBPF based runtime monitors and have your own verifier war stories, we would love to compare notes.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49f4d4a12eac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How DAM Turns Database Blind Spots Into Rapid Debugging Signals]]></title>
            <link>https://medium.com/@apurv_61269/how-dam-turns-database-blind-spots-into-rapid-debugging-signals-12505fddd5f8?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/12505fddd5f8</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[database-activity]]></category>
            <category><![CDATA[cloudflare]]></category>
            <category><![CDATA[dam]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Sun, 30 Nov 2025 10:55:04 GMT</pubDate>
            <atom:updated>2025-11-30T10:55:04.824Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*md4wl9XiTpnUfDdJXVxTDg.png" /></figure><p><strong>On November 18, 2025, Cloudflare experienced a global outage that rippled across its network and impacted millions of requests per second</strong>. The cause was not an attack, a memory leak, or a bad rollout. It was something far more subtle: a database permissions change that caused a key metadata query to return duplicate rows.</p><p>That duplicate set of records doubled the size of an internal feature file, which then propagated across their global network. The growing file breached a memory limit, crashed proxies, and created oscillating 5xx errors as different nodes generated conflicting versions of the file.</p><p>Critical failures increasingly originate in the data layer, where traditional observability has the weakest coverage. This is exactly the kind of incident where Database Activity Monitoring (DAM) proves its value, not as a compliance checkbox, but as a real-time signal layer that accelerates debugging when failures begin in the database.</p><p>To be clear, we do not know which internal tools Cloudflare uses. Treat this as an illustrative example of how DAM-style signals can shorten the investigation path in a similar incident.</p><h3>The Cloudflare outage: a data-layer root cause</h3><p>If you distill the incident, the chain looks like this:</p><ul><li>A permissions change affected access to a database table (system.columns).</li><li>This caused a query to return duplicate metadata rows.</li><li>The downstream job that generated a Bot Management feature file interpreted the duplicates as new features.</li><li>The feature file doubled in size and propagated across the network.</li><li>Several workers hit memory limits, crashed, and began returning widespread 5xx errors.</li><li>Because file generation ran every 5 minutes and produced inconsistent results between nodes, the failure pattern oscillated and became harder to diagnose.</li></ul><p>This is a textbook example of why database visibility is not just a security requirement. It is an operational necessity.</p><h3>What is DAM, in operational terms</h3><p>Database Activity Monitoring (DAM) is a category of tools and infrastructure that continuously monitor activity inside your databases:</p><ul><li>Which users and services access what data</li><li>What queries execute and what row counts they return</li><li>When permissions change</li><li>How access patterns evolve over time</li></ul><p>You can think of it as a real-time visibility layer for your data. It is built to surface anomalies and misconfigurations before they cascade into something larger.</p><p>Unlike native database logs, which are engine specific, often incomplete, and sometimes mutable, DAM systems operate independently. They standardize and secure the audit trail while providing real-time alerting and anomaly detection.</p><h3>Traditional debugging vs DAM-aware debugging</h3><p>Without DAM, the investigation usually starts at the edges of the system.</p><p>A typical path looks like this:</p><ul><li>A global outage is detected as 5xx errors spike across regions.</li><li>Teams dig into proxy crashes and memory limit alarms.</li><li>They notice an oversized feature file being regenerated every few minutes.</li><li>They trace that file back to a metadata job and eventually to a query that is suddenly returning duplicate rows.</li><li>Only then do they uncover the permissions change that caused the query to behave differently.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OGAwgFXWn9_AaCmJx-5jOA.png" /></figure><p>With DAM in place, the first clues look very different:</p><ul><li>Alert: Row count anomaly for the metadata query that powers the feature file.</li><li>Alert: Permissions change on the critical system.columns table a few minutes earlier.</li></ul><p>Correlate those two signals and you are at the real root cause before the oversized feature file has propagated widely enough to take down proxies or generate large waves of 5xx responses.</p><p>The key difference is not just minutes versus hours. It is whether you discover the problem while it is still a contained data issue, or after it has turned into a full network wide incident.</p><h3>How DAM would have changed the debugging path</h3><p>Two specific DAM capabilities stand out as difference makers in a scenario like this.</p><h3>1. Anomaly detection on query results</h3><p>Traditional monitoring often alerts on static thresholds, like “alert if row count is greater than 1000”. DAM anomaly detection learns the normal baseline of how many rows each critical query usually returns and alerts when something materially deviates.</p><p>In an outage like this:</p><ul><li>Metadata queries are expected to be extremely stable.</li><li>The moment duplicates appeared and the row count jumped, an anomaly detector would have fired.</li></ul><p>An on-call engineer would have seen:</p><ul><li>The exact query whose behavior changed</li><li>The user or service executing that query</li><li>The deviation from the baseline row count</li></ul><p>That is exactly the sort of early signal you want before downstream jobs start generating oversized files and crashing proxies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EV2Oy5rizh5XmWBmdqfK-w.png" /></figure><h3>2. Permission change monitoring on critical tables</h3><p>The initiating event in this outage was a permissions change.</p><p>DAM tools continuously monitor:</p><ul><li>GRANT and REVOKE operations</li><li>Role and group modifications</li><li>Privilege escalations</li><li>Changes to access on critical tables or schemas</li></ul><p>A DAM system could have produced an alert like:</p><blockquote><em>Alert: User access change detected</em></blockquote><blockquote><em>Operation: GRANT SELECT ON </em><em>system.columns TO </em><em>role_x</em></blockquote><blockquote><em>Impact radius: downstream jobs that rely on table metadata</em></blockquote><blockquote><em>Timestamp: 10 minutes before first 5xx error spike</em></blockquote><p>On its own, a GRANT might not look urgent. Lined up next to a row count anomaly on a dependent query, it becomes a very strong lead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ryPijeuzDD7xmUxu4mvqg.png" /></figure><h3>Combined: the on-call engineer’s shortcut</h3><p>Now imagine you are the on-call engineer, looking at your incident dashboard.</p><p>Within a short window you see two DAM signals:</p><ul><li>“The system.columns metadata query for the feature generation job is returning roughly 2x its normal row count.&quot;</li><li>“SELECT privileges on system.columns were granted to role_x 10 minutes ago.&quot;</li></ul><p>You immediately have a working theory: a recent permission change altered what this metadata query can see, and that change is now propagating into downstream feature generation.</p><blockquote><strong>Instead of starting from 5xx graphs and heap dumps on edge proxies, you start from the data layer and work forwards:</strong></blockquote><blockquote>1. Reproduce the metadata query and confirm the duplicate rows.</blockquote><blockquote>2. Roll back or correct the permission change.</blockquote><blockquote>3. Regenerate a clean feature file and redeploy it. &lt;/aside&gt;</blockquote><p>In many cases you can do this before the bad file has fully rolled out or before the impact grows from partial errors into a global outage.</p><p>DAM does not magically prevent every incident, but it gives you a direct, high quality signal at the place where this incident began: the database.</p><h3>The path forward</h3><p>You can run without DAM. Many organizations still do.</p><p>But as more systems rely on database driven features, configuration, and decisions, the cost of losing visibility into the data layer keeps rising. Outages that look like “proxy crashes” on the surface are increasingly rooted in subtle changes deep in the database.</p><p>If you want observability that is data aware and resilient to failures that begin at the query and permissions level, DAM is the missing piece.</p><h3>About Aurva</h3><p>Aurva is a modern, cloud first Data Activity Monitoring (DAM) built for hybrid environments. It gives real time visibility into database queries, row count anomalies, and permission changes across modern DBs like Qdrant, SQL, MongoDB, ClickHouse, Redshift and more, along with the traditional DBs like Oracle and SAP; so teams can debug and secure the data layer without relying on brittle logs or manual thresholds.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12505fddd5f8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What Are AI Agents? The Autonomous Systems Reshaping Enterprise Computing]]></title>
            <link>https://medium.com/@apurv_61269/what-are-ai-agents-the-autonomous-systems-reshaping-enterprise-computing-472ceb9b8f5e?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/472ceb9b8f5e</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-access]]></category>
            <category><![CDATA[shadow-ai]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Mon, 17 Nov 2025 12:09:10 GMT</pubDate>
            <atom:updated>2025-11-17T12:09:10.405Z</atom:updated>
            <content:encoded><![CDATA[<p>Picture this: a customer service representative that never sleeps, a financial analyst that processes thousands of reports simultaneously, or a software developer that writes and deploys code based on natural language instructions. These are not humans working overtime. They are AI agents, and they represent a fundamental shift in how we think about computing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UipkHPbdDLruf-CY.png" /></figure><h3>Beyond Chatbots: Understanding AI Agents</h3><p>AI agents are autonomous software systems that can perceive their environment, make decisions, and take actions to achieve specific goals, all without constant human supervision. Unlike traditional software that follows predetermined paths, or even generative AI that responds to prompts, agents operate with genuine autonomy.</p><p>Thanks for reading! Subscribe for free to receive new posts and support my work.</p><blockquote><em>Think of the difference this way:<br>- </em>Generative AI (like ChatGPT) is like a junior engineer. It executes specific tasks you assign: “Summarize this article” or “Write this code snippet.”</blockquote><blockquote>- AI agents are like senior engineers. You give them an outcome: “Analyze our sales data, identify trends, and create a presentation for the board.”</blockquote><p>The agent then determines what needs to be done, breaks down the problem, accesses necessary tools and data, and delivers the complete solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RUgSJCi9Nfn0VxLR.png" /></figure><h3>The Four Pillars of Agent Computing</h3><p>What makes AI agents fundamentally different from traditional applications? Four key characteristics:</p><h3>1. Autonomy</h3><p>Agents make decisions independently. When you ask an agent to “optimize our inventory,” it does not just run a predefined algorithm. It can analyze current stock levels, predict demand, evaluate supplier relationships, and potentially even initiate purchase orders, all based on its own reasoning about the best path forward.</p><h3>2. Non Determinism</h3><p>The same request to an agent might yield different approaches each time. This is not a bug. It is a feature. Agents adapt their strategies based on context, available resources, and learned experiences. Their behavior is fundamentally unpredictable in its specifics, even while they aim for predictable outcomes.</p><h3>3. Tool Use and Code Execution</h3><p>Modern agents do not just process information. They actively interact with your systems. They can:</p><ul><li>Query databases to retrieve customer information</li><li>Call APIs to integrate with external services</li><li>Generate and execute code to solve novel problems</li><li>Orchestrate complex workflows across multiple systems</li></ul><h3>4. Network Centric Architecture</h3><p>Agents are inherently collaborative. They communicate with:</p><ul><li>Large Language Models (LLMs) for reasoning and natural language processing</li><li>Other agents for task delegation and specialized expertise</li><li>Databases and knowledge bases for information retrieval</li><li>External APIs and services for extended capabilities</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*twqSOnS_8PW7ClHU.png" /></figure><h3>How Agents Actually Work</h3><p>Let us trace through a real scenario to understand agent operations.</p><p><strong>Scenario: A sales agent receives a request for a custom quote.</strong></p><ol><li><strong>Understanding intent:</strong> The agent first calls an LLM API (like GPT 4) to parse and understand the customer’s request.</li><li><strong>Information gathering:</strong> Using protocols like MCP (Model Context Protocol), it queries your customer database to retrieve purchase history and preferences.</li><li><strong>Delegation:</strong> Through an A2A (Agent to Agent) protocol, it delegates pricing calculations to a specialized pricing agent.</li><li><strong>Integration:</strong> The pricing agent accesses your pricing API, applies relevant discounts, and calculates the final quote.</li><li><strong>Response generation:</strong> The sales agent compiles all information and generates a personalized response.</li></ol><p>Each step involves autonomous decision making. The agent determines which databases to query, what information is relevant, which specialized agents to involve, and how to present the final response, all without explicit programming for this specific scenario.</p><h3>The Protocol Revolution: MCP, A2A, and ACP</h3><p>The real power of agents emerges through standardized communication protocols:</p><ul><li><strong>MCP (Model Context Protocol):</strong> Enables agents to discover and use tools. Think of it as the API that lets an AI access your calculator, web search, or database.</li><li><strong>A2A (Agent to Agent Protocol):</strong> Allows specialized agents from different vendors to collaborate, such as a translation agent working with a content creation agent.</li><li><strong>ACP (Agent Communication Protocol):</strong> Provides structured, secure communication for agents within enterprise environments.</li></ul><p>These protocols transform isolated AI capabilities into interconnected, collaborative systems that can tackle complex, multi step problems.</p><h3>The Enterprise Impact</h3><p>For businesses, agents represent both an opportunity and a challenge.</p><h4>The Opportunity</h4><ul><li>Autonomous handling of complex workflows</li><li>24/7 operation without human intervention</li><li>Dynamic problem solving that adapts to new situations</li><li>Seamless integration across multiple systems and data sources</li></ul><p>Used correctly, agents can compress multi step human workflows into a single request and response. They become always on operators sitting across support, finance, engineering, and operations.</p><h4>The Challenge</h4><ul><li><strong>Visibility:</strong> How do you monitor ephemeral processes that generate code on the fly and terminate in seconds?</li><li><strong>Governance:</strong> How do you ensure agents comply with policies when their behavior is non deterministic and context dependent?</li><li><strong>Security:</strong> How do you prevent unauthorized data access when agents operate autonomously across tools, APIs, and datasets?</li></ul><p>Traditional monitoring and access control systems were built for predictable applications and human users. Agents cut across both.</p><h3>Why Agents Are Different from Any Identity That Exists So Far</h3><p>Traditional enterprise systems deal with predictable entities. Users have defined roles, applications have fixed behaviors, and services follow predetermined patterns. Security and governance frameworks are built around these assumptions.</p><p>Agents shatter those assumptions.</p><p>They are not users, they are not applications, and they are not services. They are something entirely new: adaptive, autonomous entities that blur the boundaries between all three.</p><p>Unlike any identity we have dealt with before, agents can:</p><ul><li>Spawn new processes and workflows on their own</li><li>Make independent decisions about which tools and APIs to call</li><li>Create or coordinate with other agents</li><li>Move across multiple systems and data boundaries in a single run</li></ul><p>They operate in a gray zone that traditional security and governance frameworks were not designed to handle. Even when every MCP tool is individually well scoped and monitored, the way agents chain these together creates a new, emergent attack and governance surface.</p><p>This is not just an evolution of existing computing paradigms. It is a shift that demands fundamentally new approaches to visibility, control, and trust.</p><p>In our next post, we will dive deep into why agents represent a completely new class of identity and the unique security and governance challenges they present. We will explore how their ephemeral nature, emergent behaviors, and ability to traverse traditional security boundaries make them unlike anything enterprise IT has encountered before.</p><p><strong>About the authors</strong></p><p>Apurv is the co founder of Aurva and a former AI engineering leader at Meta. He combines deep experience in building large scale AI systems with hands on security work at Aurva, and is passionate about bridging the gap between data and AI teams and security teams.</p><p>Basuraj is Head of AI Products at Uniphore and an AI strategist focused on applied machine intelligence. He has spent the last decade building conversational AI systems, leading AI engineering teams, and shaping product strategy across high-growth startups and enterprise platforms.</p><p>Aurva’s AIOStack provides visibility into agent operations using eBPF technology to monitor AI activities at the kernel level, helping enterprises understand what their agents are doing, which data they touch, and how they interact with the rest of the environment.</p><p><strong>Get started with AIOStack Community Edition →</strong> <a href="https://github.com/aurva-io/AIOstack">https://github.com/aurva-io/AIOstack</a></p><p><strong>Read More on</strong> <strong>→</strong> <a href="https://aurva.ai/">https://aurva.ai/</a></p><p><strong>Join our Slack community →</strong> <a href="https://join.slack.com/t/aiostack-aurva/shared_invite/zt-3idcrvhdx-3ExhxVeMTGjYsqPgKPDd_Q">https://join.slack.com/t/aiostack-aurva/shared_invite/zt-3idcrvhdx-3ExhxVeMTGjYsqPgKPDd_Q</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=472ceb9b8f5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing AIOStack: AI Security That Moves at the Speed of AI]]></title>
            <link>https://medium.com/@apurv_61269/introducing-aiostack-ai-security-that-moves-at-the-speed-of-ai-340e87bf034f?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/340e87bf034f</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[shadow-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[compliance]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Thu, 13 Nov 2025 09:16:09 GMT</pubDate>
            <atom:updated>2025-11-17T11:58:01.525Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZQMXzKZNXtNaS_Ge4FejLw.png" /></figure><p>Every CEO has the same mandate right now: ship AI features faster. Improve efficiency. Cut costs. Use Claude, use GPT, use whatever works, just make it happen.</p><p>And AI teams are delivering. They’re building agents that automate customer support, embedding LLMs into products, and deploying AI workflows that make real decisions in production. For the first time, engineering velocity isn’t the bottleneck.</p><p>Security is.</p><h3>The Problem: Two Teams, Two Languages, Zero Alignment</h3><p>Here’s the uncomfortable truth: security teams and AI teams don’t speak the same language.</p><p>I’ve lived this firsthand. As an AI engineer at Meta, I dreaded security and privacy reviews before prod releases. They felt like speed bumps when I just wanted to ship. But Meta had one thing right: they monitored everything in production without getting in the way.</p><p>That is the model that should exist everywhere.</p><p>For AI engineers, the metrics that matter are <strong>accuracy</strong> and <strong>latency</strong>. Did the model return the right answer? Did it do it in under 200ms? Everything else, like compliance reviews, security scans, and manual audits, feels like friction. A blocker to shipping. A checkbox that does not help them get promoted.</p><p>For security teams, AI is an uncontrollable black box. They see API keys hardcoded in repos (sometimes personal GPT or Claude API keys), PII flowing to third-party LLMs, and agents calling endpoints they have never heard of. They know the risk is real. But they do not have visibility. They do not have control. And they lack the trust of AI engineers who see them as the “department of no.”</p><p>The result? <strong>Shadow AI.</strong></p><p>According to reports, up to 80% of AI usage in enterprises is unsanctioned. Developers are spinning up GPT integrations, calling Anthropic APIs, and building agentic workflows without security ever knowing they exist. <a href="https://www.netskope.com/resources/reports-guides/cloud-and-threat-report-shadow-ai-and-agentic-ai-2025">AI engineers are downloading models and components from Hugging Face in 67% of organizations.</a> It is not malicious. It is just faster. And in a world where every competitor is racing to ship AI, faster wins.</p><p>But faster without visibility is a ticking time bomb.</p><h3>Why Traditional Security Doesn’t Work for AI</h3><p>Traditional security tools were not built to understand AI at runtime.</p><p>Gateway-based security can catch users browsing to GenAI apps, but not services making direct API calls.</p><p>Code scanners can find hardcoded API keys, but not containerized services that download models at startup.</p><p>Even cloud security platforms that do runtime monitoring see network traffic, but they cannot decode AI-specific protocols or give you semantic visibility into what AI services are actually doing.</p><p><strong>The critical gap is not just visibility. It is AI-native visibility.</strong></p><p>You might see:</p><p>outbound HTTPS traffic to api.anthropic.com</p><p>But what you actually need to see is:</p><p>Service X sent customer PII in a Claude API call using MCP</p><p>You might catch anomalous data exfiltration, but not understand that it is an agent chain using A2A calls to orchestrate a workflow.</p><p>AI traffic flows between services, across clusters, and through third-party APIs. It is <strong>dynamic, distributed, ephemeral, and non-deterministic</strong>. Static controls and perimeter-based thinking do not survive contact with that reality.</p><p>Here is the worst part: even when security tries to help, they become the bottleneck. Every new AI integration requires a review. Every new LLM endpoint needs approval. Every agent chain needs an audit. The process is manual and slow, the exact opposite of how AI teams work.</p><p>We cannot secure AI by slowing it down.</p><h3>The Insight: Security Needs to Be Invisible</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MIHuRDaP5Z0m5VqhwL14QA.png" /><figcaption>AIOStack sits under your AI stack. Seeing everything. Slowing nothing.</figcaption></figure><p>The breakthrough came from a simple realization:</p><p><strong>Security for AI cannot be a gate. It has to be a mirror.</strong></p><p>AI teams will always prioritize speed and accuracy. That is their job. We should not try to change that.</p><p>Instead, security has to work <em>invisibly</em>, monitoring everything in real time, without code changes, without extra latency, and without sending developers into yet another compliance workflow.</p><p>That is why we built AIOStack on <strong>eBPF</strong>.</p><p>eBPF (extended Berkeley Packet Filter) lets us observe network calls and data flows at the kernel level in your Kubernetes environment. We don’t need app-side agents or SDKs. We don’t need developers to instrument their code. We don’t need security teams to manually chase every new endpoint.</p><p>AIOStack <strong>automatically discovers</strong> every AI service running in your environment. It decodes modern AI protocols, MCP (Model Context Protocol), ACP (Agent Communication Protocol), and A2A (Agent-to-Agent communication), and gives you instant visibility into:</p><ul><li><strong>Which services are making LLM API calls</strong> (even the ones security never approved)</li><li><strong>What data is being sent</strong> to Claude, GPT, Gemini, or any other external AI provider</li><li><strong>How agents are chaining together</strong> and what tools they are accessing</li><li><strong>Where PII is leaking</strong> through prompts, embeddings, or model responses</li></ul><p>All of this happens continuously in the background, without blocking deployments and without adding measurable latency to your AI workloads.</p><p><strong>No tickets. No code changes. Just a clear, live picture of what your AI stack is actually doing.</strong></p><h3>Why We’re Launching a Community Edition</h3><p>Every AI-native startup is being asked to do two hard things at once:</p><ol><li><strong>Move faster than ever.</strong> Ship features weekly. Iterate on models daily. Beat competitors to market.</li><li><strong>Pass enterprise security reviews.</strong> Prove to CISOs that you are not leaking customer data and that your AI stack is governed.</li></ol><p>The companies that figure out both will win. The ones that do not will either:</p><ul><li>Sacrifice security (and pay for it later), or</li><li>Sacrifice speed (and get outrun by competitors)</li></ul><p>We refuse to accept that trade-off.</p><p>That is why we are <strong>launching AIOStack Community Edition</strong>, a free distribution built on an open core model. We want AI-native companies to grow fast, scale confidently, and walk into enterprise security conversations with receipts before they can afford a six-figure security platform, and we want enterprises to stop spending months in POCs or millions of dollars just to unblock their AI adoption.</p><p>The community edition gives you:</p><ul><li><strong>Automatic AI service discovery</strong> across your Kubernetes clusters</li><li><strong>Shadow AI detection</strong> for every LLM integration, sanctioned or not</li><li><strong>Protocol decoding</strong> for MCP, ACP, and A2A chains</li><li><strong>Real-time observability</strong> of what data is flowing to external AI providers</li><li><strong>Cost tracking</strong> for OpenAI, Anthropic, and Gemini usage so finance is not flying blind</li></ul><p>No sales calls. No procurement. No six-month pilot.</p><p>Just deploy AIOStack to your cluster and start seeing what is actually happening in your AI stack.</p><h3>This Is Just the Beginning</h3><p>We are not bolting an “AI module” onto a legacy CSPM product. We are not sprinkling LLM scanning on top of an old security platform.</p><p>We are building <strong>a security layer designed from the ground up for the AI-native era.</strong></p><p>Because AI security is not just “security, but for AI”:</p><ul><li>Static analysis breaks when your app’s behavior changes with each prompt</li><li>Perimeter defenses break when agents call external APIs dozens of times per second</li><li>Manual reviews break when developers are shipping AI features daily</li></ul><p>AI security needs to be <strong>autonomous, adaptive, and invisible</strong>. It needs to match the speed of AI development. It needs to give security teams deep visibility without turning them into the bottleneck. And it needs to let AI teams do what they do best, build incredible products, without compromising on safety.</p><p>That is what AIOStack is. That is why we built it. And that is why we are making Aurva AIOStack freely available via community edition.</p><h3>Get Started</h3><p><strong>Get started with AIOStack Community Edition →</strong> <a href="https://github.com/aurva-io/AIOstack">https://github.com/aurva-io/AIOstack</a></p><p><strong>Read More on</strong> <strong>→</strong> <a href="https://aurva.ai/">https://aurva.ai/</a></p><p><strong>Join our Slack community → </strong><a href="https://join.slack.com/t/aiostack-aurva/shared_invite/zt-3idcrvhdx-3ExhxVeMTGjYsqPgKPDd_Q">https://join.slack.com/t/aiostack-aurva/shared_invite/zt-3idcrvhdx-3ExhxVeMTGjYsqPgKPDd_Q</a></p><p><strong>Read the technical deep dive →</strong> <em>(coming soon)</em></p><blockquote>The future is AI-native. The future of security needs to be too.</blockquote><p><em>— <br> Apurv</em></p><p><em>Founder, Aurva</em></p><p><em>Forever an AI Engineer</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=340e87bf034f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Access ≠ Usage: Why DSPM Needs Runtime Identity Awareness]]></title>
            <link>https://medium.com/@apurv_61269/access-usage-why-dspm-needs-runtime-identity-awareness-ac6decc1389b?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac6decc1389b</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[ai-security]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Wed, 30 Jul 2025 20:00:58 GMT</pubDate>
            <atom:updated>2025-07-30T20:03:34.401Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3rp7g7rJ-WIvrNGIFeBtRg.png" /></figure><p>As organizations accelerate AI adoption, they’re racing to inventory data, classify sensitive assets, and implement governance frameworks. Naturally, DSPM adoption is on the rise.</p><p>But here’s the catch: DSPM remains largely a governance tool. It answers foundational questions like: <em>Where does my sensitive data live? Who can access it? Is it properly classified and encrypted?</em></p><p>These are critical, but incomplete. Many CISOs we’ve spoken with raise the same concern: DSPM often falls short on continuous value and actionability. Knowing where data resides and who can access it is useful; but without context on actual usage, it’s hard to decide what to fix, revoke, or prioritize.</p><p>To truly secure data in today’s AI-powered, hybrid environments, you need more than visibility into static policies and permissions. You need insight into actual behavior.</p><h3>Static Governance Tells You What Should Happen. Not What Is Happening.</h3><p>DSPM tools operate like well-maintained blueprints: they tell you how access is designed. But attackers and insider threats don’t care about how your IAM policies are structured on paper. They exploit how things work in practice.</p><p>For example:</p><ul><li>A service account might have write access to production data, but no one has used that access in six months.</li><li>An engineer may be accessing staging data regularly, but also has permissions to sensitive customer data in production that are never exercised, until they are.</li></ul><p>Without runtime monitoring, these scenarios fly under the radar.</p><h3>Why Access Monitoring Completes the Picture</h3><p>To mitigate risk and enforce true least privilege, you need both:</p><ul><li><strong>Access Governance</strong>: Who <em>should</em> have access? What are the intended boundaries?</li><li><strong>Access Monitoring</strong>: Who <em>is</em> accessing what? What is actually happening?</li></ul><p><strong>When Access Governance and Monitoring</strong> are combined, it together unlocks:</p><ul><li>Detection of over-permissioned users and roles</li><li>Identification of unused access (for revocation)</li><li>Discovery of anomalous access patterns (e.g. staging app reading prod DB)</li><li>A feedback loop into your governance models</li></ul><p>This combination transforms DSPM from a static asset inventory into a dynamic risk engine.</p><h3>Uncovering the Blind Spot: From Policy to Reality</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsJudFr3u4ZwOcgKfbJJXA.png" /></figure><p>Many teams assume they’re secure once they’ve reviewed access policies and passed compliance audits. But policies don’t guarantee protection.</p><p>The real risk lives in what happens after deployment — when applications and identities interact with sensitive data in unexpected ways. That’s the blind spot DSPM doesn’t see.</p><p>Runtime monitoring fills this gap. It shows which identities are using which permissions, where data is flowing, and whether usage aligns with expectations. Not after the fact, but as it happens.</p><p>In modern AI systems, data moves constantly — between services, clouds, teams, and vendors. Static governance doesn’t keep pace. You need visibility into real behavior.</p><p>Zero Trust isn’t achieved through policy alone. It requires continuous verification. And that means monitoring real access patterns, not just provisioning logic.</p><p>When <strong>governance</strong> (what’s allowed) and <strong>monitoring</strong> (what’s happening) are connected, you can:</p><blockquote><strong>- Identify unused or risky access</strong></blockquote><blockquote><strong>- Enforce least privilege at runtime</strong></blockquote><blockquote><strong>- Minimize the impact of compromised identities or misconfigurations</strong></blockquote><p>This is how organizations move from theoretical compliance to active enforcement, and from guesswork to real control.</p><h3>The Path Forward: Dynamic, Behavior-Aware Security</h3><p>DSPM is a vital step in data security maturity. But relying on it alone is like setting your house rules without checking if they’re followed. True data protection comes from combining <strong>data access governance</strong> with <strong>data access monitoring</strong>.</p><p>Because attackers don’t care about your policies. They care about the gaps. They look to exploit the over-privileged, unmonitored identities. And you can’t close those gaps if you can’t see them.</p><p><em>Aurva is a runtime data security platform that goes beyond DSPM to monitor all data flows in real-time. We combine access governance with eBPF-powered deep monitoring to help organizations secure sensitive data, detect insider threats, and stay audit-ready via Database Activity Monitoring (DAM).</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac6decc1389b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Digital Personal Data Protection Act (DPDPA): A Data Protection Perspective]]></title>
            <link>https://medium.com/@apurv_61269/understanding-the-digital-personal-data-protection-act-dpdpa-a-data-protection-perspective-91ef2aebbc2b?source=rss-446a5595b134------2</link>
            <guid isPermaLink="false">https://medium.com/p/91ef2aebbc2b</guid>
            <category><![CDATA[dspm]]></category>
            <category><![CDATA[database-activity]]></category>
            <category><![CDATA[ai-security]]></category>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[dpdpa]]></category>
            <dc:creator><![CDATA[Apurv Garg]]></dc:creator>
            <pubDate>Tue, 21 Jan 2025 23:59:59 GMT</pubDate>
            <atom:updated>2025-01-21T23:59:59.908Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJN8lEgRPAV9EGTgBCfODA.png" /></figure><p>DPDPA is all the hype right now in India and globally. I wanted to deep dive a bit more on the current DPDPA draft, and have divided it into two key parts:</p><p><strong>1️⃣ Data Protection</strong></p><p><strong>2️⃣ Consent Management</strong></p><p>The consensus among experts we’ve interacted with is that the rules are much clearer from the <strong>Data Protection</strong> perspective. This clarity comes from the precedence set by RBI/SEBI Infosec guidelines, which many provisions align with.</p><p>Here are some key takeaways from the <strong>Data Protection</strong> aspect:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rRX5u14HsICDOig_j_v-MA.png" /></figure><p><strong>🔑 Section 3: Notices to Data Principals</strong></p><p>Organizations must clearly understand <strong>what data they are collecting and the purpose behind it</strong>. A notice generator can simplify this process, providing users with clear, purpose-driven notices for consent.</p><p><strong>🔑 Section 6: Security Safeguards</strong></p><p>From foundational measures like encryption and disaster recovery to advanced practices such as access controls and database activity monitoring, the goal is to align other industries with the established RBI/SEBI Infosec norms.</p><p><strong>🔑 Section 7: Notice of Data Breach</strong></p><p>Previously, organizations in key sectors were required to notify CERT-IN of potential breaches. Now, this responsibility extends to notifying users directly. Companies must quickly identify and communicate the specific user data impacted, emphasizing rapid breach response capabilities.</p><p><strong>🔑 Section 12: Data Protection Impact Assessment (DPIA)</strong></p><p>Unlike traditional data privacy impact assessments, DPIAs under DPDPA focus on auditing <strong>data security practices</strong> and potentially how consents are managed, echoing regulated industry audit requirements.</p><p>Additionally, companies must monitor and ensure that personal data and traffic data related to its flow are not transferred outside India — essentially emphasizing the need for egress traffic monitoring.</p><p><strong>🔑 Section 14: Cross-Border Data Transfers</strong></p><p>This reinforces the emphasis on <strong>data sovereignty</strong>, ensuring sensitive data remains within Indian borders.</p><p><strong>🔑 Section 22(1): Government Access to Data</strong></p><p>This provision raises privacy concerns as it enables the government to request data from fiduciaries like Facebook or Google, potentially challenging user privacy.</p><p>Lastly, the <strong>Third Schedule</strong> identifies e-commerce, gaming, and social media as key sectors under scrutiny. These industries, despite their rapid innovation, often lag behind in security practices compared to sectors regulated by RBI, SEBI, or IRDAI. This also offers a glimpse into the evolving definition of a “Significant Data Fiduciary.”</p><p>As we explore <strong>consent and governance rules</strong> in future discussions, it’s evident that the DPDPA is not just about compliance but a transformative step towards a privacy-respecting, user-centric digital economy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91ef2aebbc2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>