Inspiration

When a third-party client, mobile app, or upstream service you cannot roll back starts sending malformed or schema-drifted JSON (for example, "limit":"25" instead of "limit":25), APIs break immediately. Emergency hotfixes risk introducing regressions, while letting an AI agent freely write and deploy production proxy code is unsafe.

WireGraft was built to bridge that gap: an AI agent can investigate an incident and propose a declarative Graft IR, while deterministic Rust verifiers, pre-certified Envoy Proxy-Wasm filters, live dry-run evidence, and a human approval gate enforce strict safety boundaries on the wire.

What it does

WireGraft attaches a pre-certified Envoy Proxy-Wasm filter (wg-normalize, wg-block, or wg-passthrough) to a single guarded JSON route and classifies every proposed Graft IR using a pure, deterministic tier function:

  • Normalize: Value-preserving lexical fixes (e.g., "limit":"25" → "limit":25). wg-normalize never calls proxy_send_local_response (verified by both tests and the WASM import gate).
  • Block: Rejects syntactically invalid JSON or contract-tightening inputs (with a signed amendment).
  • Refuse: Anything that would alter business meaning (such as clamping values) is never activatable; WireGraft refuses activation and drafts an upstream issue instead.

Every activation flows through Layer 2 enforcement (wg-gate) and is monitored in the WireGraft Operating Room, a dual-theme (Ceramic Light / Obsidian Dark) bento console with strict CSP compliance, real-time SSE telemetry, a wire/hex/slot cartridge inspector, two-cohort KPI radial gauges (Affected vs Unaffected), and a Challenge Layer 2 control that demonstrates deterministic HTTP 403 rejection of unauthorized bypass attempts.

How we built it

WireGraft follows a strict spec-first, evidence-first architecture:

  • Core Rust Workspace: Built modular crates for graft-ir (RFC 8785 JCS canonicalization, Ed25519 amendments, pure tiering), tokenizer (zero-dependency streaming JSON tokenizer & in-place splicer), wg-verifier, wg-gate, wg-controller, wg-api, wg-mcp, and three Proxy-Wasm filters (wg-normalize, wg-block, wg-passthrough).
  • Envoy & Docker Demo Stack: File-based atomic ECDS updates (deploy/demo/), synthetic traffic generator, test backend, and automated startup scripts (make demo / scripts/demo-up.ps1).
  • Operating Room UI (V3): React + TypeScript + Vite console redesigned from a custom Figma V3 spec via Figma MCP, enforcing strict CSP (style-src 'self', zero external fonts/CDNs, zero inline styles, zero Web Storage), WCAG 2.1 AA contrast (axe-core), and 106 passing unit/integration tests.
  • Kiro Ecosystem: Driven by a single source of truth (SSOT-Kiroween.md), .kiro/specs/, .kiro/steering/, property-based testing (proptest + differential Python reference models), a dedicated MCP server (wg-mcp), a companion Kiro Crew app (wiregraft-oncall-crew), and a Kiro Power (wiregraft-power).

Challenges we ran into

  • Envoy Tap Sink & ECDS Constraints: Envoy 1.39.1 aborts on static streaming_grpc tap sinks, so we pivoted to file-based atomic ECDS swaps (Option F) and documented the limitation transparently.
  • Strict CSP & Accessibility Under Dual-Theme UI: Designing a rich telemetry dashboard with radial gauges and live waveforms without inline style={{ ... }}, external CDNs, or localStorage required pure SVG presentation attributes (strokeDasharray/strokeDashoffset), data-theme/data-status CSS tokens, and in-memory state.
  • Cross-Platform CI Parity: Caught and fixed a Linux non-root EACCES permission bug in ledger_audit tests (compiled out on Windows) by verifying inside a non-root Linux Rust container.

Accomplishments that we're proud of

  • Deterministic Safety Boundaries: Agents only propose IR; the tier classifier, schema validator, and Layer 2 gate are pure, tested Rust logic that cannot be bypassed.
  • Evidence-First Honesty: Every public claim is gated behind formal GO-Gates (docs/GO/STATUS.md) and automated vocab-lint checks. Nothing unverified is claimed.
  • Comprehensive Test Coverage: Property-based tests (proptest), differential tests against Python reference models, mutation tests, Linux CI (ssot and kiro-rust), and 106 passing UI tests.

What we learned

Combining AI-assisted spec-driven development with hard deterministic guardrails (JSON Schema, JCS canonical hashing, property-based testing, and automated vocabulary/CSP linting) lets you move fast without sacrificing engineering rigor.

Known limitations & What's next

In accordance with our evidence-first policy (docs/GO/STATUS.md), only GO-14 passed in part prior to freeze:

  • Demo certificates are stand-ins (fuzz_cpu_hours = 0.0 accepted only in the demo profile; refused in production).
  • The local stack runs against our test backend with simulated drift; some hero beats (Retire, Refuse) are demonstrated using the labeled REPLAY console.
  • Next steps include passing the remaining GO-Gates (real OSS backend pinning, gRPC ECDS, panic-free WASM builds, and full fuzzing budgets).

Built With

Share this project:

Updates

Submission history