<?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: sudo grep</title>
    <description>The latest articles on DEV Community by sudo grep (@sudo_grep_c26594a296e8d29).</description>
    <link>https://dev.to/sudo_grep_c26594a296e8d29</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%2F4275212%2F7475e51c-210b-4a84-9227-15d5ef92c750.jpg</url>
      <title>DEV Community: sudo grep</title>
      <link>https://dev.to/sudo_grep_c26594a296e8d29</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudo_grep_c26594a296e8d29"/>
    <language>en</language>
    <item>
      <title>How Spec-First Kiro Built Anchora — A Two-Pillar Audit Trail You Can Verify Offline</title>
      <dc:creator>sudo grep</dc:creator>
      <pubDate>Tue, 01 Dec 2026 00:08:42 +0000</pubDate>
      <link>https://dev.to/sudo_grep_c26594a296e8d29/how-spec-first-kiro-built-anchora-a-two-pillar-audit-trail-you-can-verify-offline-9d3</link>
      <guid>https://dev.to/sudo_grep_c26594a296e8d29/how-spec-first-kiro-built-anchora-a-two-pillar-audit-trail-you-can-verify-offline-9d3</guid>
      <description>&lt;p&gt;&lt;em&gt;Written as part of Kiroween 2026 (Skeleton Crew).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Most AI agent demos stop at a green dashboard. That works until an auditor asks two harder questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Has anything in the audit log been changed since it was written?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Did every action that should have left a record actually leave one?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the dashboard reads the same database table an administrator can edit, a green checkmark proves nothing. And if an outage drops a role grant from the audit stream, an immutable-looking hash chain only proves that an incomplete record wasn't altered later.&lt;/p&gt;

&lt;p&gt;For &lt;strong&gt;Kiroween 2026&lt;/strong&gt;, I built &lt;strong&gt;Anchora&lt;/strong&gt; (&lt;code&gt;https://tradexy.github.io/reliquary/&lt;/code&gt; | repo: &lt;code&gt;https://github.com/tradexy/reliquary&lt;/code&gt;) in the &lt;strong&gt;Skeleton Crew&lt;/strong&gt; category: one reusable TypeScript evidence skeleton (&lt;code&gt;@anchora/core&lt;/code&gt;) powering two distinct client-side applications (&lt;strong&gt;Seal&lt;/strong&gt; and &lt;strong&gt;Witness&lt;/strong&gt;), an offline verifier CLI, and a stdio Kiro MCP server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Spec-First With Kiro Changed Everything
&lt;/h2&gt;

&lt;p&gt;Before writing a single line of cryptography, I wrote four &lt;strong&gt;steering files&lt;/strong&gt; (&lt;code&gt;.kiro/steering/&lt;/code&gt;) locking down the non-negotiable promises:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;"The verifier is the product."&lt;/em&gt; If an outsider can't re-check the claim with one file and one command, don't make it.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;"Never overstate."&lt;/em&gt; Say &lt;strong&gt;tamper-evident&lt;/strong&gt;, never "tamper-proof" or "immutable". Label every simulated boundary (&lt;code&gt;simulated&lt;/code&gt; badges) and publish &lt;code&gt;docs/limits.md&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;"Lawful change is classified, not concealed."&lt;/em&gt; GDPR erasure and retention checkpoints shouldn't masquerade as clean logs or trigger false tampering alarms.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;"Zero runtime network calls."&lt;/em&gt; Everything runs sealed (&lt;code&gt;connect-src 'none'&lt;/code&gt; CSP, system fonts, zero backend).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From there, Kiro generated &lt;strong&gt;15 EARS requirements&lt;/strong&gt;, a canonical preimage &amp;amp; verification design doc, and 16 scoped task groups. Every task ran behind &lt;strong&gt;three automated Kiro hooks&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;security-on-write.json&lt;/code&gt; (&lt;code&gt;PostToolUse&lt;/code&gt; on &lt;code&gt;write&lt;/code&gt;): blocks &lt;code&gt;eval&lt;/code&gt;, &lt;code&gt;innerHTML&lt;/code&gt;, web storage, external CDN/font URLs, secrets, and banned overclaims on every edit.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;contract-on-core-change.json&lt;/code&gt; (&lt;code&gt;PostFileSave&lt;/code&gt; on &lt;code&gt;crypto&lt;/code&gt;/&lt;code&gt;chain&lt;/code&gt;/&lt;code&gt;capture&lt;/code&gt;): immediately runs Vitest on core changes.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;verify-on-stop.json&lt;/code&gt; (&lt;code&gt;Stop&lt;/code&gt;): refuses to end any agent turn unless TypeScript strict mode (&lt;code&gt;4&lt;/code&gt; projects), the static security scan, and all &lt;code&gt;199&lt;/code&gt; unit &amp;amp; &lt;code&gt;fast-check&lt;/code&gt; property-based tests pass.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  What the Skeleton Produces
&lt;/h2&gt;

&lt;p&gt;Both applications import &lt;code&gt;@anchora/core&lt;/code&gt; without duplicating a single line of crypto:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Seal (Integrity Vault):&lt;/strong&gt; Hash-chains &lt;code&gt;500&lt;/code&gt; deterministic events over one canonical serialiser (&lt;code&gt;anchora/1&lt;/code&gt;), seals heads with &lt;code&gt;@noble/ed25519&lt;/code&gt;, and writes create-only (&lt;code&gt;wx&lt;/code&gt;) anchors. Edit &lt;code&gt;seq 217&lt;/code&gt; (a £2,000,000 AI commercial loan decision flipped from &lt;code&gt;approved&lt;/code&gt; to &lt;code&gt;declined&lt;/code&gt;) and the SVG chain visualizer fractures at &lt;code&gt;HASH_MISMATCH&lt;/code&gt;, showing &lt;code&gt;firstDivergence: 217&lt;/code&gt;. Click &lt;strong&gt;Rewrite chain from here&lt;/strong&gt; to recompute every downstream hash &lt;code&gt;217→500&lt;/code&gt; — every link looks consistent, and Seal still catches it at &lt;code&gt;seq 240&lt;/code&gt; (&lt;code&gt;SEAL_INVALID&lt;/code&gt; / &lt;code&gt;ANCHOR_MISSING&lt;/code&gt;) because the external seal &amp;amp; anchor were already written.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Witness (Capture Registry):&lt;/strong&gt; Classifies &lt;code&gt;15&lt;/code&gt; auditable actions as &lt;code&gt;fail-closed&lt;/code&gt; (widening actions like &lt;code&gt;roles.grant&lt;/code&gt; or &lt;code&gt;agents.guardrail.ceiling.raise&lt;/code&gt; refuse with &lt;code&gt;audit-unavailable&lt;/code&gt; when the audit store is down) or &lt;code&gt;queue&lt;/code&gt; (tightening actions like &lt;code&gt;roles.revoke&lt;/code&gt; or &lt;code&gt;agents.disable&lt;/code&gt; complete and queue durably). A coverage build guard fails CI if any catalogued action lacks a test, and SOC 2, ISO 27001, and EU AI Act controls link directly back to supporting events in Seal.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Custom Agents, Offline MCP, and Self-Auditing
&lt;/h2&gt;

&lt;p&gt;To make Kiro verify its own work directly inside the repo, I added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An &lt;strong&gt;offline stdio MCP server&lt;/strong&gt; (&lt;code&gt;tools/mcp/server.ts&lt;/code&gt;, registered in &lt;code&gt;.kiro/settings/mcp.json&lt;/code&gt;) exposing &lt;code&gt;verify_bundle&lt;/code&gt;, &lt;code&gt;inspect_seq&lt;/code&gt;, &lt;code&gt;check_coverage&lt;/code&gt;, and &lt;code&gt;check_compliance&lt;/code&gt; with zero extra dependencies and zero network calls.&lt;/li&gt;
&lt;li&gt;Two &lt;strong&gt;validated Kiro custom agents&lt;/strong&gt; (&lt;code&gt;.kiro/agents/security-auditor.json&lt;/code&gt; and &lt;code&gt;evidence-builder.json&lt;/code&gt;, verified via &lt;code&gt;kiro-cli agent validate&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;An installable &lt;strong&gt;Kiro Power&lt;/strong&gt; (&lt;code&gt;.kiro/powers/anchora/POWER.md&lt;/code&gt;) so developers can extend &lt;code&gt;@anchora/core&lt;/code&gt; into a third domain app in three steps.&lt;/li&gt;
&lt;li&gt;A verifiable &lt;strong&gt;Kiro Build Trail&lt;/strong&gt; (&lt;code&gt;packages/core/data/kiro-audit.bundle.json&lt;/code&gt;), recording Anchora's own build milestones in the exact same Ed25519-sealed format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Running &lt;code&gt;kiro-cli chat --agent security-auditor&lt;/code&gt; verified both &lt;code&gt;bundle.json&lt;/code&gt; (500 events, PASS) and &lt;code&gt;kiro-audit.bundle.json&lt;/code&gt; (24 events, PASS) plus &lt;code&gt;0&lt;/code&gt; coverage gaps via MCP — and cleanly refused to claim results for a shell command blocked by non-interactive permissions.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Kiro Caught vs. What Humans Caught
&lt;/h2&gt;

&lt;p&gt;Kiro's hook loop caught its own &lt;code&gt;fast-check&lt;/code&gt; v3 API mistake immediately by executing the suite instead of guessing. Meanwhile, human review caught a subtle semantic bug: an in-place lawful erasure that re-hashes its row leaves a matching hash, so the verifier had to report declared lawful markers independently of the mismatch loop.&lt;/p&gt;

&lt;p&gt;Both the demo and the offline CLI (&lt;code&gt;npm run verify:bundle -- packages/core/data/bundle.json&lt;/code&gt;) are MIT-licensed and open to inspect — no login, no server, just arithmetic you can re-run yourself.&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>typescript</category>
      <category>security</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
