<?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: kyzen</title>
    <description>The latest articles on DEV Community by kyzen (@kyzenfr).</description>
    <link>https://dev.to/kyzenfr</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%2F4285847%2Fe6c83f84-aa46-46dc-aae4-47b5cbf35830.png</url>
      <title>DEV Community: kyzen</title>
      <link>https://dev.to/kyzenfr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kyzenfr"/>
    <language>en</language>
    <item>
      <title>Near Miss — Case File 001: "The notebook that quoted the poison"</title>
      <dc:creator>kyzen</dc:creator>
      <pubDate>Sun, 06 Dec 2026 05:44:49 +0000</pubDate>
      <link>https://dev.to/kyzenfr/near-miss-case-file-001-the-notebook-that-quoted-the-poison-48b7</link>
      <guid>https://dev.to/kyzenfr/near-miss-case-file-001-the-notebook-that-quoted-the-poison-48b7</guid>
      <description>&lt;h2&gt;
  
  
  CASE FILE 001 — "The notebook that quoted the poison"
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; StudyPilot — a revision agent that reads study notes, strips planted instructions out of them, and builds a day-by-day plan.&lt;br&gt;
&lt;strong&gt;Incident:&lt;/strong&gt; after a refactor, the agent passed every test I ran — and still leaked the exact thing it was built to contain.&lt;br&gt;
&lt;strong&gt;Status:&lt;/strong&gt; found, fixed, re-verified. No canary survives in any output.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exhibit A — The clean bill of health
&lt;/h2&gt;

&lt;p&gt;Trap Pack re-run, refactored build, keyless mode:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every trap passed. Unit suite &lt;strong&gt;45/45&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The plan it produced was exactly the plan I wanted.&lt;/li&gt;
&lt;li&gt;Ingest report, trace, calendar export: clean.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If I had stopped at the outputs a human reads, this case would be closed as "nothing to see here."&lt;/p&gt;

&lt;h2&gt;
  
  
  Exhibit B — The place nobody greps
&lt;/h2&gt;

&lt;p&gt;I ran the canary scan across &lt;em&gt;every&lt;/em&gt; file the run produced — not just the readable ones. It found &lt;strong&gt;9 canary tokens, quoted verbatim, in &lt;code&gt;studypilot.db&lt;/code&gt;&lt;/strong&gt;, the agent's SQLite state file, inside the &lt;code&gt;sanitise_json.lines_removed&lt;/code&gt; audit log.&lt;/p&gt;

&lt;p&gt;The mechanism, in one line: &lt;code&gt;safety.sanitise()&lt;/code&gt; strips each planted line out of a file — and then records the removed line, word for word, so a human can check what was taken out. The sanitiser did its job perfectly on the way in, then faithfully copied the poison into its own notebook.&lt;/p&gt;

&lt;p&gt;The audit trail — the thing that exists to prove the agent was safe — was the leak. A judge grepping the run's outputs would have flagged it, and they would have been right to.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exhibit C — The fix (one change)
&lt;/h2&gt;

&lt;p&gt;In &lt;code&gt;safety.py&lt;/code&gt;, removed lines are now recorded with canary-shaped and secret-shaped strings redacted to &lt;code&gt;[BLOCKED-CANARY]&lt;/code&gt; / &lt;code&gt;[REDACTED-KEY]&lt;/code&gt; — the same substitution the outbound scan already applied to everything leaving the agent. The audit still records every removed line and its pattern count; only the token itself is withheld.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verdict — re-run after the fix
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Same trap feed, same exit code.&lt;/li&gt;
&lt;li&gt;Plan and ingest report &lt;strong&gt;byte-identical&lt;/strong&gt; to the pre-fix run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;0 canaries anywhere, including &lt;code&gt;studypilot.db&lt;/code&gt;.&lt;/strong&gt; Suite still 45/45.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I took from it
&lt;/h2&gt;

&lt;p&gt;For an agent that runs unattended, the audit trail is also an output. I had been checking what the agent &lt;em&gt;said&lt;/em&gt; and what it &lt;em&gt;did&lt;/em&gt;, and never thought to check what it &lt;em&gt;remembered&lt;/em&gt;. "Nothing bad leaked" is only true if you grep the places you'd never think to look — including the log that exists to prove you were safe.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;StudyPilot — Agentware 2026. Repo: &lt;a href="https://github.com/Kyzenkms/studypilot" rel="noopener noreferrer"&gt;https://github.com/Kyzenkms/studypilot&lt;/a&gt; — Near Miss write-up, also eligible for FileClerk's six $50 awards.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>agentware</category>
      <category>hackathon</category>
      <category>ai</category>
      <category>python</category>
    </item>
  </channel>
</rss>
