cd /news/ai-agents/how-spec-first-kiro-built-anchora-a-… · home › topics › ai-agents › article
[ARTICLE · art-178977] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

How Spec-First Kiro Built Anchora — A Two-Pillar Audit Trail You Can Verify Offline

A developer built Anchora, a TypeScript evidence skeleton (@anchora/core) that powers two client-side audit applications, Seal and Witness, plus an offline verifier CLI and a stdio Kiro MCP server. The system seals 500 deterministic events with Ed25519 signatures and create-only anchors, detecting tampering such as an edited loan decision at seq 217 via a HASH_MISMATCH and firstDivergence report. The build was driven by Kiro steering files and hooks that enforce TypeScript strict mode, a static security scan, and 199 unit and property-based tests before any agent turn can end.

recommendation

Anchor audit heads externally with Ed25519 signatures and create-only writes, and gate agent turns on strict type checks, security scans and the full test suite.

more in playbook: Designing agent systems
by read3 min views1 publishedDec 1, 2026

Written as part of Kiroween 2026 (Skeleton Crew category).

Most AI agent demos stop at a green dashboard. That works until an auditor asks two harder questions:

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.

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

Before writing a single line of cryptography, I wrote four steering files (.kiro/steering/) locking down the non-negotiable promises:

simulated badges) and publish docs/limits.md. connect-src 'none' CSP, system fonts, zero backend).

From there, Kiro generated 15 EARS requirements, a canonical preimage & verification design doc, and 16 scoped task groups. Every task ran behind three automated Kiro hooks: security-on-write.json (PostToolUse on write): blocks eval, innerHTML, web storage, external CDN/font URLs, secrets, and banned overclaims on every edit.contract-on-core-change.json (PostFileSave on crypto/ chain/ capture): immediately runs Vitest on core changes. verify-on-stop.json (Stop): refuses to end any agent turn unless TypeScript strict mode (4 projects), the static security scan, and all 199 unit & fast-check property-based tests pass. Both applications import @anchora/core without duplicating a single line of crypto:

500 deterministic events over one canonical serialiser (anchora/1), seals heads with @noble/ed25519, and writes create-only ( wx) anchors. Edit seq 217 (a £2,000,000 AI commercial loan decision flipped from approved to declined) and the SVG chain visualizer fractures at HASH_MISMATCH, showing firstDivergence: 217. Click 217→500 — every link looks consistent, and Seal still catches it at seq 240 (SEAL_INVALID / ANCHOR_MISSING) because the external seal & anchor were already written. 15 auditable actions as fail-closed (widening actions like roles.grant or agents.guardrail.ceiling.raise refuse with audit-unavailable when the audit store is down) or queue (tightening actions like roles.revoke or agents.disable 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. To make Kiro verify its own work directly inside the repo, I added:

tools/mcp/server.ts, registered in .kiro/settings/mcp.json) exposing verify_bundle, inspect_seq, check_coverage, and check_compliance with zero extra dependencies and zero network calls..kiro/agents/security-auditor.json and evidence-builder.json, verified via kiro-cli agent validate)..kiro/powers/anchora/POWER.md) so developers can extend @anchora/core into a third domain app in three steps.packages/core/data/kiro-audit.bundle.json), recording Anchora's own build milestones in the exact same Ed25519-sealed format. Running kiro-cli chat --agent security-auditor verified both bundle.json (500 events, PASS) and kiro-audit.bundle.json (24 events, PASS) plus 0 coverage gaps via MCP — and cleanly refused to claim results for a shell command blocked by non-interactive permissions.

Kiro's hook loop caught its own fast-check 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.

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

── more in #ai-agents 4 stories · sorted by recency
── more on @kiro 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-spec-first-kiro-…] indexed:0 read:3min 2026-12-01 · —