v2 · Dark Edition

Buku Ilmu
Vibe Coding

52 pengajaran tentang keselamatan, AI, dan pembangunan perisian produksi dari Matt Murphy

52
Posts
6
Chapters
2025
Year
FB
Source

Isi Kandungan

Bab 1

Keselamatan API & Web

Setiap endpoint adalah pintu. Setiap pintu perlu kunci yang betul.
#01

Stripe Webhook: Sahkan Setiap Permintaan

Attackerfake eventWebhookEndpointsig?OKverify signature
Ulasan Matt Murphy

Your AI built a Stripe webhook that trusts every request that hits the endpoint. Any scanner that finds the URL can send a fake payment event and your server provisions access. Stripe sends a signature header with every webhook. Verify it against your webhook secret before you process anything. Strip the signature, log the raw body, replay the event. If your code processes it, your verification is broken. Your webhook endpoint is an API. Treat it like one.

Rumusan AI

Matt menjelaskan bahawa webhook Stripe yang tidak disahkan boleh menerima peristiwa palsu dari sesiapa sahaja. Penyelesaiannya: sentiasa verifikasi signature header Stripe menggunakan webhook secret sebelum memproses apa-apa. Uji dengan membuang signature dan lihat jika kod masih memproses. Anggap webhook sebagai API endpoint yang perlu dilindungi.

stripewebhooksecurityvibecoding
Lihat post asal →
#02

WAF & ModSecurity: Dinding Pertahanan

InternetattacksWAFModSeccleanAppOWASP CRS blocks noise
Ulasan Matt Murphy

Your AI deployed your app without a firewall. A WAF sits in front of your server and blocks the attacks your code was never designed to handle. SQL injection attempts, path traversal, known exploit signatures. ModSecurity with the OWASP core rule set blocks the noise before it reaches your application. You do not need to be a security expert. You need to be in front of something that already knows. Direct your AI to put a WAF in front of every public endpoint.

Rumusan AI

WAF (Web Application Firewall) seperti ModSecurity dengan OWASP CRS bertindak sebagai lapisan pertahanan pertama, menghalang SQL injection, path traversal, dan exploit terkenal sebelum mereka sampai ke aplikasi anda. Anda tidak perlu jadi pakar security; anda hanya perlu letak sesuatu yang sudah pakar di hadapan aplikasi.

wafmodsecurityowaspfirewall
Lihat post asal →
#03

Magic Link: Token Tanpa Kata Laluan

Magic LinktokenExpiry5 minSingleUseToken = Password. Treat it like one.
Ulasan Matt Murphy

Your AI built a magic link login system. The token never expires. A user clicks the link three days ago and the token is still valid. An attacker who intercepts that link has permanent access. Magic link tokens need an expiration measured in minutes, not days. Single use. Bound to the email address that requested it. Invalidate every other token when a new one is generated. A magic link is a password. Treat it like one.

Rumusan AI

Magic link adalah sama dengan password. Token perlu luput dalam minit (bukan hari), kegunaan tunggal, terikat dengan email yang memintanya, dan semua token lain perlu dibatalkan apabila yang baru dijana. Jika token tidak luput, sesiapa yang memintas link boleh akses kekal.

magic-linkauthenticationtokensecurity
Lihat post asal →
#04

Clickjacking & X-Frame-Options

Attacker's PageInvisible iframeopacity: 0[DELETE button]X-Frame-Options: DENY
Ulasan Matt Murphy

Your AI built your app without clickjacking protection. An attacker embedded your entire site inside an invisible iframe on their page. Your users think they are clicking a button on the attacker's site. They are actually clicking delete on your platform. Set X-Frame-Options to DENY. Add Content-Security-Policy frame-ancestors none. Test by trying to embed your own site in an iframe. If it loads, you are vulnerable. Your UI is not just your design. It is your attack surface.

Rumusan AI

Clickjacking membolehkan penyerang embed laman anda dalam iframe tersembunyi, menipu pengguna untuk klik butang berbahaya. Penyelesaian: tetapkan X-Frame-Options: DENY dan CSP frame-ancestors: none. Uji dengan cuba embed laman anda sendiri dalam iframe. Jika berjaya, anda terdedah.

clickjackingiframecspsecurity
Lihat post asal →
#05

Open Redirect: Pencurian Token OAuth

Loginredirect=evil.comAttackergets tokenWhitelist redirect URIs. Reject all else.
Ulasan Matt Murphy

Your AI built an OAuth flow with an open redirect. After login, your app sends the user wherever the redirect parameter points. An attacker crafts a link to your login page with a redirect to their server. Your user logs in. Their token goes to the attacker. Your user sees your domain and trusts the flow. They never see the theft. Lock redirect URIs to a whitelist of exact registered URLs. Reject everything else. Log every redirect attempt that fails. Your login page is the front door. The redirect is the hallway. Do not let it lead outside.

Rumusan AI

Open redirect dalam OAuth flow membolehkan penyerang mencuri token pengguna. Selepas login, jika redirect parameter tidak dikawal, token boleh dihantar ke server penyerang. Penyelesaian: whitelist URI redirect yang tepat, tolak yang lain, dan log setiap percubaan redirect yang gagal.

oauthredirectauthenticationsecurity
Lihat post asal →
#06

GraphQL Introspection: Bocor Schema

IntrospectionQueryGraphQLAPIFULLSchemaDownloadedDisable introspection in production
Ulasan Matt Murphy

Your AI shipped a GraphQL API with introspection enabled in production. An attacker sent one query and downloaded your entire schema. Every type. Every field. Every mutation. Now they know exactly what to ask for. Every internal field name. Every admin mutation you forgot to protect. Disable introspection in production. Whitelist the queries your frontend actually sends. Reject everything else. Your schema is your blueprint. Do not hand it to strangers.

Rumusan AI

GraphQL introspection yang aktif dalam production membolehkan penyerang muat turun keseluruhan schema anda. Setiap type, field, dan mutation menjadi peta untuk serangan. Matikan introspection dalam production, whitelist query yang frontend benar-benar hantar, dan tolak yang lain.

graphqlintrospectionschemasecurity
Lihat post asal →
#07

Next.js Middleware Bypass

EdgeAttackercheckBYPASSMiddleware(edge)API RouteVerify session in route handler itself
Ulasan Matt Murphy

Your AI built a Next.js middleware that checks authentication. The middleware runs on the edge. Your API routes run on the server. The middleware checks the session cookie and redirects to login. Your API route reads the same cookie and trusts the middleware already did the work. An attacker sends a request directly to the API route. The middleware never runs. The API route processes the request without authentication. Never trust a redirect. Verify the session in the route handler itself. The middleware is a convenience. The route handler is the gate.

Rumusan AI

Middleware Next.js berjalan di edge, bukan di server. Penyerang boleh bypass middleware dengan menghantar request terus ke API route. Jangan percaya redirect semata-mata; verifikasi session dalam route handler itu sendiri. Middleware adalah kemudahan, route handler adalah pintu sebenar.

nextjsmiddlewareauthenticationbypass
Lihat post asal →
#08

tRPC: Kebenaran di Hujung Jari

Userno auth?tRPCAdmin ProcEXECType safety != Permission safety
Ulasan Matt Murphy

Your AI built a tRPC router with no authorization layer. Every procedure is accessible to every authenticated user. A regular user calls the admin procedure and your server executes it. tRPC gives you type safety from the database to the frontend. It does not give you authorization. Add a middleware that checks the user role before every procedure. Separate public and admin routers. Test by calling an admin procedure with a regular user session. Type safety is not permission safety. Your types check the shape. Your code checks the person.

Rumusan AI

tRPC memberikan type safety dari database ke frontend, tetapi TIDAK memberikan authorization. Setiap procedure boleh diakses oleh semua pengguna yang login. Penyelesaian: tambah middleware yang check role pengguna sebelum setiap procedure, pisahkan router public dan admin.

trpcauthorizationmiddlewaresecurity
Lihat post asal →
#09

Email Injection via Resend

User Input+headersResendPhishingEmail SentSanitize: strip newlines, angle brackets
Ulasan Matt Murphy

Your AI built a contact form that sends email through Resend. The form takes user input and puts it directly into the email body. An attacker sends a message with email headers embedded in the text. Your email service sends those headers as real headers. The attacker uses your form to send phishing emails that appear to come from your domain. Sanitize every field before it enters an email. Strip newlines. Strip angle brackets. Validate the recipient against a whitelist. Your contact form is a mail server. Treat it like one.

Rumusan AI

Form kontak yang menghantar email melalui Resend boleh disuntik dengan header email palsu dalam input pengguna. Penyerang boleh hantar phishing email yang kelihatan dari domain anda. Sanitize setiap field: buang newline, angle brackets, dan validate penerima terhadap whitelist.

emailinjectionresendsanitization
Lihat post asal →
#10

Prisma SQL Injection

UserInput$queryRawraw SQLDatabaseUse Prisma.parameterized queries
Ulasan Matt Murphy

Your AI wrote a Prisma query that takes user input and passes it to a raw SQL call. Prisma protects you from SQL injection in its query builder. The moment you drop to Prisma.sql or $queryRaw, that protection disappears. The user input goes straight to the database. Use Prisma.parameterized queries. Never concatenate user input into a raw query string. Test by sending a quote character in every field. If your database throws a syntax error, you have injection. Prisma gives you safety. Raw queries take it away.

Rumusan AI

Prisma melindungi dari SQL injection dalam query builder, tetapi bila anda guna $queryRaw atau Prisma.sql, perlindungan itu hilang. Jangan gabungkan input pengguna dalam raw query. Gunakan parameterized queries. Uji dengan hantar quote character dalam setiap field; jika database bagi syntax error, anda ada injection.

prismasql-injectiondatabasesecurity
Lihat post asal →
#11

IDOR: URL Yang Tidak Disahkan

/api/user/15change!/16OtherUser DataUse UUIDs. Verify ownership. Trust session.
Ulasan Matt Murphy

Your API uses the user ID in the URL to load their data. Change the number. See someone else's account. Your AI built the endpoints. It never checks whether the person requesting user 15's data is actually user 15. Verify ownership on every request. Replace sequential IDs with UUIDs. Audit every endpoint that takes an ID. Your API should not trust the URL. It should trust the session.

Rumusan AI

IDOR (Insecure Direct Object Reference) berlaku bila API guna ID dalam URL untuk load data tanpa verifikasi ownership. Tukar nombor dalam URL, lihat akaun orang lain. Penyelesaian: verifikasi ownership pada setiap request, guna UUID bukan ID berjujukan, audit setiap endpoint yang ambil ID.

idorapiauthorizationuuid
Lihat post asal →
Bab 2

Keselamatan Authentication & Session

Session adalah kunci. Hilangkan kunci, hilang segala-galanya.
#12

Redis/Valkey: Keselamatan Caching

AppRedisNO AUTHAny procSet requirepass. Bind localhost. Enable TLS.
Ulasan Matt Murphy

Your AI connected your app to Redis without authentication. Any process on the network can read every cached value. Session tokens. User data. API responses stored for performance. Redis has no access control by default. Set requirepass in your Redis config. Bind to localhost or a private network. Enable TLS for data in transit. A cache is a copy of your database sitting on a faster disk. Guard it the same way.

Rumusan AI

Redis tanpa authentication membolehkan mana-mana proses dalam network baca semua cached value termasuk session token dan data pengguna. Tetapkan requirepass, bind ke localhost/private network, dan aktifkan TLS. Cache adalah salinan database yang lebih laju; jaga ia sama seperti database.

redisvalkeycachingauthentication
Lihat post asal →
#13

Redis/Upstash: Keselamatan Session

SessiontokenRedisno TTLPermanentBackdoorHard expiration. Rotate after privilege change.
Ulasan Matt Murphy

Your AI stored session data in Redis with no expiration. A session token from six months ago still opens the door. Sessions need a hard expiration. Rotate the session ID after every privilege change. Invalidate the old session when a user changes their password. Bind the session to the user agent and IP range. A session without expiration is a permanent backdoor.

Rumusan AI

Session dalam Redis tanpa expiration adalah backdoor kekal. Token dari 6 bulan lalu masih boleh buka pintu. Tetapkan expiration keras, rotate session ID selepas perubahan privilege, batalkan session lama bila password ditukar, dan bind session kepada user agent dan IP range.

redissessionexpirationsecurity
Lihat post asal →
#14

Session Fixation dalam Express

AttackerVictimsets sessionlogs inSameSession IDAttackerhas accessRegenerate session ID after login
Ulasan Matt Murphy

Your AI built a login flow in Express that does not regenerate the session ID after authentication. An attacker sets a session ID in the victim's browser before they log in. The victim authenticates. The attacker now has a valid session as that user. Regenerate the session ID after every successful login. Destroy the old session completely. The session ID before login is not the session ID after login.

Rumusan AI

Session fixation berlaku bila session ID tidak dijana semula selepas login. Penyerang set session ID dalam browser mangsa sebelum login; selepas mangsa login, penyerang guna session ID yang sama. Penyelesaian: regenerate session ID selepas setiap login berjaya dan musnahkan session lama.

expresssession-fixationloginsecurity
Lihat post asal →
#15

Password Reset Token: Tempoh Luput

ResetTokenFound inLogs/EmailAccountTakeoverExpire in minutes. Single use. Invalidate others.
Ulasan Matt Murphy

Your AI built a password reset flow where the token never expires. A user requests a reset, gets distracted, and the token is still valid three weeks later. An attacker who finds that token in an email or a log has permanent access to the account. Reset tokens need a hard expiration measured in minutes. Single use. Invalidate all other active tokens when a new one is generated. A reset token is a temporary key. Make sure it expires.

Rumusan AI

Token reset password yang tidak luput adalah bahaya keselamatan. Token perlu luput dalam minit, kegunaan tunggal, dan semua token aktif lain perlu dibatalkan bila yang baru dijana. Token reset adalah kunci sementara; pastikan ia ada tarikh luput.

password-resettokenexpirationsecurity
Lihat post asal →
#16

JWT Signature Verification (Clerk)

JWT Payloadrole:admin(editable!)Serverno verify?AdminAccess!Verify signature on every request
Ulasan Matt Murphy

Someone just promoted themselves to admin in your app by editing one field in a JWT. Your server reads the token but never verifies the signature. The payload is public. Anyone can change the claims. The signature is what makes it trustworthy. Verify the signature against your signing key on every request. Reject tokens with algorithms that do not match your configuration. A JWT without verification is just a JSON object with delusions of grandeur.

Rumusan AI

JWT tanpa verifikasi signature adalah JSON biasa. Sesiapa boleh edit payload (contoh: tukar role ke admin). Verifikasi signature terhadap signing key pada setiap request, dan tolak token dengan algorithm yang tidak sepadan. Signature adalah apa yang menjadikan JWT boleh dipercayai.

jwtsignatureclerkauthentication
Lihat post asal →
#17

NIST: Identiti Ejen AI

AgentborrowedcredsNeed:Own IDShort keysControlDirect your agents or they direct themselves
Ulasan Matt Murphy

NIST says most agents run on borrowed credentials. Every agent needs its own identity. Short-lived keys. Approval gates before production. Separate logs per session. Anthropic froze RL for a month after sandbox escapes. A director decides what agents do before they start. Direct your agents or they direct themselves.

Rumusan AI

Menurut NIST, kebanyakan ejen AI guna credentials pinjaman. Setiap ejen perlukan identiti sendiri: kunci jangka pendek, approval gates sebelum production, log berasingan per session. Anthropic menghentikan RL selama sebulan selepas sandbox escape. Kawal ejen anda atau mereka kawal anda.

nistagentsgovernanceidentity
Lihat post asal →
#18

OAuth PKCE: Lapisan Kedua

MobileCodeinterceptedPKCEBlocksSafeState stops forgery. PKCE stops interception.
Ulasan Matt Murphy

An attacker just grabbed your Google Login authorization code on a mobile network and logged in as your user. State stops forgery. It does not stop interception. PKCE does. Generate a code verifier. Hash it as the challenge. Send the original with the token request. Without PKCE, anyone on a mobile network grabs the code and logs in as your user. Direct your AI to implement both layers.

Rumusan AI

State parameter dalam OAuth menghalang forgery tetapi TIDAK menghalang interception. PKCE (Proof Key for Code Exchange) melindungi dari interception: janakan code verifier, hash sebagai challenge, hantar yang original dengan token request. Implement kedua-dua lapisan untuk keselamatan penuh.

oauthpkcemobilesecurity
Lihat post asal →
#19

Auth Token dalam localStorage

localStorageauth_tokenXSSScriptAttackerUse httpOnly cookies. JS cannot touch them.
Ulasan Matt Murphy

Your AI stored your authentication token in localStorage. Any script on your page can steal it and log in as your user. That chat widget you added can read it right now. Move tokens to httpOnly cookies JavaScript cannot touch. Short expiration with refresh rotation. Token revocation when a user's security state changes. Your auth token is the key. Stop leaving it on the counter.

Rumusan AI

localStorage boleh dibaca oleh mana-mana JavaScript di halaman anda, termasuk widget chat yang ditambah. Token authentication dalam localStorage adalah seperti meninggalkan kunci di kaunter. Pindahkan ke httpOnly cookies yang JavaScript tidak boleh sentuh, dengan expiration pendek dan refresh rotation.

localStoragehttponly-cookiexssauthentication
Lihat post asal →
#20

OAuth Redirect URI: Pintu Belakang

GoogletokenOpenRedirectAttackerServerLock redirect URIs. Enforce state. Min scope.
Ulasan Matt Murphy

You added Sign in with Google. Your AI left the redirect wide open. Someone just sent your users a login link that delivers their token to a server you have never seen. The user thinks they logged in. The attacker has their access token. Lock redirect URIs to exact registered URLs. Enforce a state parameter on every OAuth request. Scope token permissions to the minimum your app needs. Your users trust that login button. Make sure it only works for you.

Rumusan AI

Sign in with Google tanpa redirect URI yang dikawal membolehkan penyerang curi access token pengguna. Kunci redirect URI ke URL berdaftar yang tepat, wajibkan state parameter pada setiap OAuth request, dan skopkan keizinan token ke minimum yang diperlukan.

oauthgoogleredirectsecurity
Lihat post asal →
Bab 3

Keselamatan Backend & Infrastruktur

Server anda adalah benteng. Setiap retakan boleh menjadi pintu masuk.
#21

PostgreSQL Row Level Security

User AALL rowsvisible!RLS = OFFLeakEnable RLS. 4 policies per table. Scope to user.
Ulasan Matt Murphy

A user just queried your Neon database and downloaded every other user's records. Row Level Security was never turned on. Off by default in PostgreSQL. Any authenticated user queries any row. Direct your AI to enable RLS on every table. Four policies per table scoped to the user. Verify with a second account. One command. Four policies. Every table.

Rumusan AI

Row Level Security (RLS) dalam PostgreSQL dimatikan secara default. Tanpa RLS, mana-mana pengguna yang login boleh query mana-mana baris dalam database. Aktifkan RLS pada setiap table dengan 4 polisi yang diskopkan ke pengguna. Verifikasi dengan akaun kedua. Satu command, empat polisi, setiap table.

postgresqlrlsneondatabase
Lihat post asal →
#22

Next.js RSC: Data Overfetching

ServerComponentALL dataClientComponentBrowserhas allFilter on server BEFORE data crosses boundary
Ulasan Matt Murphy

Your AI built a Next.js Server Component that fetches all user data and passes it to a client component. The client component displays one field. The browser downloads everything. Every user's email. Every private field your query returned. The React DevTools extension shows the full payload. Fetch only what the component needs. Filter on the server before the data crosses the boundary. Your server component has access to everything. Your client component should not.

Rumusan AI

Next.js Server Component yang fetch semua data pengguna dan pass ke client component menyebabkan data berlebihan dihantar ke browser. Client hanya perlukan satu field, tetapi dapat semuanya termasuk email dan field peribadi. Filter di server sebelum data merentas sempadan.

nextjsrscoverfetchingdata-leak
Lihat post asal →
#23

Self-Hosted AI Stack

Your HardwareDockerPGOllamaNginxAppTailscale MeshOwn the metal. Own the stack.
Ulasan Matt Murphy

Your AI stack does not need to live on someone else's server. Ubuntu. Docker. Postgres. Ollama for local models. Nginx as a reverse proxy. Every service in its own container. Data stays on your hardware. You control the updates. You control the access. You control the logs. Self-hosting is not about saving money. It is about owning the stack that owns your business.

Rumusan AI

Stack AI self-hosted: Ubuntu + Docker + Postgres + Ollama (model lokal) + Nginx (reverse proxy). Setiap servis dalam container sendiri. Data kekal di hardware anda. Self-hosting bukan tentang jimat duit, tetapi tentang memiliki stack yang memiliki perniagaan anda.

self-hosteddockerollamainfrastructure
Lihat post asal →
#24

Email Injection: Header Injection

User Input\nBCC:evil@x.comEmailServiceInjectedHeadersStrip newlines from every field
Ulasan Matt Murphy

Your AI built a notification system that sends emails. The email body contains user input. The user input contains newline characters followed by email headers. The email service interprets those newlines as header boundaries. The attacker just added a BCC field to your notification email and sent a copy to themselves. Every field that enters an email needs newline stripping. Every recipient needs validation. Your email system is an attack surface.

Rumusan AI

Input pengguna dalam email body yang mengandungi newline boleh disuntik sebagai header email baru (BCC, CC, dll). Setiap field yang masuk ke email perlu newline stripping, setiap penerima perlu validasi. Sistem email anda adalah attack surface.

emailheader-injectionnewlinesecurity
Lihat post asal →
#25

Vercel Cron: Keselamatan Jadual

Cronpublic URLno secret?AnyoneProtect with secret header. Verify in handler.
Ulasan Matt Murphy

Your AI built a Vercel cron job that runs every hour. The endpoint is a public URL. Anyone who discovers it can trigger it manually. Your cron job processes payments, sends emails, or modifies data. An attacker hits the URL fifty times and your billing runs fifty times. Protect cron endpoints with a secret header. Verify the header in the handler. Reject requests without it. Your cron schedule is not security. The endpoint is still public.

Rumusan AI

Vercel cron jobs mempunyai URL public yang boleh ditemui dan dicetuskan oleh sesiapa. Lindungi endpoint cron dengan secret header yang perlu diverifikasi dalam handler. Tolak request tanpa header tersebut. Jadual cron bukan keselamatan; endpoint masih public.

vercelcronsecret-headersecurity
Lihat post asal →
#26

Convex: Kebocoran Data Realtime

ServerALL datastreamClientfilter?Too late!Already sentFilter on server BEFORE sending. Realtime != skip auth.
Ulasan Matt Murphy

Your AI built a Convex query that streams data to the frontend in realtime. The query returns every record in the table. The frontend filters to show only the current user's records. The browser has already downloaded everyone's data. The filter happens after the download. Filter on the server before the data is sent. The client should never receive data it is not authorized to see. Realtime is not an excuse to skip authorization.

Rumusan AI

Convex query yang stream data realtime boleh bocor jika filter dibuat di client. Browser sudah download semua data sebelum filter. Filter di server SEBELUM data dihantar. Client tidak sepatutnya terima data yang tidak dibenarkan. Realtime bukan alasan untuk skip authorization.

convexrealtimedata-leakauthorization
Lihat post asal →
#27

Zod: Validasi di Server

ClientZod OKServertrusts?ATTACKServer ZodVALIDATEClient is convenience. Server is the gate.
Ulasan Matt Murphy

Your AI built a form with Zod validation on the client. The form validates the input before sending it to the server. The server trusts the client already validated. An attacker sends a request directly to your API with malicious input. Zod on the client does not protect the server. Run the same Zod schema on the server. Validate every field. Reject everything that does not match. The client is a convenience. The server is the gate.

Rumusan AI

Zod validation di client TIDAK melindungi server. Penyerang boleh hantar request terus ke API tanpa validasi client. Jalankan schema Zod yang sama di server. Validasi setiap field, tolak yang tidak sepadan. Client adalah kemudahan, server adalah pintu.

zodvalidationserver-sidesecurity
Lihat post asal →
#28

Webhook Idempotency

Event 1Event 1(duplicate)Handler2x charge!DoublebillingCheck event ID. Store processed IDs. Idempotent.
Ulasan Matt Murphy

Your AI built a webhook handler that processes every request it receives. Stripe sends the same event twice during a network retry. Your server processes both. The user gets charged twice. The product gets provisioned twice. Your database now has duplicate records. Extract the event ID from the webhook payload. Check if you have already processed it before doing anything. Store processed event IDs. Idempotency is not optional when money is involved.

Rumusan AI

Webhook handler yang proses setiap request boleh menyebabkan duplikasi bila servis hantar event yang sama dua kali (network retry). Pengguna dicaj dua kali, produk disediakan dua kali. Ekstrak event ID, check jika sudah diproses, simpan ID yang sudah diproses. Idempotency wajib bila melibatkan wang.

webhookidempotencystripebilling
Lihat post asal →
#29

Firebase Admin SDK: Privilege Escalation

User Input(malicious)Cloud Func+ Admin SDKBypassall rules!Validate input. Scope queries. Audit the gap.
Ulasan Matt Murphy

Your AI built Firebase Cloud Functions with the Admin SDK. The Admin SDK bypasses every security rule in your database. Your function takes user input and executes it with full admin privileges. Validate every input before it hits the database. Scope every query to the authenticated user. Audit the gap between what your functions can access and what they should. Your rules stop at the client. Your functions have no rules at all.

Rumusan AI

Firebase Admin SDK bypass semua security rules dalam database. Cloud Function yang guna Admin SDK dengan input pengguna bermaksud pelaksanaan privilege penuh. Validasi setiap input, skopkan setiap query ke pengguna yang login, audit gap antara apa yang fungsi boleh akses vs sepatutnya.

firebaseadmin-sdkcloud-functionsprivilege
Lihat post asal →
#30

Next.js Credential Leak ke Client

Server ActionDB_CREDSLEAK!BuildProcessClientBundleInstall server-only. Separate files. Scan builds.
Ulasan Matt Murphy

Your AI put your database credentials in a Next.js Server Action. The build process shipped them to every user's browser. Your AI mixed server logic and client components in the same file. Next.js included your connection string in the client bundle. Install server-only to block it. Separate server and client files. Scan your production build for leaked secrets. Your server functions run on the server. Your credentials should stay there.

Rumusan AI

Database credentials dalam Next.js Server Action boleh terhantar ke browser pengguna jika server logic dan client component bercampur dalam fail yang sama. Install server-only untuk menghalang, pisahkan fail server dan client, scan production build untuk rahsia yang bocor.

nextjscredentialsserver-onlyleak
Lihat post asal →
#31

Error Message: Kebocoran Maklumat

BrokenLinkDB_NAME/srv/pathSQL queryAttackerCustom error pages. Log to backend, not screen.
Ulasan Matt Murphy

Your app just showed a user your database name, your server file path, and the query that failed. They were not trying to hack you. They clicked a broken link. Your AI built error handling for development and you shipped it to production. Database name. Table structure. The ORM you are using. Separate error responses by environment. Route every error to logging, not the screen. Build custom error pages that reveal nothing. Your users found a bug. Do not let the bug report write itself.

Rumusan AI

Error message yang memaparkan nama database, path server, dan query yang gagal memberi peta kepada penyerang. Error handling development yang shipped ke production mendedahkan struktur dalaman. Pisahkan error response mengikut environment, halakan ke logging bukan skrin, bina custom error pages yang tidak mendedahkan apa-apa.

error-handlinginformation-leakproductionsecurity
Lihat post asal →
Bab 4

Keselamatan Pembayaran & Data

Wang dan data: dua perkara yang tidak boleh dipulangkan jika hilang.
#32

Stripe Checkout: Manipulasi Harga

Frontend$1 → $99StripeServerPrice IDCreate sessions server-side. Use Price IDs. Verify webhooks.
Ulasan Matt Murphy

Your AI built your Stripe checkout. The price lives in your frontend. Change it to one dollar. Stripe will process it. Your server never validates the amount against your product pricing. Create sessions server-side with database prices. Use Stripe Price IDs. Verify payment with webhooks before provisioning access. Your checkout page is not your pricing. Your server is.

Rumusan AI

Harga di frontend boleh diubah oleh pengguna. Jika server tidak validate amount terhadap harga produk, Stripe akan proses harga yang diubah. Buat session di server-side dengan harga dari database, guna Stripe Price IDs, verifikasi payment dengan webhook sebelum sediakan akses.

stripecheckoutprice-manipulationserver-side
Lihat post asal →
#33

Model Routing: Kos & Keselamatan

RequestRouterSimple →Complex →Small $Large $$$70% cost reduction. Same answer, faster.
Ulasan Matt Murphy

Your AI routes every request to the most expensive model. Simple classification tasks use a model designed for reasoning chains. You are paying for intelligence your task does not need. Route requests by complexity. Simple tasks to small models. Complex reasoning to large models. Your bill drops by seventy percent. The user gets the same answer faster. Model routing is not a luxury. It is how you survive the first thousand users.

Rumusan AI

Menghantar setiap request ke model paling mahal adalah pembaziran. Tugas klasifikasi mudah tidak perlukan model reasoning besar. Route request mengikut kerumitan: tugas mudah ke model kecil, reasoning kompleks ke model besar. Bill turun 70%, pengguna dapat jawapan sama dengan lebih laju.

model-routingcost-optimizationaiefficiency
Lihat post asal →
#34

Prompt Theft Detection (OAST)

Attacker"repeat instructions"SystemPromptCANARYBLOCKCanary tokens detect extraction. Log & block.
Ulasan Matt Murphy

Someone just extracted your system prompt by asking your AI to repeat its instructions. Your AI answered. Your entire instruction set is now in their hands. They know every rule, every constraint, every workaround you built. OAST embeds canary tokens in your system prompt. When those tokens appear in an output, you know extraction is happening. Log the request. Block the response. Your system prompt is intellectual property. Guard it like code.

Rumusan AI

Prompt theft berlaku bila seseorang minta AI anda ulang arahan sistem. OAST (Out-of-band Application Security Testing) embed canary tokens dalam system prompt. Bila token muncul dalam output, anda tahu extraction sedang berlaku. Log request, block response. System prompt adalah harta intelek; jaga seperti kod.

prompt-theftoastsystem-promptsecurity
Lihat post asal →
#35

Mass Assignment: CodeRabbit vs Serangan

RequestisAdmin:trueAPIHandlerno whitelist?DB WriteWhitelist fields. Separate endpoints. Test attacks.
Ulasan Matt Murphy

CodeRabbit reviewed your code and found zero issues. Your API endpoint still accepts every field in the request body. A user sends isAdmin true and your server writes it to the database. Your AI wrote an update handler that passes the full request body to the database. Whitelist allowed fields. Separate user and admin endpoints. Test by sending fields that should be rejected. CodeRabbit reviews code. Not attack surface.

Rumusan AI

Code review automatik seperti CodeRabbit review kod, bukan attack surface. Mass assignment vulnerability berlaku bila API terima semua field dari request body tanpa tapis. Whitelist field yang dibenarkan, pisahkan endpoint user dan admin, uji dengan hantar field yang sepatutnya ditolak.

mass-assignmentcoderabbitwhitelistsecurity
Lihat post asal →
Bab 5

Pematuhan & Enterprise

Compliance bukan halangan. Ia adalah bukti bahawa anda membina dengan betul.
#36

M365 Zero Trust & Entra ID

Device(compromised)Entra IDHealth?Risk?Context?AccessNo device trusted. No network trusted. Every request earns access.
Ulasan Matt Murphy

Your AI built your auth on top of a Microsoft 365 tenant that trusts every device on the network. A compromised laptop has access to every resource. Zero Trust means verify every request regardless of where it originates. Entra ID conditional access policies check device health, user risk, and sign-in context before granting access. No device is trusted by default. No network is trusted by default. Every request earns access.

Rumusan AI

Zero Trust bermaksud verifikasi setiap request tanpa kira dari mana ia datang. Entra ID conditional access memeriksa kesihatan peranti, risiko pengguna, dan konteks sign-in sebelum memberi akses. Tiada peranti atau network yang dipercayai secara default. Setiap request perlu peroleh akses.

zero-trustentra-idm365conditional-access
Lihat post asal →
#37

Compliance Automation untuk Startup

Access LogPolicy RevVendor AsmtAIEvidenceAuditorCompliance is evidence collected over time
Ulasan Matt Murphy

Your startup needs SOC 2 to close enterprise deals. Your AI cannot file your audit. Compliance is evidence collected over time, not a checkbox. Automate the evidence collection. Log every access request. Screenshot every policy review. Track every vendor assessment. The auditor verifies your process. Your process needs to be real. Direct your AI to build the evidence pipeline. The audit is just the final step.

Rumusan AI

SOC 2 compliance untuk startup bukan checkbox tetapi bukti yang dikumpul sepanjang masa. Automatkan pengumpulan bukti: log setiap access request, screenshot setiap policy review, track setiap vendor assessment. Auditor verifikasi proses anda. Proses perlu nyata, bukan lakonan.

soc2compliancestartupautomation
Lihat post asal →
#38

Enterprise AI Ownership (Latham & Watkins)

Firmowns allAI Model3rd partyNO retainOutputData ownership is not a feature. It is the deal.
Ulasan Matt Murphy

Latham & Watkins published their AI usage data. Inside counsel used AI for research and drafting. The firm kept ownership of every output. Every prompt. Every response. No third-party model retained the data. Enterprise customers do not rent their intelligence. They own it. When you build for enterprise, data ownership is not a feature. It is the deal.

Rumusan AI

Latham & Watkins menunjukkan model enterprise AI yang betul: firma milik setiap output, prompt, dan response. Model pihak ketiga tidak menyimpan data. Untuk pelanggan enterprise, kepemilikan data bukan ciri tambahan; ia adalah syarat perjanjian. Bila membina untuk enterprise, data ownership adalah segalanya.

enterpriseai-ownershipdatalegal
Lihat post asal →
#39

SOC 2 Compliance dengan AI (Vanta)

AI draftsVanta collectsAuditor reviewsSOC 2EvidenceCERTThree layers work together. Compliance is a system.
Ulasan Matt Murphy

Your startup wants SOC 2 certification. Vanta automates the evidence collection. Continuous monitoring of your cloud infrastructure. Automated policy templates. Vendor risk assessments tracked in one dashboard. Your AI can draft the policies. Vanta collects the proof. The auditor reviews the evidence. The three layers work together. Compliance is not a sprint. It is a system.

Rumusan AI

Vanta mengautomasikan pengumpulan bukti SOC 2: pemantauan berterusan infrastruktur cloud, template polisi automatik, penilaian risiko vendor dalam satu dashboard. AI boleh draf polisi, Vanta kumpul bukti, auditor review. Pematuhan bukan pecut; ia adalah sistem.

soc2vantacomplianceautomation
Lihat post asal →
#40

Doctor HIPAA System (Pakistan)

DoctorPKHIPAAEncrypt at restEncrypt in transitAudit trailsClinicProduction software is not shipped. It is delivered.
Ulasan Matt Murphy

A doctor in Pakistan built a patient management system for a small clinic. HIPAA compliance was not optional. The clinic handled patient records. Every field needed encryption at rest and in transit. Access logs for every query. Audit trails that showed who accessed what and when. The doctor directed the AI through every compliance requirement. The AI built the system. The doctor verified every regulation. Production software is not shipped. It is delivered.

Rumusan AI

Doktor di Pakistan bina sistem pengurusan pesakit yang perlu patuh HIPAA. Setiap field perlu enkripsi at rest dan in transit, log akses untuk setiap query, audit trail yang tunjuk siapa akses apa dan bila. AI bina sistem, doktor verifikasi setiap regulasi. Perisian produksi bukan "shipped" tetapi "delivered."

hipaahealthcarecomplianceencryption
Lihat post asal →
Bab 6

Falsafah Builder & AI Industry

AI membina apa sahaja. Soalnya: adakah sesiapa yang mahu?
#41

Hardware & Mac Studio: Self-Hosted

Mac StudioModelsDBBuildMonitorNginxTailscale MeshNo cloud bill. No vendor lock-in. Own the metal.
Ulasan Matt Murphy

My Mac Studio runs fourteen services. Local models. Databases. Build servers. Monitoring. Everything behind a Tailscale mesh. No cloud bill. No vendor lock-in. The hardware pays for itself in three months. Self-hosting is not nostalgia. It is infrastructure ownership. When the cloud provider changes pricing, your hardware does not care. When the API goes down, your local stack keeps running. Own the metal.

Rumusan AI

Mac Studio boleh jalankan 14 servis: model lokal, database, build server, monitoring. Semua di belakang Tailscale mesh. Tiada cloud bill, tiada vendor lock-in. Hardware bayar sendiri dalam 3 bulan. Bila harga cloud berubah, hardware anda tidak peduli. Bila API turun, stack lokal terus jalan. Miliki hardware anda.

mac-studioself-hostedtailscaleinfrastructure
Lihat post asal →
#42

AI Industry: IPO & Regulatory Capture

AI Co. A$$$BAI Co. B$$$BAI Co. C$$$BValuation ≠ RevenueRegulated write the rules = market captureBuilders ship real products. Rest wear tech hoodies.
Ulasan Matt Murphy

Three AI companies filed for IPO in the same quarter. Combined valuation: more than most defense contractors. The revenue does not match the valuation. The regulatory environment is being shaped by the same companies that are being regulated. When the regulated write the rules, that is not governance. That is market capture. The builders who ship real products to real users will survive the correction. The rest are financial instruments wearing a tech hoodie.

Rumusan AI

Tiga syarikat AI fail IPO dalam suku yang sama dengan valuasi gergasi yang tidak sepadan dengan pendapatan. Persekitaran regulasi dibentuk oleh syarikat yang sama yang sedang dikawal selia. Pembina yang hantar produk sebenar ke pengguna sebenar akan selamat dari pembetulan. Yang lain adalah instrumen kewangan yang pakai hoodie tech.

ai-industryiporegulatory-capturemarket
Lihat post asal →
#43

AI Dopamine Addiction

Dashboardrefreshevery 15 mindopamineOptimizescoreboardNOT the workBuild the product. Close the dashboard. Ship.
Ulasan Matt Murphy

You check your AI dashboard every fifteen minutes. New deployment. New user. New revenue number. The dopamine hit is real and it is by design. You are optimizing for the metric that refreshes, not the metric that matters. Build the product. Close the dashboard. Ship the update. The numbers will be there when you look. Your attention is the scarcest resource you have. Spend it on the work, not the scoreboard.

Rumusan AI

Memeriksa dashboard AI setiap 15 minit adalah ketagihan dopamine yang direka bentuk. Anda optimize untuk metrik yang refresh, bukan yang penting. Bina produk, tutup dashboard, hantar update. Angka akan ada bila anda lihat. Perhatian anda adalah sumber paling terhad; belanjakan pada kerja, bukan papan skor.

dopaminefocusproductivitybuilder
Lihat post asal →
#44

AI Safety sebagai Strategi Perniagaan

Incumbent"safety"= lock-outBarrierto entryStartupblockedReal safety protects users. Capture protects market share.
Ulasan Matt Murphy

The AI safety conversation is not about ethics. It is about monopoly. The companies that can afford to slow down are the ones that want regulation to prevent competition. Safety is the moat. Compliance is the barrier to entry. The startup that cannot afford the compliance team cannot ship. The incumbent calls it responsibility. The builder calls it a lock-out. Real safety protects users. Regulatory capture protects market share. Know the difference.

Rumusan AI

Perbincangan AI safety bukan sekadar etika; ia tentang monopoli. Syarikat besar yang mampu perlahan mahu regulasi menghalang persaingan. Safety sebagai moat, compliance sebagai halangan masuk. Startup yang tidak mampu compliance team tidak boleh ship. Keselamatan sebenar lindungi pengguna; regulatory capture lindungi market share.

ai-safetymonopolyregulationcompetition
Lihat post asal →
#45

32% Syarikat Membina dengan AI

12%18mo ago22%32%nowVerticaladoptionTechnology ready. Are you?
Ulasan Matt Murphy

McKinsey reports that 32 percent of companies are actively building with AI. That number was 12 percent eighteen months ago. The adoption curve is vertical. The companies that are not building are falling behind. The gap is not technical. It is organizational. The teams that move are the ones that decided to move. The technology is ready. The question is whether you are.

Rumusan AI

McKinsey melaporkan 32% syarikat aktif membina dengan AI, naik dari 12% 18 bulan lalu. Keluk penerimaan adalah menegak. Jurang bukan teknikal tetapi organisasi. Pasukan yang bergerak adalah yang memutuskan untuk bergerak. Teknologi sudah siap; soalnya adakah anda sedia.

mckinseyadoptionenterpriseai
Lihat post asal →
#46

Product Development dari Data Pengguna

ObserveHypothesizeBuildMeasureStart with data. Product tells you what it needs.
Ulasan Matt Murphy

Your analytics show which features are used. Your support tickets show which features confuse people. Your churn data shows which features drive people away. The closed loop is: observe, hypothesize, build, measure, repeat. Most teams skip the observe step. They build what they think users want and then look for data that confirms it. Start with the data. The product is already telling you what it needs to be.

Rumusan AI

Analytics tunjuk ciri yang digunakan, support tickets tunjuk ciri yang mengelirukan, churn data tunjuk ciri yang halau pengguna. Loop tertutup: perhatikan, hipotesis, bina, ukur, ulang. Kebanyakan pasukan skip langkah perhatikan. Mulakan dengan data; produk sudah memberitahu apa yang perlu jadi.

productanalyticsdata-drivenfeedback-loop
Lihat post asal →
#47

Kredibiliti AI Builder

Portfoliosite≠DeployedWork= CredibilityWINSpecialization beats generalization. Show up prepared.
Ulasan Matt Murphy

You want to be an AI builder. You are going to have to sell against me. Not gatekeeping. I am in the market every day. Thousands of systems deployed. Millions of users served. When a project goes sideways, that call comes to my desk. Credibility is deployed work, not a portfolio site. The builder who cleans up the mess wins the market. Specialization beats generalization. Show up prepared.

Rumusan AI

Kredibiliti datang dari kerja yang di-deploy, bukan laman portfolio. Matt ada ribuan sistem deployed dan jutaan pengguna dilayani. Pembina yang bersihkan kucar-kacir menang pasaran. Pengkhususan mengalahkan generalisasi. Hadir bersedia. Jika mahu jadi AI builder, anda perlu jual menentang yang sudah ada.

credibilitybuilderspecializationmarket
Lihat post asal →
#48

Distribution: Moat Baru

Prod AProd BProd C$0200 clonesSameModelsDistribution= Moat1 product at 5% beats 10 at zero.
Ulasan Matt Murphy

Your AI shipped three products this quarter. Combined revenue: zero. Two hundred other builders shipped the same thing the same week. AI collapsed build time to hours. Everyone has the same models. The gap is no longer who can build. It is who builds something someone pays for. Distribution is the new moat. One product at 5% beats ten at zero. Your AI builds anything. The question is whether anyone asked for it.

Rumusan AI

AI meruntuhkan masa binaan ke beberapa jam. Semua orang ada model yang sama. Jurang bukan siapa yang boleh bina, tetapi siapa yang bina sesuatu yang orang bayar. Distribution adalah moat baru. Satu produk pada 5% mengalahkan sepuluh pada sifar. AI anda boleh bina apa sahaja; soalnya: adakah sesiapa yang minta?

distributionmoatproduct-market-fitrevenue
Lihat post asal →
#49

Local Business Scheduling

SalonContractorDentist$200/mobad UXYourSystemEveryOperatorBuild for one. Sell to every operator in your market.
Ulasan Matt Murphy

Every business within five miles of you has a scheduling problem they are paying someone else to solve badly. The salon is paying $200 a month for a platform that cannot handle walk-ins. The contractor has software that ignores drive time. The dentist has a receptionist spending four hours confirming appointments a text message could handle. You do not need to build a platform. Build a system for one operator. Then sell it to every operator in your market. Stop paying for software that was built for everyone and works for no one.

Rumusan AI

Setiap perniagaan dalam 5 batu dari anda ada masalah penjadualan yang mereka bayar untuk penyelesaian buruk. Salon bayar $200/bulan untuk platform yang tidak handle walk-in. Kontraktor ada software yang abaikan masa memandu. Jangan bina platform; bina sistem untuk satu operator, kemudian jual ke setiap operator dalam pasaran anda. Berhenti bayar untuk software yang dibina untuk semua tetapi berfungsi untuk tiada siapa.

local-businessschedulingsaasoperator
Lihat post asal →
#50

Gen X dalam Era AI

Gen X30 yearsoperationaldepthDomainExpertConsultPick one system you rent. Build the replacement. First sale.
Ulasan Matt Murphy

They call me grandpa AI in the comments. Then they copy every prompt I post. Gen X adapted to every platform shift and every technology that was supposed to replace us. Now we are sitting on thirty years of operational depth no cursor subscription can replicate. Gen X owns the businesses AI is about to transform. Gen X domain experts are repositioning as consultants. Pick one system you are renting. Build the replacement. That is your proof of concept and your first sale. The next ten years belong to this generation.

Rumusan AI

Gen X adaptasi setiap peralihan platform dan teknologi. 30 tahun kedalaman operasi yang tidak boleh diganti oleh langganan Cursor. Gen X milik perniagaan yang AI akan transformasikan. Pakar domain Gen X reposisi sebagai perunding. Pilih satu sistem yang anda sewa, bina pengganti. Itu proof of concept dan jualan pertama anda. 10 tahun akan datang milik generasi ini.

genxoperatorsconsultantsexperience
Lihat post asal →
#51

LLM Bukan untuk Use Case Anda

LLM95%+ 5% halluc.need 99%Classifier99%+Faster+CheaperLLMs are generalists. Your task is specific. Use the right tool.
Ulasan Matt Murphy

You are building a classification system with a large language model. Your task needs ninety-nine percent accuracy. The LLM gives you ninety-five percent and hallucinates the other five percent with complete confidence. You do not need a language model. You need a classifier. Train a small model on your labeled data. It will be faster, cheaper, and more accurate. LLMs are generalists. Your task is specific. Use the right tool.

Rumusan AI

Jika tugas anda perlukan 99% ketepatan (seperti klasifikasi), LLM hanya beri 95% dan hallucinate 5% dengan yakin penuh. Anda tidak perlukan language model; anda perlukan classifier. Latih model kecil pada data berlabel anda. Ia lebih laju, murah, dan tepat. LLM adalah generalis; tugas anda spesifik. Guna alat yang betul.

llmclassifieruse-casemodel-selection
Lihat post asal →
#52

AI vs Kurikulum: Peperiksaan

AI passesthe exam✓BUTCannotmanagethe clientGap!Curriculum is a proxy. The skill is the work. Build the skill.
Ulasan Matt Murphy

The argument that AI cannot pass professional exams is over. It can. The argument that was always interesting is whether the exam tests the skill that matters. A bar exam tests memorization and issue spotting. Practice tests judgment and client management. The AI passes the exam. It cannot manage the client. The curriculum is a proxy. The skill is the work. Build the skill. The exam is just the door.

Rumusan AI

Hujah bahawa AI tidak boleh lulus peperiksaan profesional sudah selesai. Ia boleh. Hujah yang menarik: adakah peperiksaan menguji kemahiran yang penting? Peperiksaan bar uji hafalan dan issue spotting. Amalan uji pertimbangan dan pengurusan klien. AI lulus peperiksaan tetapi tidak boleh urus klien. Kurikulum adalah proksi; kemahiran adalah kerja sebenar.

aicurriculumexamsskills
Lihat post asal →