<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Machine Learning and Artificial Intelligence]]></title><description><![CDATA[Machine Learning and Artificial Intelligence]]></description><link>https://ganeshhegde.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 19:40:45 GMT</lastBuildDate><atom:link href="https://ganeshhegde.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[The Inbox Operations Agent]]></title><description><![CDATA[Assume that we are helping a small company with a digital tool to manage their emails. Some of them are benign, some contain important invoices, some have advertisements and some are dangerous. This d]]></description><link>https://ganeshhegde.hashnode.dev/the-inbox-operations-agent</link><guid isPermaLink="true">https://ganeshhegde.hashnode.dev/the-inbox-operations-agent</guid><category><![CDATA[AI]]></category><category><![CDATA[harnessengineering]]></category><category><![CDATA[agentic AI]]></category><category><![CDATA[agents]]></category><category><![CDATA[data]]></category><category><![CDATA[Bayesian Inference]]></category><dc:creator><![CDATA[Ganesh Rama Hegde]]></dc:creator><pubDate>Sat, 15 Aug 2026 11:59:03 GMT</pubDate><content:encoded><![CDATA[<p>Assume that we are helping a small company with a digital tool to manage their emails. Some of them are benign, some contain important invoices, some have advertisements and some are dangerous. This digital assistant tool - Inbox Operations Agent - is a good substitute for a manual helper as he has to skim a lot of emails that consume time.</p>
<p>The agent does the following for every email that arrives in the inbox:</p>
<ol>
<li><p>read one new email</p>
</li>
<li><p>decide whether it looks safe or dangerous, and</p>
</li>
<li><p>deliver it, hold it for review, or block it.</p>
</li>
</ol>
<p>Look at step 3 again. The agent does something very important. It acts before it knows everything. It does not know the truth inside an unopened link. It must make a careful decision using incomplete clues. That is why agentic thinking must be probabilistic.</p>
<p>Let us elaborate further based on our understanding so far. Initially our agent has four moving parts:</p>
<ol>
<li><p>Read new email.</p>
</li>
<li><p>Build a new prompt using a program.</p>
</li>
<li><p>Ask the LLM model using the Anthropic API - "Is this email safe or dangerous?"</p>
</li>
<li><p>If the answer received is safe, then deliver the email or if the answer is dangerous then block it.</p>
</li>
</ol>
<p>Let us denote the above version as V0. It answers, acts and forgets. This model has only two decisions - safe or dangerous. It forgets after the job is done.</p>
<p>Say we have a new email: <mark class="bg-yellow-200 dark:bg-yellow-500/30">"Your mailbox closes today if not paid 5000 USD. Sign in now."</mark></p>
<p>This looks like a phishing email. The model returns the answer as "safe" and the V0 agent delivers the email. This is a genuine problem. As a human, we understand that phishing is dangerous and the email needs to be blocked. But V0 has no such understanding.</p>
<p>Therefore, we build something outside V0 that knows the correct answer and compares V0's answer with it.</p>
<p>We need something that can say: "Here is what the agent predicted, and here is what was actually true."</p>
<p>Now we have a new problem - For a new email, we don't know the truth. So, we need a collection of old emails where humans have already established the truth.</p>
<p>That outside mechanism needs a <strong>human-labelled test set</strong>. Imagine a human safety reviewer. We give that person 100 old emails.</p>
<p>For each email, the reviewer examines the evidence and determines the final verified answer:</p>
<p>Email 1 → Safe</p>
<p>Email 2 → Dangerous</p>
<p>Email 3 → Safe</p>
<p>Email 4 → Dangerous</p>
<p>....</p>
<p>Email 100 → Safe/Dangerous</p>
<p>So we now have a table:</p>
<table>
<thead>
<tr>
<th>Email</th>
<th>Human-verified answer</th>
</tr>
</thead>
<tbody><tr>
<td>"Team lunch moved to 1 PM."</td>
<td>Safe</td>
</tr>
<tr>
<td>"Reset your password at..."</td>
<td>Dangerous</td>
</tr>
<tr>
<td>"Invoice 1842 is attached."</td>
<td>Safe</td>
</tr>
<tr>
<td>"Your mailbox closes today..."</td>
<td>Dangerous</td>
</tr>
<tr>
<td>...</td>
<td>...</td>
</tr>
</tbody></table>
<p>The <strong>human-verified answer is the label</strong>.</p>
<p>Therefore: <strong>Human-labelled test set = a collection of test examples for which humans have already established the correct answer.</strong></p>
<p>During the test, we <strong>hide the answer column from the agent</strong>. Otherwise the model could copy the answer and the test would prove nothing.</p>
<p>We now connect V0 and the test-set without exposing the answer. That piece is called the evaluation harness. The harness is a scaffolding built <strong>around</strong> V0 specifically so that mistakes have somewhere to be caught.</p>
<p>What does the evaluation harness do?</p>
<p>There are five steps</p>
<ol>
<li><p>Hide - Take the email and the corresponding human answer. Hide the answer from V0.</p>
</li>
<li><p>Ask - Give only the email to V0. V0 produces the answer - safe or dangerous.</p>
</li>
<li><p>Save - save the answer produced by V0 in step 2.</p>
</li>
<li><p>Reveal - We reveal what the human said</p>
</li>
<li><p>Compare - we compare both the answers in steps 3 and 4 above.</p>
</li>
</ol>
<p>This is the complete evaluation loop.</p>
<p>Hide → Ask → Save → Reveal → Compare</p>
<p>Remember the earlier phishing email ?</p>
<p>The harness now records:</p>
<p>V0 → Safe</p>
<p>Human → Dangerous</p>
<p>Comparison → WRONG</p>
<p>That is how failure becomes visible.</p>
<p>Now we run all the 100 human-labelled emails via V0.</p>
<p>Assume, V0 agrees with human answer on 92 emails and V0 disagrees on 8 emails.</p>
<p>Therefore, Accuracy = 92 / 100 = 0.92 or 92%</p>
<p>92% is thus calculated by the evaluation harness.</p>
<p>Now, to demonstrate why accuracy alone is insufficient, let's construct a deliberately trivial baseline that predicts SAFE for every test email.</p>
<p>In this case, the 8 dangerous emails will be passed as "safe" by V0. The agent collected 92 easy points by repeating the common answer. Yet it failed on every message that the safety system existed to find. Thus the V0 agent cannot detect dangerous emails for which it was originally built<a href="http://for.It">.</a> It requires human intervention to inspect the important failures and their consequences.</p>
<p>The share of dangerous messages - 8 out of 100 - is the danger <strong>base rate</strong>. A base rate answers, “Before inspecting the words of one particular email, how common is this outcome in the population we care about?” Here, the observed danger base rate is 8%.</p>
<p>Because the test has 92 safe rows and only 8 dangerous rows, the two classes are not balanced. This is <strong>class imbalance</strong>.</p>
<p>We now get back to the inspection of the 8 failures.</p>
<p>We are not interested in the number of wrongs. In this case it is 8. We are more interested in "What kind of wrong"? Does the agent miss attacks, block invoices, misunderstand one language, or fail on hacked real accounts? Once we can name the failure, we can change the prompt, evidence, model, or action rule for a reason. Then we run the same test again and see whether that specific failure improved.</p>
<p>We begin by classifying each result into four categories.</p>
<ol>
<li><strong>True Positive — TP</strong></li>
</ol>
<p>Agent says: Dangerous. Human says: Dangerous</p>
<p>Correctly caught threat (Correct Alarm).</p>
<p><strong>2. True Negative — TN</strong></p>
<p>Agent says: Safe. Human says: Safe</p>
<p>Correctly delivered safe email.</p>
<p>3. <strong>False Positive — FP</strong></p>
<p>Agent says: Dangerous. Human says: Safe</p>
<p>False alarm.</p>
<p>4. <strong>False Negative — FN</strong></p>
<p>Agent says: Safe. Human says: Dangerous</p>
<p>Missed threat.</p>
<p>These four counts form the <strong>confusion matrix</strong></p>
<p>It is called confusion matrix because we put two things beside each other:</p>
<p>What the agent predicted VS What was actually true. The table shows where they agree and where they get "confused."</p>
<p>It is simply a <strong>2 × 2 count table</strong>.</p>
<p>From the confusion matrix we introduce two new concepts <strong>precision</strong> and <strong>recall.</strong></p>
<p><strong>Recall</strong></p>
<p>Start with the <strong>human's dangerous emails</strong>. Of all the real threats, how many did we catch?</p>
<p><strong>Recall = TP / (TP + FN)</strong></p>
<p><strong>Precision</strong></p>
<p>Start with the <strong>agent's dangerous predictions</strong>. When the agent says "dangerous", how often is it right?</p>
<p><strong>Precision = TP / (TP + FP)</strong></p>
<p>The useful concepts to memorize:</p>
<p><strong>Recall starts with what was actually dangerous.</strong></p>
<p><strong>Precision starts with what the agent called dangerous.</strong></p>
<p>Let us consider two different errors.</p>
<p>Error 1 - Agent misses a harmless newsletter.</p>
<p>Error 2 - Agent misses a password-stealing email.</p>
<p>Both contribute: 1 wrong answer to accuracy.</p>
<p>But their consequences are completely different.</p>
<p>For example:</p>
<ul>
<li><p>reviewing a safe email → ₹50</p>
</li>
<li><p>delaying a genuine invoice → ₹500</p>
</li>
<li><p>delivering a credential-stealing email → potentially ₹10,00,000</p>
</li>
</ul>
<p>So we add another record: What did this mistake cost?</p>
<p>So far We have solved: <strong>"How do I measure what happened on past emails?"</strong> But we have <strong>not</strong> solved:</p>
<p><strong>"What should V0 believe about a brand-new email?"</strong></p>
<p>That's because the test set has something a live email doesn't: <strong>a known human answer.</strong></p>
<p>For a brand-new email #101:</p>
<p><strong>Email #101</strong> -&gt; V0 -&gt;????</p>
<p>There is no human label available yet.</p>
<p>We therefore cannot run <strong>predict → reveal → compare</strong></p>
<p>because there is nothing to reveal. And V0 only knows: <strong>Safe / Dangerous</strong></p>
<p>This limitation brings us to chapter 2.</p>
<h3><strong>Chapter 2</strong></h3>
<p>Chapter 1 was all about - How well did the agent perform when we eventually know every answer?</p>
<p>This was possible because of the human-labelled test set.</p>
<p>For every old email, we had: <strong>Email + Human-verified answer</strong></p>
<p>So the evaluation harness could do:</p>
<p><strong>hide answer -&gt; ask agent -&gt; get prediction -&gt; reveal answer -&gt; compare</strong></p>
<p>The truth was already sitting in the answer key.</p>
<p>Now Email#101 arrives. It asks for money by noon.</p>
<p>Now the agent must classify the email as safe or dangerous. But how? This email does not resemble anything from the test set.</p>
<p>The email looks something like this:</p>
<p><strong>From:</strong> <a href="mailto:accounts@example.com">accounts@example.com</a><br /><strong>Subject:</strong> Invoice account changed</p>
<p><strong>We changed our bank account today. Please use the attached details for the ₹4,80,000 payment due at noon.</strong></p>
<p>It could be any of the four possibilities:</p>
<p><strong>World A</strong></p>
<p>The supplier really changed its bank account.</p>
<p><strong>World B</strong></p>
<p>An attacker copied the supplier's identity.</p>
<p><strong>World C</strong></p>
<p>The <strong>real supplier's mailbox was hacked</strong>.</p>
<p><strong>World D</strong></p>
<p>It's ordinary spam.</p>
<p>These aren't predictions yet. They are <strong>possible explanations of reality</strong>.</p>
<p>Actually, the email belongs to one of the above four worlds. There is only one reality.</p>
<p>For this particular email, exactly <strong>one complete story is actually true</strong>. This is the outcome.</p>
<p>Perhaps: <strong>World C = real supplier account hacked</strong></p>
<p>But we have no idea.</p>
<p>Imagine the true story is written on a card and placed inside a sealed envelope. The card says one of:</p>
<p>A → Genuine supplier update B → Copied sender C → Hacked supplier account D → Ordinary spam</p>
<p>The agent cannot open the envelope.</p>
<p>What can it see?</p>
<p>It sees signals:</p>
<ul>
<li><p>sender</p>
</li>
<li><p>subject</p>
</li>
<li><p>words</p>
</li>
<li><p>attachment</p>
</li>
<li><p>time</p>
</li>
<li><p>past records</p>
</li>
</ul>
<p>Those are observations. They are clues about reality. They are not reality itself.</p>
<p>Here we introduce three new concepts.</p>
<ol>
<li><p>Hidden reality - What is actually true. For Message 101: Perhaps the supplier account was hacked.</p>
</li>
<li><p>Visible clues - What the agent can inspect.</p>
<p>For example: sender, subject, attachment, account history.</p>
</li>
<li><p>Current belief - What the agent currently thinks those clues support.</p>
<p>For example: "Hacked account looks fairly plausible."</p>
</li>
</ol>
<h3>Why V0 is inadequate?</h3>
<p>V0 still does: Email -&gt; Safe or Dangerous.</p>
<p>But after email 101 arrived we now know that the truth could be any one of the four possibilities:</p>
<p>a) genuine supplier update</p>
<p>b) copied sender / phishing</p>
<p>c) hacked account</p>
<p>d) spam</p>
<p>These are <strong>possible worlds</strong>—possible explanations of what is actually happening.</p>
<p>Now we want the new agent to maintain a record of its <strong>uncertainty across these possibilities</strong>, instead of immediately collapsing everything into one word - DANGEROUS.</p>
<p>That record is the <strong>belief board</strong>.</p>
<p>Example:</p>
<table>
<thead>
<tr>
<th>Possible world</th>
<th>Belief</th>
</tr>
</thead>
<tbody><tr>
<td>Genuine supplier update</td>
<td>35%</td>
</tr>
<tr>
<td>Copied sender</td>
<td>35%</td>
</tr>
<tr>
<td>Hacked supplier account</td>
<td>25%</td>
</tr>
<tr>
<td>Ordinary spam</td>
<td>5%</td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td><strong>100%</strong></td>
</tr>
</tbody></table>
<p>But why 35%, 35%, 25%, 5%? These numbers are illustrative.</p>
<p>They are not calculated from V0. They are not stored inside V0.</p>
<p>They are an example of what a belief state could look like.</p>
<p>The purpose is to demonstrate the idea: "Instead of saying only Dangerous, suppose the agent explicitly distributes 100 units of belief across the plausible explanations."</p>
<p>So imagine the agent has 100 belief points to distribute.</p>
<p>It might say:</p>
<ul>
<li><p>35 points support genuine</p>
</li>
<li><p>35 support copied sender</p>
</li>
<li><p>25 support hacked account</p>
</li>
<li><p>5 support spam</p>
</li>
</ul>
<p>The exact numbers could have been different for this illustration—for example, 50/20/25/5. What matters at this stage is that:</p>
<ol>
<li><p>every plausible world gets some representation</p>
</li>
<li><p>the numbers add up to 100%</p>
</li>
<li><p>larger numbers mean greater current belief</p>
</li>
<li><p>the distribution represents the agent's current uncertainty.</p>
</li>
</ol>
<p>Given the evidence currently available to the new agent, 35% of its current belief is assigned to the "genuine supplier update" possibility. The agent is dealing with uncertainty about which world is actually true.</p>
<p>There is still only one actual reality.</p>
<p>For example, perhaps the real situation is: The supplier's account was hacked.</p>
<p>Then the truth is:</p>
<p>Genuine → FALSE</p>
<p>Copied sender → FALSE</p>
<p>Hacked account → TRUE</p>
<p>Spam → FALSE</p>
<p>The probability describes <strong>our uncertainty</strong>, not a physical mixture inside the email.</p>
<p>Later, evidence arrives.</p>
<p>For example:</p>
<p>The supplier says, "We never changed our bank account."</p>
<p>Now the agent's belief might shift dramatically toward:</p>
<p><strong>Genuine         3%</strong></p>
<p><strong>Copied sender 12%</strong></p>
<p><strong>Hacked account 83%</strong></p>
<p><strong>Spam             2%</strong></p>
<p><strong>The reality did not change.</strong></p>
<p>What changed was the agent's <strong>knowledge about the reality</strong>.</p>
<p>The entire board:</p>
<p>Genuine        35%</p>
<p>Copied sender 35%</p>
<p>Hacked account 25%</p>
<p>Spam             5%</p>
<p>is the <strong>probability distribution</strong>.</p>
<p>The <strong>whole arrangement</strong> is the distribution.</p>
<p>It represents: <strong>How the agent's uncertainty is distributed across the possible stories.</strong></p>
<p>This introduces a new problem. The Finance department asks us: Should I hold back the email. Answer "Yes" or "No". It does not care about percentages and numbers like 35 or 25.</p>
<p>We introduce two new concepts: <strong>EVENT</strong> and <strong>RANDOM VARIABLE</strong> to resolve the new deadlock.</p>
<p>The finance team asks us - Does this email require a safety hold?</p>
<p>It means - Temporarily stop the payment/action until the situation is verified.</p>
<p>For us, it means out of the four possibilities which stories should count as yes (to hold back the payment). The answer is Copied Sender and Hacked Account.</p>
<p>These selected group of outcomes is the <strong>event</strong>.</p>
<p>An <strong>event is a selected set of possible outcomes that answers one particular yes/no question.</strong></p>
<h3><strong>Event in mathematical form</strong></h3>
<p>Our sample space is S= {Genuine, Copied, Hacked, Spam}</p>
<p>Our event is: D= {Copied, Hacked}</p>
<p>So: P(D)=P(Copied)+P(Hacked)</p>
<p>Using our belief board:</p>
<p>P(D)=35%+25%=60%</p>
<p>Therefore: <strong>There is currently a 60% belief that this email belongs to the payment-attack event.</strong></p>
<h3>Random Variable</h3>
<p>Finance team doesn't even want the word "event." Its software wants something executable:</p>
<p><strong>1 = hold</strong></p>
<p><strong>0 = don't hold</strong></p>
<p>So define a rule:</p>
<p><strong>Genuine       → 0</strong></p>
<p><strong>Copied sender → 1</strong></p>
<p><strong>Hacked        → 1</strong></p>
<p><strong>Spam          → 0</strong></p>
<p>We call this rule <strong>D</strong>. That rule is a: <strong>Random variable.</strong></p>
<p><strong>Do not confuse the word random.</strong></p>
<p>The rule is fixed:</p>
<p><strong>Copied → 1</strong></p>
<p><strong>Hacked → 1</strong></p>
<p><strong>Genuine → 0</strong></p>
<p><strong>Spam → 0</strong></p>
<p>What's uncertain or random is <strong>which hidden outcome is actually true</strong>.</p>
<p>Until we know that outcome, the value of D could be 0 or 1.</p>
<p>Once reality is revealed, D has one definite value.</p>
<h3>Why "Bernoulli"?</h3>
<p>D can take exactly two values: D ∈ {0,1}</p>
<p>Therefore, it is called a: <strong>Bernoulli random variable.</strong> The important point is <strong>Bernoulli doesn't add new behaviour.</strong></p>
<p>It is simply the standard name for a random variable with two possible values.</p>
<p>So: <strong>Random variable -&gt; D -&gt; 0 or 1 -&gt; Bernoulli random variable.</strong></p>
<h3>The same belief board can serve <strong>different teams</strong></h3>
<p>Our distribution remains:</p>
<p>Genuine 35%</p>
<p>Copied sender 35%</p>
<p>Hacked account 25%</p>
<p>Spam 5%</p>
<p>The underlying uncertainty has <strong>not changed</strong>.</p>
<p>But different teams from the same company have different questions.</p>
<p>The Finance team asks: <strong>Should we hold the payment?</strong></p>
<p>We use this mapping which we already discussed above:</p>
<p>Copied → 1</p>
<p>Hacked → 1</p>
<p>Genuine → 0</p>
<p>Spam → 0</p>
<p>Count = Hacked + Copied = 35 % + 25% = 60%</p>
<p>Similar procedures can be applied for the other three teams.</p>
<ol>
<li>IT Security team - <strong>Should we quarantine this email?</strong></li>
</ol>
<p>Mapping used:</p>
<p>Copied → 1</p>
<p>Hacked → 1</p>
<p>Genuine → 0</p>
<p>Spam → 1</p>
<p>Count = Hacked + Spam + Copied = 35 + 25 + 5 = 65%</p>
<p>2. Supplier Risk - <strong>Could the real supplier account be compromised?</strong></p>
<p>Mapping used:</p>
<p>Copied → 0</p>
<p>Hacked → 1</p>
<p>Genuine → 0</p>
<p>Spam → 0</p>
<p>Count = Hacked = 25%</p>
<p>3. Reply Assistant - <strong>Should we send a normal reply?</strong></p>
<p>Mapping used:</p>
<p>Copied → 0</p>
<p>Hacked → 0</p>
<p>Genuine → 1</p>
<p>Spam → 0</p>
<p>Count = Genuine = 35%</p>
<p><strong>One probability distribution can support many different decisions.</strong></p>
<p><strong>Same belief -&gt; Different Lenses</strong></p>
<h3>Why keep "copied sender" and "hacked account" separate?</h3>
<p>From the dangerous perspective, we could have combined all emails that are classified as either "Copied sender" or "hacked account".</p>
<p>Each category of the above set of emails on deeper investigation can produce different evidence and responses. For a copied sender, a simple domain check can expose it while for a hacked account the same domain check is not sufficient. To verify a hacker account, we might need additional complexities like:</p>
<ul>
<li><p>known-number phone verification</p>
</li>
<li><p>account containment</p>
</li>
<li><p>supplier notification</p>
</li>
</ul>
<p>Two outcomes can have the same broad decision label but require different evidence and different responses.</p>
<p>If we collapse them too early as Dangerous = 60%, we lose the map telling us what kind of danger we might be dealing with.</p>
<p>That map becomes valuable later when we decide what evidence to ask for.</p>
<p>Thus, for the discussion we have had so far for V1 we can summarise as follows:</p>
<p>Step 1: Model returns genuine 35 · copied 35 · hacked 25 · spam 5.</p>
<p>Step 2: Receipt saved: time 9:36 · evidence: email only · model v1.</p>
<p>Step 3: Finance rule: 35 + 25 = 60 → 60 &gt; 20 → hold the payment.</p>
<p>Step 4: IT rule: 35 + 25 + 5 = 65 → quarantine the copy for review.</p>
<p>Step 5: Supplier-risk rule: 25 → below its 40 threshold → no containment call yet.</p>
<p>One model call, one belief, three different decisions. This is what "one belief supports many actions" means — V0 would have needed three separate model calls and might have received three contradictory stories.</p>
<h3>Provenance</h3>
<p>Suppose the log merely says:</p>
<p>Genuine = 35%</p>
<p>That's not enough.</p>
<p>We should know:</p>
<p>Time: 9:36 am</p>
<p>Evidence: email only</p>
<p>Model: version 1</p>
<p>Belief: 35/35/25/5</p>
<p>Why?</p>
<p>Because if the auditor later asks: "Why did the system believe genuine was 35%?", we can reconstruct what it knew at that moment.</p>
<p>This traceable origin is called <strong>Provenance</strong>.</p>
<h3><strong>Calibration</strong></h3>
<p>Suppose the agent repeatedly says: "Genuine = 35%"</p>
<p>What does that number promise?</p>
<p>Across many comparable predictions, roughly:</p>
<p>35 out of 100 should actually turn out genuine.</p>
<p>If instead the agent says 35% a hundred times and 80 turn out genuine, its probabilities aren't trustworthy.</p>
<p>That's called: Calibration</p>
<p>A calibrated 35% prediction should correspond to roughly 35% actual frequency over many comparable cases.</p>
<p><strong>V1 - new Agent</strong></p>
<pre><code class="language-python">stories ← [genuine, copied-sender, hacked-account, spam]

belief  ← ask_model("Split 100 points of support across
                     these four stories.", email)

save (belief, time, evidence_list)# the provenance receipt

# each team compresses the SAME belief with a different rule
danger_finance  ← belief[copied-sender] + belief[hacked-account]
danger_IT       ← belief[copied-sender] + belief[hacked-account]
                  + belief[spam]
risk_supplier   ← belief[hacked-account]

if danger_finance &gt; 20:  hold(email)        # policy, not belief
else:                    deliver(email)
</code></pre>
<p>To design V1 we used the following algorithm:</p>
<p>Step 1: Name the hidden outcome. What complete truth will exist even though the agent cannot see it yet?</p>
<p>Step 2: List plausible worlds. What mutually exclusive stories must the agent keep alive?</p>
<p>Step 3: Build a belief distribution. Given current evidence, how much support belongs to each story?</p>
<p>Step 4: Name the stakeholder's question. Which stories count as "yes" for this decision? That is the event.</p>
<p>Step 5: Map every story to a useful value. This fixed mapping is the random variable.</p>
<p>Step 6: Connect the value to an action policy. Act, ask for evidence, abstain, or escalate.</p>
<p>Step 7: Reveal outcomes later and evaluate. Test both the belief quality and the action consequences.</p>
<h3><strong>Chapter 3</strong></h3>
<p>The one problem that still exists in the V1 agent from the earlier chapter can be explained as follows:</p>
<p>We saw that for the new email #101 the V1 agent maintained several possible explanations for the email below:</p>
<ul>
<li><p>Genuine supplier update</p>
</li>
<li><p>Copied sender</p>
</li>
<li><p>Ordinary Spam</p>
</li>
<li><p>Hacked supplier account</p>
</li>
</ul>
<p>It attaches its current belief to those possibilities.</p>
<p>So instead of having a binary solution : Safe or dangerous, it can now say -"Several explanations are possible, and here is how much current evidence supports each".</p>
<p>But there is one huge problem. We still have not figured out what to do when new evidence arrives.</p>
<p>Suppose the finance team calls the supplier.</p>
<p>The supplier says: <strong>"We did not change our bank account."</strong></p>
<p>That is obviously a "<strong>strong clue</strong>". But <strong>how much should our belief change?</strong></p>
<p>Should we go from 25% suspicious to 77% suspicious or 40% or 99%?<br />There is no calculated formula to answer that. The agent can write down its belief, but it does not yet know a disciplined way to change that belief when a new clue arrives.</p>
<p>"Strong clue” above does not prove anything conclusive. A genuine email can sometimes produce the same answer: the company may have called an old contact, the change request may have been sent before a paperwork update, or the supplier employee may not know about a legitimate change yet. The phone answer is evidence; it is not the hidden outcome itself.</p>
<p>How should the agent gauge the payment danger after the above phone call ?</p>
<p>The answer is simple: <strong>The phone call matters, but the agent V1 needs to know what happens in comparable emails.</strong></p>
<p>The outcome inside message 101 has not changed because of a phone call. One complete possibility from the four possibilities above was already true. What changed is the agent's information, so its belief should change.</p>
<p>We need to answer this question: <strong>How often does this particular clue occur when each possible explanation is true?</strong></p>
<p>We need history to answer that and choose the right pile of emails to do so.</p>
<p>Remember the first evaluation set. There were 100 emails - 8 dangerous and 92 safe.</p>
<p>So: 8/100=8%.</p>
<p>That was useful for evaluating V0. But in the earlier chapter we made a very important argument:</p>
<p><strong>That 8% is not automatically the starting probability for Message 101.</strong></p>
<p>This is because we're now asking a different question.</p>
<p>We are no longer asking: "How many ordinary company emails are dangerous?"</p>
<p>We are asking: <strong>"Among supplier bank-change requests resembling this one, how often was there a payment-redirection attack?"</strong></p>
<p>Those are different populations.</p>
<p>Imagine three piles of historical emails.</p>
<p><strong>Pile 1 — General evaluation set</strong></p>
<p>There are 100 general emails and 8 attacks.</p>
<p>Rate is 8%</p>
<p>It is useful for evaluating V0.</p>
<p><strong>Pile 2 — Comparable requests during a quiet period</strong></p>
<p>We have 1,000 similar supplier bank-change requests and 10 attacks.</p>
<p>Rate is 10/1000 = 1%</p>
<p>This is a much better starting point for Message 101 <strong>during a quiet period</strong>.</p>
<p><strong>Pile 3 — Comparable requests during an attack campaign</strong></p>
<p>We have 1,000 similar requests and 200 attacks.</p>
<p>The rate is 200/1000 = 20%</p>
<p>This becomes relevant if security has already confirmed that there is an active attack campaign.</p>
<p>All three piles of email data is from a relevant historical period.</p>
<h3>Base rate</h3>
<p>From the above three populations, our starting point depends on which pile of emails we select.</p>
<p>For Message 101 during a quiet week:</p>
<p>1,000 comparable requests -&gt; 10 attacks -&gt; 1% starting belief</p>
<p>During a confirmed attack campaign:</p>
<p>1,000 comparable requests -&gt; 200 attacks -&gt; 20% starting belief</p>
<p>Thus for the same type of email with potentially same clue, we have a different environment.</p>
<p>Therefore we have a different starting belief.</p>
<p>This starting frequency is the base rate.</p>
<p>Suppose: P(attack)=1%</p>
<p>That does <strong>not</strong> mean: "This email has a 1% attack probability forever."</p>
<p>It means: "Before considering the new evidence, comparable historical cases had an attack rate of 1%."</p>
<p>The current email has its own hidden outcome. The historical count simply gives us a <strong>starting point</strong>.</p>
<h3><strong>Build the update physically</strong></h3>
<p>Imagine we have <strong>1,000 cards on a table.</strong></p>
<p>Each card represents one comparable supplier bank-change request from the recent quiet period.</p>
<p>Human beings later checked what actually happened.</p>
<p>We know: 10 cards → real payment-redirection attacks</p>
<p><strong>990 cards → not attacks</strong></p>
<p>So before hearing the phone result:</p>
<p><strong>ATTACK       10</strong></p>
<p><strong>NOT ATTACK  990</strong></p>
<p><strong>TOTAL      1000</strong></p>
<p>That's our starting picture.</p>
<p>Put a red sticker on every historical card where the trusted supplier contact said: "We did not authorise this bank change."</p>
<p>Now we discover something interesting.</p>
<p>Among the <strong>10 attack cards</strong>: <strong>9 received the red sticker while 1 did not.</strong></p>
<p>So: 9/10=90% of attacks produced this clue. But now look at the other 990 cards.</p>
<p>Among the <strong>990 non-attacks</strong>:</p>
<p><strong>20 also received the red sticker while 970 did not.</strong></p>
<p>This is critical. The clue can happen in <strong>both worlds</strong>.</p>
<p>Now Message 101 gets the red sticker</p>
<p>Message 101 has exactly the clue: "Supplier says: We did not change the bank account."</p>
<p>So which historical cards are relevant now?</p>
<p>Not all 1,000. We filter them by the clue.</p>
<p><strong>1,000 cards -&gt; cards where supplier said "no change" -&gt; 29 cards</strong></p>
<p>Those 29 consist of: <strong>9 attacks and 20 non-attacks.</strong></p>
<p>Now we ask:</p>
<p><strong>"Among cases where this clue happened, how many were attacks?"</strong></p>
<p>Answer: 9/29 = 31%</p>
<p>Thus the counted answer for the whole attack question in a quiet period is 31% or 31 in about 100 attack cases.</p>
<p>Thus we can now answer the Finance department was asking earlier - "<strong>Given that we observed this clue (supplier denying that account change was made), how often was there actually an attack?</strong>"</p>
<p>Thus from the 1000 cases, we filtered out just the cases where there was evidence of the supplier's denial of making the bank account change. Thus from the large pool of 1000 cases, we created a smaller bucket of cases where the supplier denied making account change. After that we inspect that smaller bucket.</p>
<p>How many of those were actually attacks? How many were not?</p>
<p><strong>That ratio is our updated belief.</strong></p>
<p>Let us dissect this thought process in simpler language.</p>
<p>We have two questions here:</p>
<ol>
<li><p>Among the attack cases, how often did we see this particular evidence?</p>
</li>
<li><p>Among the non-attack cases, how often did we see the same evidence?</p>
</li>
</ol>
<p>An evidence is only useful if it distinguishes an attack from a non-attack.</p>
<p>Suppose we observe: Supplier says: "I did not change the bank account." Now imagine we look at historical cases.</p>
<p><strong>Case A — The clue happens only in attacks</strong></p>
<p>Suppose: 100 attacks → 90 had this clue</p>
<p>1000 non-attacks → 0 had this clue</p>
<p>Then the clue is very powerful. If we see the clue, it's strongly pointing towards an attack.</p>
<p><strong>Evidence strongly separates the two possibilities.</strong></p>
<p>The <strong>base rate</strong> is the situation before looking at the clue:</p>
<p>So, attacks are:</p>
<p>P(attack) = 100/ (100+1000) = 9.1%</p>
<p>After seeing the clue, we have the base rate P(attack|clue) = 90 / (90 + 0) = 100%</p>
<p>It means attack is certain and no serious base rate trap.</p>
<p><strong>Case B — The clue happens equally often in both</strong></p>
<p>Suppose: 100 attacks → 90 had this clue</p>
<p>1000 non-attacks → 900 had this clue</p>
<p>Base rate before seeing the clue P(attack) = 100 / (100 + 1000) = 9.1 %</p>
<p>After seeing the clue P(attack|clue) = 90 / (90 + 900) = 9.1%</p>
<p>No change in base rate. The clue occurs at the same rate in both groups.</p>
<p>Now the clue is not very useful. Because legitimate cases produce the same clue almost as often. Seeing the clue doesn't help us distinguish:</p>
<p>ATTACK vs NOT ATTACK</p>
<p>We conclude: <strong>The posterior remains the base rate because the evidence doesn't distinguish the two groups.</strong></p>
<p><strong>Case C — The clue is actually more common in non-attacks</strong></p>
<p>Suppose: 100 attacks → 20 had this clue</p>
<p>1000 non-attacks → 500 had this clue</p>
<p>The base-rate before the clue = 100 / (100 + 1000) = 9.1%</p>
<p>After the clue, the base rate = P (attack | clue) =20/ (20+500) = 3.85%</p>
<p>The clue actually <strong>lowered</strong> our belief in an attack.</p>
<p>Thus, seeing the clue might actually make the non-attack explanation more plausible.</p>
<p>So, the important question isn't: "Does this evidence occur in attacks?"</p>
<p>Of course it might.</p>
<p>The important question is: "Does this evidence occur substantially more often in attacks than it occurs in the alternatives?" That's why we need to look at non-attacks too.</p>
<h3>The Base-Rate Trap</h3>
<p>The trap is easiest to understand if you compare what your brain might do versus what the data says.</p>
<p>In Case C, you might say:</p>
<p>"20% of attacks have this clue, so this clue is associated with attacks."</p>
<p>But that's not enough.</p>
<p>You must ask: "How often does it happen when there is no attack?"</p>
<p>Answer: 50%.</p>
<p>So, the clue actually points more toward non-attack than attack.</p>
<p>We can summarise our analysis in a tabular format.</p>
<table>
<thead>
<tr>
<th></th>
<th>Attack</th>
<th>Non-attack</th>
<th>What happens to belief?</th>
</tr>
</thead>
<tbody><tr>
<td><strong>A</strong></td>
<td>90% have clue</td>
<td>0% have clue</td>
<td>Belief shoots up</td>
</tr>
<tr>
<td><strong>B</strong></td>
<td>90%</td>
<td>90%</td>
<td>Belief stays at base rate</td>
</tr>
<tr>
<td><strong>C</strong></td>
<td>20%</td>
<td>50%</td>
<td>Belief goes down</td>
</tr>
</tbody></table>
<p><strong>The base rate is the starting point in all three cases</strong>. The evidence then <strong>moves us away from, toward, or leaves us at that starting point</strong>.</p>
<p><strong>Remember these concepts</strong></p>
<ol>
<li><p>Base rate = where you start.</p>
</li>
<li><p>Evidence = what moves you from that starting point.</p>
</li>
<li><p>Base-rate trap = forgetting where you started and letting a seemingly impressive clue dominate your thinking without comparing it against the alternatives.</p>
</li>
</ol>
<h3><strong>Technical Terms</strong></h3>
<p>We start with a base rate, observe some evidence, and then ask how that evidence should change our belief. Cases A, B and C showed us that the answer depends on how the evidence behaves in the two worlds.</p>
<p>Let's put mathematical names on the things we already understand.</p>
<p>Suppose:</p>
<p>A = an attack</p>
<p>D = the clue/evidence we observed</p>
<p>Before seeing the clue, we have: P(A)</p>
<p>That's our <strong>prior</strong> — the base rate.</p>
<p>After seeing the clue, what we actually want is: P (A | D)</p>
<p>Read that as: Probability of an attack, given that we observed the clue.</p>
<p>That is our <strong>posterior</strong>.</p>
<p>Now look at what we were doing in Cases A, B and C.</p>
<p>We were asking: "If there really is an attack, how often do we see this clue?"</p>
<p>Mathematically: P (D | A)</p>
<p>That's the likelihood.</p>
<p>But we also need:</p>
<p>P (D | ~A) which means: "If there is no attack, how often do we see this clue?"</p>
<p>Let us look at Cases A, B and C from a math lens again.</p>
<p><strong>Case A in mathematical language</strong></p>
<p>Starting with the base rate, P(A) = 9.1%</p>
<p>P(D|A) = 90%</p>
<p>P (D | ~A) = 0 %</p>
<p>The clue is therefore extremely strong evidence for an attack.We started with the base rate and after seeing the clue, our belief moves dramatically upward.</p>
<p>The important thing is that <strong>the evidence distinguishes the two worlds</strong>.</p>
<p><strong>Case B in mathematical language</strong></p>
<p>P(D|A) = 90%</p>
<p>P(D|~A) = 90%</p>
<p>P(A) = 9.1%</p>
<p>The clue doesn't distinguish anything.</p>
<p>Therefore, seeing it shouldn't move our belief.</p>
<p><strong>If the evidence occurs equally often in both worlds, it provides no information for choosing between those worlds.</strong></p>
<p><strong>Case C in mathematical language</strong></p>
<p>P(D|A) = 20%</p>
<p>P(D|~A) = 50%</p>
<p>P(A) = 9.1%</p>
<p>Here the clue actually points <strong>away from attack</strong>.</p>
<p><strong>Three Observations from the three cases:</strong></p>
<ol>
<li><p>Evidence more common in ATTACK -&gt; belief in attack increases</p>
</li>
<li><p>Evidence equally common -&gt; belief doesn't change</p>
</li>
<li><p>Evidence more common in NON-ATTACK -&gt; belief in attack decreases</p>
</li>
</ol>
<p>The three aforementioned rules give us the idea for Bayesian updating.</p>
<h3><strong>Bayes' Rule</strong></h3>
<p>We can now write the mathematical relationship:</p>
<p>P(A|D) = P(D|A) P(A) / P(D)</p>
<p>Let's understand the logic here.</p>
<p>P(A) = Our starting belief.</p>
<p>That's the base rate.</p>
<p>P(D|A) = How compatible is the evidence with an attack?</p>
<p>P(D) = How commonly could we have observed this evidence overall?</p>
<p>And this last part is where the competing explanation enters.</p>
<p>The clue could have happened because: ATTACK OR NON-ATTACK</p>
<p>So, P(D) = P(D|A) P(A) + P(D|<del>A) P(</del>A)</p>
<p>The above statement tells us: Count every plausible way the evidence could have appeared.</p>
<p>That is exactly what we did earlier.<br /><strong>Case A</strong></p>
<p>We begin with P(A) = 9.1%</p>
<p>P(D|A) = 90% of attacks</p>
<p>P(D|A) = 0.9</p>
<p>but P(D|~A) = 0% of non-attacks</p>
<p>P(D) = P(D|A). P(A) + P(D|<del>A). P(</del>A)</p>
<p>P(D) = 0.9*0.091 + 0*0.909</p>
<p>P(D) = 0.9*0.091</p>
<p>P (A | D) = 0.9*0.091 / (0.9*0.091) = 1</p>
<p>If <strong>non-attacks can never produce the clue</strong>, then seeing the clue identifies an attack.</p>
<p>P(D∣A)&gt;P(D∣~A)</p>
<p>Evidence favours attack. Belief goes up.</p>
<p><strong>Case B</strong></p>
<p>We have P(A) = 9.1%</p>
<p>P(~A) = 90.9%</p>
<p>P(D|A) = 90%</p>
<p>P(D|~A) = 90%</p>
<p>P(D) = 0.9*0.091 + 0.9*0.909</p>
<p>P(D) = 0.9*(0.091 + 0.909) = 0.9</p>
<p>P(A|D) = 0.9 * 0.091 /0.9 = 0.091</p>
<p><strong>Exactly where we started with P(A).</strong></p>
<p>That's Case B mathematically proving what we already understood intuitively.</p>
<p>P(D|A) =P(D|~A)</p>
<p>Evidence doesn't distinguish.</p>
<p>The belief stays the same.</p>
<p><strong>Case C</strong></p>
<p>We start with P(A) = 9.1%</p>
<p>P(~A) = 90.9%</p>
<p>P(D|A) = 20%</p>
<p>P(D|~A) = 50%</p>
<p>P(D) = P(D|A). P(A) + P(D|<del>A). P(</del>A)</p>
<p>P(D) = 0.2*0.091 + 0.5*0.909</p>
<p>P(A|D) = 0.091 * 0.2</p>
<p>P(A|D) = P(D|A) P(A) / P(D) = 0.2*0.091 / (0.2*0.091 + 0.5*0.909) = 3.85%</p>
<p>So, the clue has actually <strong>reduced</strong> our belief from 9.1% to 3.85%.</p>
<p>P(D∣A) &lt;P(D∣¬A)</p>
<p>Evidence favours non-attack.</p>
<p>The belief goes down.</p>
<p>The evidence didn't merely "add suspicion." Evidence can increase, leave unchanged, or decrease belief.</p>
<h3>Why V2 is better?</h3>
<p>V2 tells us that don't just change the belief. Calculate the change from recorded evidence.</p>
<p>For our supplier email:</p>
<p>Relevant historical cases -&gt; starting belief -&gt; new clue arrives -&gt; How often does clue occur under each possible story? -&gt; calculate support -&gt; normalize -&gt; revised belief</p>
<p>The whole calculation is recorded.</p>
<p>So, if V2 says: Attack belief = 31%</p>
<p>It can be verified as follows:</p>
<pre><code class="language-plaintext">Quiet 90-day period 
1,000 comparable requests

10 attacks 
990 non-attacks

Supplier denial: 
9/10 attacks 
20/990 non-attacks

Support: 
attack = 9
nonattack ≈ 20

Posterior: 9 / 29 = 31%
</code></pre>
<p>Same clue, different starting situation.</p>
<p>Quiet period:</p>
<p>1%→31%</p>
<p>Active campaign:</p>
<p>20%→92%</p>
<p>The code didn't change. The clue didn't change.</p>
<p>The starting historical pile changed. V2 records that pile instead of silently choosing a number.</p>
<p>If someone later challenges the starting assumption: "Why did you use this 90-day population?" then we can change the pile because a prior can be stale, too broad, biased, or based on too few examples.</p>
<p>V2 calculates: "How much do we currently believe the attack story?"</p>
<p>It does not decide: "Therefore HOLD the payment."</p>
<p>A 31% belief does not automatically mean HOLD. The action depends on the consequences of being wrong and the cost of delaying the payment.</p>
<h3><strong>Chapter 4</strong></h3>
<p>In the previous chapter we learnt that when new evidence arrives, update your belief rather than guessing.</p>
<p>But now we encounter a different problem. V2 is dealing with uncertain quantities, and not all uncertainty looks the same.</p>
<p>Consider the questions the inbox system wants to answer:</p>
<p>How many attacks might arrive?</p>
<p>How many attacks might arrive during an hour?</p>
<p>How long until the next attack?</p>
<p>How long does an ordinary invoice email take to process?</p>
<p>These are all questions about uncertainty but notice that they are asking about different kinds of things. That distinction is what this chapter is about.</p>
<p>In the first chapter, the agent V0 asked a simple question - "Is this email safe or dangerous?". The answer was binary but the above question are not binary.</p>
<h3><strong>Distribution</strong></h3>
<p>A description of how uncertainty is spread across possible values is a distribution.</p>
<p>Suppose the system doesn't know exactly how many attacks will arrive.</p>
<p>It might believe:</p>
<p>0 attacks     → possible</p>
<p>1 attack      → possible</p>
<p>2 attacks     → possible</p>
<p>3 attacks     → possible</p>
<p>...</p>
<p>But those possibilities don't necessarily have equal probability. A probability distribution tells us: Which values are more plausible and which are less plausible?</p>
<p>So instead of saying: "We don't know.", the system can say: "We don't know exactly, but here is how the uncertainty is distributed."</p>
<p>That's the fundamental idea of distribution.</p>
<h3><strong>Different types of Distribution</strong></h3>
<p>Let us get back to the questions that we are trying to answer.</p>
<p>How many attacks occur?</p>
<p>The answer must be something like:</p>
<p>0</p>
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>...</p>
<p>You cannot have: 2.73 attacks</p>
<p>So this is a count.</p>
<p>But suppose the question is:</p>
<p>How long until the next attack?</p>
<p>Now the answer could be:</p>
<p>0.5 minutes</p>
<p>1.7 minutes</p>
<p>12.4 minutes</p>
<p>37.8 minutes</p>
<p>...</p>
<p>That's a continuous amount of time. Already, the uncertainty has a different shape.</p>
<p>And then there is another distinction.</p>
<p>Suppose we ask:</p>
<p>How many attacks occur during one hour?</p>
<p>That is a count inside a fixed interval whereas</p>
<p>How long until the next attack?</p>
<p>That is measuring the waiting time between events.</p>
<p>These may be related, but they are not the same random quantity.</p>
<p>That is why we need a collection of distributions rather than using probability.</p>
<p><strong>To be more precise we need a mathematical model that matches the question being asked.</strong></p>
<p>In the earlier chapter V2 just did not say, "Attack probability is 31%" but it also helped us to calculate it and audit it.</p>
<p>In this chapter instead of representing uncertainty about <strong>one classification belief</strong>, we now want to represent uncertainty about <strong>quantities and events over time</strong>.</p>
<p>So the system may need to reason about: P(X=x)</p>
<p>where X is a random quantity.</p>
<p>The question becomes:</p>
<p><strong>What kind of random quantity is X?</strong></p>
<p>If X is a count, we need one kind of model.</p>
<p>If X is a waiting time, we need another.</p>
<p>If X is a measurement such as processing duration, we may need another.</p>
<p>There are several different probability distributions, each suited to a different kind of uncertainty.</p>
<h3>Mathematical Shape</h3>
<p><strong>First question: "Does this email need a hold?"</strong></p>
<p>This is the simplest uncertainty.</p>
<p>For <strong>one email</strong>, there are only two possible outcomes:</p>
<p><strong>0 → No hold</strong></p>
<p><strong>1 → Hold</strong></p>
<p>There is no third possibility.So the uncertainty has the shape: X∈{0,1}</p>
<p>This is called the <strong>Bernoulli distribution</strong>.</p>
<p>In this case: <strong>One trial → one yes/no outcome.</strong></p>
<p>For the inbox agent, this gives the finance team something actionable.</p>
<p>If the current belief that an email needs a hold is: P(hold)=25% and the finance rule is: P(hold) &gt; 20% -&gt; hold</p>
<p>then the agent can actually make the decision.</p>
<p>Without this shape, the agent can only say: "This email looks risky."</p>
<p>There is no precise boundary between <strong>risky</strong> and <strong>hold</strong>.</p>
<p><strong>Now change the question slightly.</strong></p>
<p>Instead of asking: <strong>"Does this one email need a hold?"</strong> ask: <strong>"How many of the next 20 emails will need a review?"</strong></p>
<p>Now the answer isn't just 0 or 1.</p>
<p>It can be: 0,1,2,3,4...20</p>
<p>That's a different uncertainty.</p>
<p>Here we are no longer describing <strong>one yes/no event</strong>. We're counting <strong>how many successes occur across 20 opportunities</strong>.</p>
<p>That's the <strong>Binomial</strong> shape.</p>
<p>Thus the distribution is determined by <strong>what question we're asking</strong>, not by which distribution name we happen to remember.</p>
<p><strong>Poisson</strong></p>
<p>The next question we have is "How many attacks arrive in one hour?"</p>
<p>We have now changed the question again. We are no longer asking: "Out of these 20 requests, how many will need review?"</p>
<p>Instead - "How many attacks will arrive during this one busy hour?"</p>
<p>That answer could be: 0, 1, 2, 3, 4, 5, 6, 7, ...</p>
<p>There isn't a fixed number of requests we're choosing from.</p>
<p>We're watching a stream of attacks arriving over a time interval.</p>
<p>That is the situation for the <strong>Poisson distribution</strong>.</p>
<p><strong>Exponential</strong></p>
<p>The next question asked was - "How long until the next attack?"</p>
<p>Now the uncertain quantity is time.</p>
<p>It could be:</p>
<p>2 minutes</p>
<p>8 minutes</p>
<p>17 minutes</p>
<p>31 minutes</p>
<p>...</p>
<p>This is the Exponential distribution.</p>
<p><strong>Gaussian</strong></p>
<p>The next question was - "How long does an ordinary invoice review take?"</p>
<p>Here we're measuring a quantity such as review duration. We represent ordinary review times as <strong>clustered around a typical value</strong>. We do not want to count incidents; we want to estimate a measurement that can vary smoothly: 4.3 minutes, 5.2 minutes, 6.6 minutes.</p>
<p>For a narrow, well-defined kind of routine review, imagine dotting last week's times on a number line. Most dots may sit near 6 minutes. Fewer sit near 3 or 9. A symmetric hill is a useful first picture for measurements clustered around a centre. That hill is called a <strong>Gaussian</strong>, or <strong>Normal, distribution</strong>.</p>
<p>Most observations are around the centre; increasingly unusual values occur farther away. That's the <strong>Gaussian</strong> shape.</p>
<p>The centre is called the <strong>expectation</strong>, often also called the expected value or mean. In simple language, it is the long-run average the agent expects if it sees many comparable cases. The spread is called <strong>variance</strong>. It tells us how widely values tend to wander from the centre. It is not a score for good or bad; it is a warning about how predictable capacity is.</p>
<p>This gives the agent a way to recognise something unusually far from the normal cluster.</p>
<p><strong>Uniform</strong></p>
<p>The next question is "Which email gets audited, fairly?"</p>
<p>In this case, we are <strong>not trying to model how dangerous an email is</strong>.</p>
<p>We only want: **Every eligible delivered email should have an equal chance of being randomly selected for audit.<br />**So if the audit rate is <strong>1 in 100</strong>, every eligible email gets the same chance.</p>
<p>This is the <strong>Uniform</strong> distribution.</p>
<p><strong>Every eligible email → equal probability.</strong></p>
<p>Why does this matter?</p>
<p>Without it, the audit might repeatedly examine emails that <strong>already look interesting</strong>. An attacker whose email doesn't look interesting could therefore escape auditing indefinitely. Uniform randomness prevents that bias.</p>
<p>Each question which we discussed in this chapter gives the agent a <strong>different operational capability</strong>:</p>
<p><strong>Bernoulli → one email: hold or don't hold (hold decision)</strong></p>
<p><strong>Binomial → how many of 20 need review? (staffing)</strong></p>
<p><strong>Poisson → how many attacks arrive in an hour? (alert threshold)</strong></p>
<p><strong>Exponential → how long until the next one? (queue)</strong></p>
<p><strong>Gaussian → how long is a typical review? (anomaly flag)</strong></p>
<p><strong>Uniform → which email gets a fair random audit?</strong></p>
<h3>Expectation and variance — average versus spread</h3>
<p>Expectation asks:</p>
<p>Where is the middle of the workload likely to be?</p>
<p>Variance asks:</p>
<p>How much can the actual workload move around that middle?</p>
<p>Go back to the 20-email example discussed above.</p>
<p>Suppose each email has a 20% chance of needing a hold.</p>
<p>Then the expected number of holds is 20×0.20=4</p>
<p>So, E[X]=4</p>
<p>The important interpretation is: 4 is the planning centre.</p>
<p>It does not mean: "Tomorrow there will be exactly four holds."</p>
<p>The actual tray might contain 2 holds or 6 holds.</p>
<p>The amount by which the real result moves around that centre is what variance captures.</p>
<p>So, Expectation -&gt; Where should we plan?</p>
<p>Variance -&gt; How much uncertainty should we prepare for?</p>
<p>And that distinction matters operationally.</p>
<p>Expectation helps with ordinary staffing and expected cost.</p>
<p>Variance helps with buffers, alerts, escalation and recognizing when the average is hiding danger.</p>
<p><strong>One very important boundary</strong></p>
<p>Expected = 4 does NOT mean predicted = 4.</p>
<p>It means:</p>
<p>If comparable situations happened many times, 4 is the centre around which the workload tends to sit.</p>
<p>A safe agent therefore doesn't just record the average. It also records the spread, checks its assumptions, and keeps an escalation plan for unusual but important situations.</p>
<h3>How does all this actually make the agent better?</h3>
<p>Give it one email, give it new evidence, and it could update its belief.</p>
<pre><code class="language-plaintext">Email
   ↓
prior belief
   +
new evidence
   ↓
Bayesian update
   ↓
posterior belief
</code></pre>
<p>But then some team comes up with a new requirement: "Can one reviewer handle tomorrow morning alone?"</p>
<p>This question wants the answer for tomorrow's workload count. Agent V2 has no answer for the same because it lacks the specific mathematical representation for the same.</p>
<h3>V3 introduces a registry of uncertain questions</h3>
<p>Think of the registry as a collection of properly labelled drawers.</p>
<p>Instead of treating every uncertain question as: probability = some percentage</p>
<p>V3 first asks:</p>
<p>What exactly are we uncertain about? Then it records the appropriate shape.</p>
<p>So the registry might contain:</p>
<p>Question: Does this email need a hold?</p>
<p>Possible values: yes / no</p>
<p>Shape: Bernoulli</p>
<p>Another drawer:</p>
<p>Question: How many attacks arrive in one busy hour?</p>
<p>Possible values: 0, 1, 2, 3, ...</p>
<p>Shape: Poisson</p>
<p>Another drawer:</p>
<p>Question: How long until the next one?</p>
<p>Possible values: positive amount of time</p>
<p>Shape: Exponential</p>
<p>and so on.</p>
<p>V3 doesn't record only the distribution name.</p>
<p>It records question, units, possible values, chosen shape, why that shape was chosen, and the data source.</p>
<p>That's the typed uncertainty registry.</p>
<p><strong>Why are we recording the units and possible values?</strong></p>
<p>Because it catches silly mistakes before they become system decisions.</p>
<p>Suppose someone asks: "How many attacks tomorrow?"</p>
<p>That's a count.</p>
<p>Possible answers are: 0,1,2,3,…</p>
<p>So something like: −3 attacks makes no sense.</p>
<p>Likewise: "How long until the next attack?" is a waiting time.</p>
<p>So, −10 minutes makes no sense.</p>
<p>The question's own type and units help reject an inappropriate probability shape.</p>
<p>The registry also exposes assumptions. Suppose V3 records: Poisson, with a stable hourly attack rate. It's an assumption about reality.</p>
<p>We're effectively saying:</p>
<p>"We believe this arrival process behaves sufficiently like a stable-rate arrival process for this model to be useful."</p>
<p>Now imagine attacks start arriving in coordinated bursts.</p>
<p>Someone can inspect the registry and say:</p>
<p>"The stable-rate assumption isn't holding anymore."</p>
<p>Then the model can be challenged and replaced.</p>
<p>That's much better than burying the assumption somewhere inside the code. This makes V3 auditable.</p>
<p>V2 gave us an <strong>evidence receipt</strong>. But in V3 the system can record:</p>
<pre><code class="language-plaintext">What was predicted?
What were the units?
Which shape was used?
Why was it chosen?
What data supported it?
What assumptions were made?
What actually happened later?
</code></pre>
<h3>Chapter 5</h3>
<p>V3 now knows how to represent different uncertainties correctly.</p>
<p>Coming back to our Email #101 example, the suspicious looking email is still unresolved.</p>
<p><strong>There are checks like sender history, link scan, attachment sandbox, domain age, and known-number call which are not pointing to any firm conclusion.</strong></p>
<p>The problem is: <strong>Which check should it spend first?</strong></p>
<p>V3 cannot answer that yet. Suppose the current belief board has several competing stories:</p>
<p>Genuine</p>
<p>Copied sender</p>
<p>Hacked mailbox</p>
<p>Spam</p>
<p>The agent could simply perform every available check. But that's wasteful.</p>
<p>Some checks might tell us a lot. Some might tell us very little.</p>
<p>So instead of asking: <strong>“Which check sounds useful?”</strong></p>
<p>Chapter 5 wants the agent to ask:</p>
<p><strong>"Before I actually perform this check, how much do I expect its possible answers to reduce my uncertainty?"</strong></p>
<p>In Chapter 3, the agent waited for evidence and then updated:</p>
<p>Evidence arrives -&gt; Bayesian update -&gt; new belief</p>
<p>Chapter 5 wants the agent to reason <strong>before obtaining the evidence</strong>:</p>
<p>current belief -&gt; possible check -&gt; imagine each answer it could return -&gt;</p>
<p>-&gt; for each answer: "what would my belief become?" -&gt; how much uncertainty would this check remove on average? -&gt; compare with other checks -&gt; choose the most useful one</p>
<p>It <strong>reuses the Bayesian update engine from Chapter 3</strong>. The agent essentially asks: "If I ran the link scan and it returned answer A, what would my belief become?"</p>
<p>Then: "What if it returned answer B?"</p>
<p>Then it does the same for sender history, domain age, the known-number call, and so forth.</p>
<p>Only after mentally simulating the possible outcomes does it decide which check is worth performing.</p>
<p>We want: <strong>The check whose answers are expected to separate the competing invoice stories the most.</strong></p>
<p>The agent's current belief is:</p>
<table>
<thead>
<tr>
<th>Possible story</th>
<th>Current belief</th>
</tr>
</thead>
<tbody><tr>
<td>Copied fake sender</td>
<td>45%</td>
</tr>
<tr>
<td>Hacked real supplier mailbox</td>
<td>30%</td>
</tr>
<tr>
<td>Genuine bank-change request</td>
<td>20%</td>
</tr>
<tr>
<td>Spam</td>
<td>5%</td>
</tr>
</tbody></table>
<p>But Finance team cannot sit there forever looking at: 45%, 30%, 20%, 5%.</p>
<p>The agent needs <strong>more evidence</strong>.</p>
<p>And it has several permitted ways of getting it:</p>
<ul>
<li><p>inspect sender history</p>
</li>
<li><p>safely inspect the link</p>
</li>
<li><p>check domain age</p>
</li>
<li><p>sandbox the attachment</p>
</li>
<li><p>call the supplier using the trusted phone number already stored in the vendor record.</p>
</li>
</ul>
<p>Which one should the agent do first? This chapter is trying to solve this problem.</p>
<p><strong>Why not just perform every check?</strong></p>
<p>Because checks aren't free. They consume time and resources.</p>
<p>Some may require a human. Some may not even be relevant to this particular email. So, **"Run everything" isn't an intelligent evidence strategy.**But neither is <strong>"Run the link scan because that sounds useful."</strong></p>
<p>The agent needs a principled way of choosing.</p>
<p><strong>Think about what a useful check should accomplish</strong></p>
<p>The agent currently has four competing explanations. A useful check should help it <strong>separate those explanations</strong>. Consider the link scan.</p>
<p>Suppose it returns: <strong>LOOK-ALIKE DOMAIN</strong></p>
<p>That strongly supports the copied-fake-sender explanation. Because historical verified cases tell us that look-alike domains occur very frequently in copied-sender attacks and rarely in the other explanations.</p>
<p>P(copied)=45%</p>
<p>P(hacked)=30%</p>
<p>P(genuine)=20%</p>
<p>P(spam)=5%</p>
<p>Now the scanner actually returns: <strong>LOOK-ALIKE DOMAIN</strong></p>
<p>From the historical ledger, we have:</p>
<p>P(look-alike | copied)=89%</p>
<p>P(look-alike | hacked)=3%</p>
<p>P(look-alike | genuine)=5%</p>
<p>P(look-alike | spam)=0%</p>
<p><strong>Calculate support for each story</strong></p>
<p>For <strong>copied sender</strong>: 0.45×0.89=0.4005</p>
<p>For <strong>hacked mailbox</strong>: 0.30×0.03=0.009</p>
<p>For <strong>genuine</strong>: 0.20×0.05=0.010</p>
<p>For <strong>spam</strong>: 0.05×0=0</p>
<p>So our unnormalised support is:</p>
<p>Copied       0.4005</p>
<p>Hacked      0.009</p>
<p>Genuine     0.010</p>
<p>Spam         0</p>
<p>----------------</p>
<p>Total          0.4195</p>
<p>Now normalize.</p>
<p>For copied sender: P(copied | look-alike)=0.4005 / 0.4195≈0.955</p>
<p>Therefore: P(copied | look-alike)≈95.5%</p>
<p>Thus, After that result, the belief becomes approximately: 95% copied sender</p>
<p>Suddenly:</p>
<pre><code class="language-plaintext">BEFORE

Copied     45%
Hacked     30%
Genuine    20%
Spam        5%

          ↓ link scan
          ↓ LOOK-ALIKE

AFTER

Copied    ~95%
others     ~5%
</code></pre>
<p>The agent has learned something important.</p>
<p><strong>But suppose the link is normal</strong></p>
<p>Now something different happens. The copied-sender explanation becomes much less plausible.</p>
<p>But we <strong>cannot say the email is safe</strong>.<br />Because the second explanation was: <strong>The attack came from the supplier's actual hacked mailbox.</strong></p>
<p>In that situation, of course the domain looks genuine.</p>
<p>So after a normal-domain result, the agent might end up roughly around:</p>
<p>Copied      9%</p>
<p>Hacked     50%</p>
<p>Genuine    33%</p>
<p>Spam        9%</p>
<pre><code class="language-plaintext">BEFORE

Copied     45%
Hacked     30%
Genuine    20%
Spam        5%

          ↓ link scan
          ↓ NORMAL

AFTER

Copied    ~9%
Hacked    50%
Genuine   33%
Spam      9%
</code></pre>
<p>How did we derive that?</p>
<p>We already know the historical probabilities for <strong>look-alike</strong>:</p>
<p>P(L | Copied)=89%</p>
<p>P(L | Hacked)=3%</p>
<p>P(L | Genuine)=5%</p>
<p>P(L|Spam)=0%</p>
<p>So if the scanner has only these two outcomes—<strong>look-alike or normal</strong>—the probabilities of a normal result are simply the complements:</p>
<p>P(N | Copied)=1−0.89=0.11</p>
<p>P(N | Hacked)=1−0.03=0.97</p>
<p>P(N | Genuine)=1−0.05=0.95</p>
<p>P(N | Spam)=1−0=1.00</p>
<p>The starting beliefs are still:</p>
<p>Copied=45%</p>
<p>Hacked=30%</p>
<p>Genuine=20%</p>
<p>Spam=5%</p>
<p>Now: Prior × Likelihood</p>
<p>For <strong>copied sender</strong>: 0.45×0.11=0.0495</p>
<p>For <strong>hacked mailbox</strong>: 0.30×0.97=0.291</p>
<p>For <strong>genuine</strong>: 0.20×0.95=0.190</p>
<p>For <strong>spam</strong>: 0.05×1=0.050</p>
<pre><code class="language-plaintext">                 Prior × likelihood

Copied      →    0.0495
Hacked      →    0.2910
Genuine     →    0.1900
Spam        →    0.0500
                  ------
Total            0.5805
</code></pre>
<p>Now we normalize, exactly as before.</p>
<p>For copied: 0.0495/0.5805= 8.5%</p>
<p>For hacked: 0.291/0.5805 =50.1%</p>
<p>For genuine: 0.190/0.5805=32.7%</p>
<p>For spam:0.050/0.5805 =8.6%</p>
<p>So after receiving NORMAL DOMAIN, the updated belief is approximately:</p>
<p>Copied=9%,Hacked=50%,Genuine=33%,Spam=9%</p>
<p>And this makes intuitive sense.</p>
<p>A normal domain is <strong>unlikely if someone copied/faked the sender</strong>—only 11% of those historical cases had a normal domain. So copied sender collapses from <strong>45% → 9%</strong>.</p>
<p>But a normal domain is <strong>extremely likely if the real supplier mailbox was hacked</strong>—97% of those cases had a normal domain. Therefore hacked mailbox rises from <strong>30% → 50%</strong>.</p>
<p>Now we've seen that, <strong>Copied sender is much less likely.</strong></p>
<p>But we're still uncertain between: <strong>hacked real mailbox</strong> and <strong>genuine request</strong>. This is exactly why <strong>no single check necessarily settles everything</strong>.</p>
<h3><strong>But there is a complication</strong></h3>
<p>The agent cannot choose what answer the tool gives.</p>
<p>For the link scan:</p>
<pre><code class="language-plaintext">                 LINK SCAN
                    │
          ┌─────────┴─────────┐
          ↓                   ↓
      LOOK-ALIKE            NORMAL
          ↓                   ↓
   almost settles       still uncertain
   copied-sender        hacked vs genuine
</code></pre>
<p>So we cannot judge the link scan merely by saying: "Look-alike would be extremely useful." Because perhaps the scanner returns normal. Therefore, the real question is: <strong>Considering ALL the answers this check could produce; how useful do we expect the check to be?</strong></p>
<p><strong>First, we need to measure uncertainty</strong></p>
<p>Our current belief is: 45%,30%,20%,5%</p>
<p>We need a number representing: **How uncertain is this belief distribution?**That number is called <strong>entropy</strong>.</p>
<p><strong>Entropy = amount of uncertainty remaining.</strong></p>
<p>If the belief were, Copied sender 100% and Everything else 0% there's essentially nothing left to figure out.</p>
<p>Entropy = 0</p>
<p>But:</p>
<pre><code class="language-plaintext">Copied     25%
Hacked     25%
Genuine    25%
Spam       25%
</code></pre>
<p>is highly uncertain. Every explanation is equally plausible. Entropy is much higher. Our actual: 45/30/20/5 lies somewhere between those extremes.</p>
<p><strong>Why do we need entropy at all?</strong></p>
<p>The agent has beliefs: 45%,30%,20%,5%</p>
<p>The agent is now uncertain. This uncertainty does not answer questions that need some measurable numbers. So, entropy comes into picture.</p>
<p>Probability distribution -&gt; one number measuring uncertainty</p>
<p>Information theory starts from a very intuitive requirement: Rare events should give us more information than expected events.</p>
<p>Suppose something has probability, P=50%</p>
<p>Seeing it gives some information.</p>
<p>But if something had probability, P=1% and it actually happened, you've learned much more.</p>
<p>So, we need a mathematical function where:</p>
<p>high probability → little surprise/information</p>
<p>low probability → lots of surprise/information</p>
<p>The logarithm gives us exactly that behavior.</p>
<p>I(x) = -log to the base2 (P(x))</p>
<p>P = 1/2 =&gt; I = 1 bit</p>
<p>P = 1/4 =&gt; I = 2 bits</p>
<p>P = 1/8 =&gt; I = 3 bits</p>
<p>If something becomes twice as unlikely, it contributes one additional bit of information.</p>
<p>That's why logs fit naturally into our problem scope.</p>
<p>We don't know which of our four invoice explanations will eventually turn out to be true.</p>
<p>So information theory asks:</p>
<p>On average, how much information is still required to resolve which explanation is true?</p>
<p>That produces:</p>
<p>H(X) = - Sigma(P(X) * log to the base2 P(X))</p>
<p>That's entropy.</p>
<p>We compare entropy before and after evidence. This gives information gain.</p>
<p>We are not just asking this question: What is the probability that the invoice is fraudulent?</p>
<p>We want to know: "How much information would I gain by performing this check?"</p>
<p><strong>Probability represents what the agent believes; entropy measures how unresolved those beliefs are; information gain measures how much a new check is expected to resolve them.</strong></p>
<p>Applying, the entropy formula to our link scan beliefs we have,</p>
<p>H(X)=− [p1​ * <em>log2​p1​+p2 * ​log2​p2​+p3</em>* ​log2​p3​+p4 * ​log2​p4​]</p>
<p>P(Copied sender) = P(C) = 0.45</p>
<p>If copied sender turns out to be the truth, how <strong>surprising</strong> was that outcome?</p>
<p>Information theory measures surprise as:</p>
<p>I(X) = - log2(P(X))</p>
<p>So, for copied sender -log2(0.45) = 1.15</p>
<p>This is 1.15 bits of surprise/information</p>
<p>For Spam P(S) = 0.05,</p>
<p>The surprise is -log2(0.05) = 4.32.</p>
<p>This is much larger in comparison to the copied sender.</p>
<p>But we have not yet concluded which explanation turns out to be true.</p>
<p>Copied sender would give us 1.15 bits of information <strong>if copied sender occurs</strong>.</p>
<p>But it currently has only a 45% chance.</p>
<p>So we weight its information by its probability: 0.45×1.15</p>
<table>
<thead>
<tr>
<th>Explanation</th>
<th>Probability (p)</th>
<th>Surprise (-log2p)</th>
<th>(p * surprise)</th>
</tr>
</thead>
<tbody><tr>
<td>Copied</td>
<td>0.45</td>
<td>1.15</td>
<td>0.52</td>
</tr>
<tr>
<td>Hacked</td>
<td>0.30</td>
<td>1.74</td>
<td>0.52</td>
</tr>
<tr>
<td>Genuine</td>
<td>0.20</td>
<td>2.32</td>
<td>0.46</td>
</tr>
<tr>
<td>Spam</td>
<td>0.05</td>
<td>4.32</td>
<td>0.22</td>
</tr>
</tbody></table>
<p>Add the final column -&gt; 0.52 + 0.52 + 0.46 + 0.22 = 1.72</p>
<p>Therefore, H(X) = 1.7 bits</p>
<p>What remains is mainly putting information gain into the agent's actual decision loop:</p>
<ol>
<li><strong>Compare candidate checks:</strong></li>
</ol>
<p>The agent estimates information gain for each permitted check—link scan, sender history, known-number call, etc.—and ranks them by how much uncertainty they are expected to remove.</p>
<p><strong>2.Run the chosen check, then re-plan.</strong></p>
<p>This is important.</p>
<p>The agent does not calculate a fixed sequence such as:</p>
<p>link scan → sender history → phone call.</p>
<p>It chooses one check, receives the result, performs the Bayesian update, and then recalculates what evidence would now be most useful.</p>
<p><strong>3.Information gain is not the same as utility.</strong></p>
<p>A check can be highly informative but expensive, slow, privacy-sensitive, unavailable, or irrelevant to the actual decision.</p>
<p>So, this chapter establishes “which check teaches me most?” but does not completely solve “which action is worth taking?”</p>
<p>That distinction leads forward.</p>
<p><strong>4. V4 / Evidence Planner.</strong></p>
<p>This is the engineering payoff. The agent has progressed from:</p>
<p>V2: update belief when evidence arrives</p>
<p>to</p>
<p>V4: Actively decide to seek which evidence next</p>
<p><strong>Choosing the next check</strong></p>
<p>The agent has several checks available. For each one, it can estimate:</p>
<p>"If I perform this check, how much uncertainty do I expect it to remove?"</p>
<p>That's information gain.</p>
<p>So instead of choosing a tool because it sounds useful, V4 can rank candidate checks using expected information gain.</p>
<p>For Email 101, the link scan was more informative than sender history at that particular moment.</p>
<p>The result arrives — and the ranking can change</p>
<p>Suppose the link scan returns:</p>
<p>NORMAL DOMAIN</p>
<p>We already calculated what Bayes does with this.</p>
<p>Approximately:</p>
<pre><code class="language-plaintext">BEFORE

Copied sender     45%
Hacked mailbox    30%
Genuine           20%
Spam               5%

        ↓ NORMAL DOMAIN

AFTER

Copied sender      9%
Hacked mailbox    50%
Genuine           33%
Spam               9%
</code></pre>
<p>Now the problem facing the agent is different. Originally, copied sender was the leading explanation.</p>
<p>After the normal-domain result, the important unresolved question has become:</p>
<p>Is this the real supplier whose mailbox was hacked, or is this actually a genuine request?</p>
<p>Therefore the agent should not blindly execute the check that was originally ranked second.</p>
<p>It calculates again:</p>
<p>Given what I believe now, which available check would reduce the remaining uncertainty most?</p>
<p>At this stage, the known-number call can become much more valuable.</p>
<p>This is an important agentic behaviour.</p>
<p>The plan is adaptive.</p>
<p><strong>So V4 works as a loop.</strong></p>
<pre><code class="language-plaintext">Current belief
      ↓
Which check would teach me most NOW?
      ↓
Choose check
      ↓
Get evidence
      ↓
Bayesian update
      ↓
New belief
      ↓
Which check would teach me most NOW?
      ↓
Choose again
      ↓
...
</code></pre>
<p>So every new piece of evidence can change <strong>both</strong>:</p>
<ol>
<li><p>what the agent believes;</p>
</li>
<li><p>what the agent wants to investigate next.</p>
</li>
</ol>
<p>That is the Evidence Planner introduced in V4.</p>
<p>But don't make information gain too powerful</p>
<p>There is one final boundary this chapter wants us to preserve. Suppose Check A has the highest information gain.</p>
<p>Does that automatically mean: Run Check A.</p>
<p>No.</p>
<p>Information gain answers only: Which check is expected to reduce my uncertainty the most?</p>
<p>It doesn't automatically consider everything we care about. A check may be highly informative but:</p>
<ul>
<li><p>expensive</p>
</li>
<li><p>slow</p>
</li>
<li><p>unavailable</p>
</li>
<li><p>restricted by policy</p>
</li>
<li><p>privacy-sensitive</p>
</li>
<li><p>or unlikely to change what we ultimately do</p>
</li>
</ul>
<h3><strong>V3 → V4</strong></h3>
<p>This is the cleanest way to remember what changed.</p>
<p><strong>V3</strong></p>
<p>The agent understands the shape of uncertainty.</p>
<p>It knows that different questions require different probability models.</p>
<p>But when investigating Message 101, it still doesn't know:</p>
<p>Which evidence should I seek next?</p>
<p><strong>V4</strong></p>
<p>Adds the Evidence Planner.</p>
<p>The agent can now:</p>
<pre><code class="language-plaintext">1. Maintain competing beliefs
              ↓
2. Consider available checks
              ↓
3. Imagine each check's possible results
              ↓
4. Use Bayes to calculate what
   beliefs would follow each result
              ↓
5. Measure expected reduction
   in uncertainty
              ↓
6. Rank the checks
              ↓
7. Perform one
              ↓
8. Observe actual evidence
              ↓
9. Bayesian update
              ↓
10. RE-PLAN
</code></pre>
<p>Entropy measures how uncertain the agent currently is; information gain measures how much a check is expected to reduce that uncertainty.</p>
<p>V4 uses that information gain to choose evidence adaptively—check, observe, update with Bayes, then decide what evidence is worth seeking next.</p>
<h3><strong>Chapter 6</strong></h3>
<p>After the investigation, suppose the agent's belief is:</p>
<p>P(attack)=31%</p>
<p>Therefore: P(not attack)=69%</p>
<p>Now here's the question: What should the agent actually do?</p>
<p>A naive approach would be: "69% says not attack. That's the more likely outcome. Deliver."</p>
<p>And Chapter 6 says:</p>
<p>That's the wrong way to choose an action.</p>
<p>Why?</p>
<p>Because probability tells us what is likely. It does not tell us what a mistake will cost.</p>
<h3><strong>Look at the consequences</strong></h3>
<p><strong>If we deliver an attack by mistake:</strong></p>
<p>cost = ₹10,00,000</p>
<p><strong>If we hold a genuine invoice unnecessarily:</strong></p>
<p>cost = ₹500</p>
<p><strong>Human review:</strong> ₹250</p>
<p>Now reconsider the 31% attack belief.</p>
<h3>Option 1 — Deliver</h3>
<p><strong>If we deliver an attack by mistake:</strong></p>
<p>There's a 31% chance we're delivering an attack.</p>
<p>If that happens, the loss is ₹10,00,000.</p>
<p>So, 0.31 * ₹10,00,000 = ₹3,10,000 ​</p>
<p>That's the <strong>expected loss of delivering.</strong></p>
<h3>Option 2 — Hold and escalate</h3>
<p>There's a 69% chance the invoice is actually genuine.</p>
<p>If genuine, holding it unnecessarily costs ₹500.</p>
<p>So:</p>
<p>0.69×₹500=₹345</p>
<p>Then add the human-review cost: ₹345+₹250 = ₹595</p>
<p>So compare</p>
<pre><code class="language-plaintext">DELIVER
Expected loss ≈ ₹3,10,000

HOLD + HUMAN REVIEW
Expected loss ≈ ₹595
</code></pre>
<p>Now the decision becomes obvious: HOLD</p>
<p>The agent believes: 69% not attack. Yet it chooses HOLD.</p>
<p>That is not a contradiction.</p>
<p>The most likely story is probably not an attack. But the best action is hold.</p>
<p>Because the consequences are radically asymmetric.</p>
<p>Wrongly deliver attack -&gt; ₹10,00,000 damage</p>
<p>Wrongly hold genuine invoice -&gt; ₹500 damage</p>
<p>The most probable outcome is not necessarily the outcome you should act as though is true.</p>
<p>Instead, choose the action with the lowest expected damage​.</p>
<p>This finally explains the threshold</p>
<p>Earlier we encountered rules such as: If attack belief exceeds some percentage, HOLD.</p>
<p>Where should that percentage come from?</p>
<p>Not from - "35% feels risky."</p>
<p>Instead, the threshold is approximately the point where,</p>
<p><strong>Expected loss of delivering = Expected loss of holding</strong></p>
<p>Below that point, delivering may be cheaper. Above that point, holding may be cheaper.</p>
<p>So, a threshold is really:</p>
<p>The belief level where the preferred action changes because the expected consequences cross over. And if the costs change, the threshold should change too. That is a very important connection to our earlier chapters.</p>
<p>This is the conceptual heart of Chapter 6.</p>
<p>Probability tells us what may be true​.</p>
<p>Expected loss helps decide what to do​</p>
<p>and</p>
<p>Value of information tells us whether another investigation is worth buying​</p>
<p>The remaining part of the chapter turns this into V5's explicit <strong>Act / Ask / Hold / Escalate policy</strong>, including permissions, deadlines and human-review capacity.</p>
<p>The agent should not have only two crude choices like: deliver or block.</p>
<p>It needs four honest moves:</p>
<p><strong>Act</strong> when the expected harm is acceptably low and policy allows the action. <strong>Ask</strong> when another permitted check is expected to improve the decision enough to justify its cost and delay.</p>
<p><strong>Abstain / hold</strong> when the agent cannot safely decide automatically.</p>
<p><strong>Escalate</strong> when a qualified person or approved workflow is required.</p>
<p>This is important because abstaining is not failure.</p>
<p>For Message 101, saying: "I am not releasing this payment automatically." can be the correct system behavior.</p>
<p>The policy must then say what happens next: how long the hold lasts, who gets notified, and what happens if nobody responds. V5 behaves almost like a small state machine.</p>
<p>It begins with everything it already knows:</p>
<ul>
<li><p>current belief</p>
</li>
<li><p>payment amount</p>
</li>
<li><p>available evidence checks</p>
</li>
<li><p>permissions</p>
</li>
<li><p>deadline</p>
</li>
<li><p>human-review availability</p>
</li>
</ul>
<p>Then it passes through a sequence of gates.</p>
<p><strong>First: Is there a hard business rule requiring verification?</strong></p>
<p>If yes, the agent holds. It is not allowed to say:</p>
<p>"My probability is low enough, so I'll bypass the rule."</p>
<p>Hard policy rules sit above the probabilistic calculation.</p>
<p>Then it asks: Is there another permitted check whose expected decision benefit exceeds its full cost and that can finish before the deadline?</p>
<p>If yes: ASK -&gt; obtain evidence -&gt; Bayesian update -&gt; recalculate</p>
<p>If not, stop asking.</p>
<p>Then it asks: Is an automatic action permitted and sufficiently safe under the policy?</p>
<p>If yes: ACT.</p>
<p>Otherwise, ESCALATE to an eligible person.</p>
<p>And if no eligible person is available - ABSTAIN / HOLD.</p>
<p>So, uncertainty never leads to an undefined state.</p>
<p>Why "escalate to a human" is not enough</p>
<p>It's tempting to design:</p>
<p>if uncertain: send_to_human()</p>
<p>But humans are also a constrained resource.</p>
<p>A review queue has limited capacity, delay, accuracy limits, and authority boundaries.</p>
<p>So a real escalation policy needs to say:</p>
<p>Who receives the case? What happens to the payment while we wait? What deadline applies? What if the queue is full? Which decisions are never allowed to happen automatically?</p>
<p>Now V5 combines everything</p>
<pre><code class="language-plaintext">
Conceptually

for each possible action:
    calculate expected loss

choose lowest-loss permitted action

then ask:
    could one more check improve that decision enough
    to justify its cost?

if YES:
    run check
    update belief
    repeat

if NO:
    take the best permitted action
</code></pre>
<p>Message 101 closes the loop</p>
<p>After the phone call: P(attack)=31%</p>
<p>Expected loss of delivering: 0.31×₹10,00,000=₹3,10,000</p>
<p>Expected loss of holding and human review: 0.69×₹500+₹250≈₹595</p>
<p>So V5 chooses: Hold and escalate.</p>
<p>So V5 adds</p>
<pre><code class="language-plaintext">Belief
   ↓
Possible actions
   ↓
Expected loss
   ↓
Best permitted action
   ↓
Would more evidence improve the decision enough?
   ↓
YES → ask
NO  → act / hold / escalate
</code></pre>
<h3>And now the whole journey closes</h3>
<p>The agent began as:</p>
<pre><code class="language-plaintext">Email
 ↓
SAFE / DANGEROUS
</code></pre>
<p>It ends as something much richer:</p>
<pre><code class="language-plaintext">Email
 ↓
Possible hidden explanations
 ↓
Belief distribution
 ↓
New evidence
 ↓
Bayesian update
 ↓
Correct uncertainty model
 ↓
Choose useful evidence
 ↓
Entropy / information gain
 ↓
Evaluate consequences
 ↓
Expected loss
 ↓
Is more evidence worth its cost?
 ↓
ACT / ASK / HOLD / ESCALATE
 ↓
Record receipt
 ↓
Later compare with confirmed outcome
</code></pre>
<p><strong>A good agent does not merely try to be certain. It decides when more certainty is worth buying, when uncertainty is acceptable, and when the consequences demand that it stop and hand control to a safer path.</strong></p>
]]></content:encoded></item></channel></rss>