Skip to content

Dev - title - M1 security hardening + blog content: Post A, Post B, article updates - #22

Merged
csupenn merged 4 commits into
mainfrom
dev
Jun 15, 2026
Merged

csupenn merged 4 commits into
mainfrom
dev

Conversation

@csupenn

@csupenn csupenn commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

Security hardening (W1 + W2 Phase 1)

  • SSRF egress guard (lib/security/ssrf.ts): hostname/IP blocklist covering RFC 1918, loopback, CGNAT, cloud metadata; provenance-aware exemption for engine-internal routes
  • Cycle detection: DFS pre-execution pass rejects cyclic graphs server-side
  • Durable rate limiter (lib/security/rate-limit.ts + upstash-rate-limit-store.ts): sliding-window, injectable clock, MemoryRateLimitStore → UpstashRateLimitStore via env-var factory
  • AES-256-GCM key encryption (lib/security/encryption.ts): BYOK API keys encrypted at rest via Web Crypto; fixed ephemeral-key bug (generateKey → importKey with persistence)
  • URW constrained-selector (lib/security/urw.ts): 7-invariant pattern constraining LLM to ranker/labeler on security paths; blocks fabrication, prompt injection, unstructured output
  • TypeScript strict mode: removed ignoreBuildErrors from next.config.mjs; tsc --noEmit in CI

Blog content

  • Post A — The Bug That Made My Encryption Instantly Useless (March 2026): AES-GCM ephemeral-key bug, three-tier fix, round-trip test, XSS limitation
  • Post B — The Untrusted Reasoning Worker: Why I Don't Let the LLM Decide (April 2026): URW pattern, 7 invariants, full code walkthrough, three attack trees, lethal-trifecta warning
  • CISO article: full rewrite with real build specifics, AI security vision section (AI compressing attacker skill floor, URW as the answer, lethal trifecta)
  • SSRF article: rewrote with real ssrf.ts code, provenance-aware exemption, DNS-rebinding limitation, GitHub links; fixed inaccurate "allowlist" claim
  • Five Layers article: A03 updated with AES-256-GCM + XSS limitation; rate limiting updated to UpstashRateLimitStore; A10 adds provenance-aware exemption; tutorial cross-links
  • All other articles: GitHub repo links added

Docs

  • Implementation status updated (T4/T6/T7 ✅, 536 tests / 27 suites)
  • README: AI Security Tutorials link added for SEO
  • AI-Security README: Published column with tutorial GitHub links

Test plan

  • pnpm tsc --noEmit exits clean
  • pnpm lint — no new errors
  • pnpm test — 536 tests, 27/27 suites passing
  • Visit topflow.dev/blog after deploy: Post A and Post B render; SSRF, Five Layers, CISO articles show updated content
  • Confirm GitHub links resolve after merge (all blob/main/ paths exist on this branch)

csupenn added 4 commits June 15, 2026 00:28
…Hub doc links

Tutorials 01, 02, 04 exist as markdown docs in docs/AI-Security/osv-scanner/ but have
not been published as blog articles yet — the topflow.dev/blog/0x-... URLs returned 404.
Replaced all three occurrences (five-layers, ssrf, encryption-bug articles) with direct
GitHub links to the draft doc files.
@vercel

vercel Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
top-flow Ready Ready Preview, Comment Jun 15, 2026 7:48am

@csupenn
csupenn merged commit 9ef97ed into main Jun 15, 2026
6 of 7 checks passed

This branch was successfully deployed

1 active deployment
Preview — 36c92f70 Deployed Jun 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant