<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gusttavo Castro</title>
    <description>The latest articles on DEV Community by Gusttavo Castro (@castrogusttavo).</description>
    <link>https://dev.to/castrogusttavo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2157764%2F3b3da68a-327a-4b0c-84b8-273f19e61934.png</url>
      <title>DEV Community: Gusttavo Castro</title>
      <link>https://dev.to/castrogusttavo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/castrogusttavo"/>
    <language>en</language>
    <item>
      <title>Reducing False Positives in AppSec Triage with Paraconsistent Logic (LPA2v)</title>
      <dc:creator>Gusttavo Castro</dc:creator>
      <pubDate>Thu, 06 Aug 2026 19:37:52 +0000</pubDate>
      <link>https://dev.to/castrogusttavo/reducing-false-positives-in-appsec-triage-with-paraconsistent-logic-lpa2v-4kni</link>
      <guid>https://dev.to/castrogusttavo/reducing-false-positives-in-appsec-triage-with-paraconsistent-logic-lpa2v-4kni</guid>
      <description>&lt;p&gt;I built this for my undergraduate thesis (Software Engineering) and wanted to share it here because I think the technical trade-offs are more interesting to this audience than the headline numbers.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;An AppSec pipeline running SAST, SCA, and DAST on every commit generates more findings than any team can realistically triage. Most of them aren't real vulnerabilities — test code, an already-mitigated dependency, a scanner that flakes between runs. But each tool decides, in isolation, by severity, what becomes an alert. The result is alert fatigue: once the noise crosses a certain threshold, teams stop trusting the scanners, and a real finding gets lost among a thousand false ones.&lt;/p&gt;

&lt;p&gt;I didn't want to build another scanner. I wanted to test whether correlating what scanners already produce, before deciding what becomes an alert, could help.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why paraconsistent logic
&lt;/h2&gt;

&lt;p&gt;Most triage mechanisms run on classical logic: a finding either is or isn't a vulnerability. That doesn't reflect the reality of a pipeline — it's common for SAST to flag missing authentication on an endpoint while DAST tries to exploit that same endpoint and gets blocked by a WAF. Both pieces of evidence are real and contradictory. A binary mechanism is forced to discard one of them.&lt;/p&gt;

&lt;p&gt;Two-valued Paraconsistent Annotated Logic (LPA2v — da Costa, 1974; Abe, 2015) represents each piece of evidence with two degrees, favorable (μ) and unfavorable (λ), which can both be high at once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GC  = μ - λ        certainty degree
GCT = μ + λ - 1     contradiction degree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When GCT is high, it's not a tie to be broken — it's genuine contradiction, and it should become an "inconsistent" state flagged for human review, not a forced "confirmed" or "dismissed."&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;Five domain neurons (SAST, SCA, DAST, code context, operational context) each estimate (μ, λ) from that domain's raw signal. A master neuron aggregates them in two different ways — and this split was the part that took the most iterations to get right:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Consensus&lt;/strong&gt;: weighted mean of μ and λ across all domains, used to rank severity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Contradiction&lt;/strong&gt;: the largest μ and largest λ among the primary detectors (SAST/SCA/DAST) — not a mean.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;My first version used a single weighted mean for everything, and it didn't work: a real contradiction between two specific detectors got diluted by the mean of the neutral domains and never produced a GCT high enough to trigger the inconsistent state — the exact opposite of what paraconsistent logic is supposed to do. Splitting the two aggregations fixed it.&lt;/p&gt;

&lt;p&gt;Before becoming an alert, the result still passes through a temporal persistence window (3 scan ticks), so an isolated spike doesn't trigger an escalation on its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Synthetic simulation
&lt;/h2&gt;

&lt;p&gt;A TypeScript simulator with 206 synthetic assets across 12 scenarios (from a benign dependency bump to a confirmed RCE, including the WAF case above and a silent supply-chain compromise that only SCA sees). I compared plain threshold, rule-based (a small set of predefined IF-THEN exceptions), and the LPA2v cluster, across 3,005 events:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;th&gt;False Positives&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Threshold&lt;/td&gt;
&lt;td&gt;8.01%&lt;/td&gt;
&lt;td&gt;86.8%&lt;/td&gt;
&lt;td&gt;2,493&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rule-Based&lt;/td&gt;
&lt;td&gt;10.41%&lt;/td&gt;
&lt;td&gt;86.8%&lt;/td&gt;
&lt;td&gt;1,868&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LPA2v-Cluster&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;td&gt;65.6%&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The number that matters here isn't the isolated 100% precision — it's that the cluster eliminated false positives without simply going quiet: it still catches 164 of the 250 simulated real positives. The recall drop is real, concentrated in three deliberately hard scenarios (single-domain evidence, a weak early signal in a progressive leak, and the persistence window's warm-up period). I reported the number as it came out, without recalibrating until it looked better.&lt;/p&gt;

&lt;h2&gt;
  
  
  Against real findings
&lt;/h2&gt;

&lt;p&gt;Simulation validates the architecture, not production performance. So I ran Semgrep, Snyk, and OWASP ZAP for real against 5 applications (two SaaS platforms, freeCodeCamp, Plane, and my personal portfolio), collecting 559 findings labeled through AI-assisted human review — not the tools' own self-reported severity, which would make the study circular.&lt;/p&gt;

&lt;p&gt;With the cluster unchanged — same weights, same thresholds as the simulation:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mechanism&lt;/th&gt;
&lt;th&gt;Precision&lt;/th&gt;
&lt;th&gt;Recall&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Threshold&lt;/td&gt;
&lt;td&gt;31.66%&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rule-Based&lt;/td&gt;
&lt;td&gt;34.17%&lt;/td&gt;
&lt;td&gt;100%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LPA2v-Cluster&lt;/td&gt;
&lt;td&gt;86.84%&lt;/td&gt;
&lt;td&gt;74.58%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The weakest point: 33.33% recall on one of the repositories, where 8 of 12 real vulnerabilities shared the same pattern (moderate-severity, single-domain evidence) and fell below the attention threshold — the same mean-dilution effect as before, just without contradiction to counteract it, because there was no contradiction there, only weak isolated evidence. I didn't recalibrate to hide it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's left unsolved
&lt;/h2&gt;

&lt;p&gt;Weights and thresholds were hand-calibrated, not learned from labeled data. With 559 findings already labeled, adaptive calibration is the obvious next step, but it was out of scope for this thesis.&lt;/p&gt;

&lt;p&gt;Code is fully open source, with seeded, deterministic simulation for anyone who wants to reproduce the exact numbers: &lt;a href="https://github.com/castrogusttavo/lpa2v-appsec" rel="noopener noreferrer"&gt;Repo link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If anyone here has worked on alert correlation in a security pipeline, I'd really like critique on the decision to split consensus from contradiction — it's the design choice that cost me the most, and I'm still not sure it's the most elegant way to solve it.&lt;/p&gt;

</description>
      <category>computerscience</category>
      <category>cybersecurity</category>
      <category>security</category>
      <category>softwareengineering</category>
    </item>
  </channel>
</rss>
