{"id":50007,"date":"2026-11-04T17:00:14","date_gmt":"2026-11-04T11:30:14","guid":{"rendered":"https:\/\/www.getastra.com\/blog\/?p=50007"},"modified":"2026-11-04T17:00:17","modified_gmt":"2026-11-04T11:30:17","slug":"vibe-coding-prompts","status":"publish","type":"post","link":"https:\/\/www.getastra.com\/blog\/ai-security\/vibe-coding-prompts\/","title":{"rendered":"Vibe Coding Prompts: What Makes Them More Secure"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Analyzing secure vibe coding prompts is crucial as AI adoption grows. In our <a href=\"https:\/\/www.getastra.com\/reports\/vibe-coding-security-risks-study\">vibe coding security risk study<\/a>, Emergent, Replit, Lovable, and Base44 each built a working app from the same vibe coding prompt, and Astra&#8217;s autonomous pentest agents confirmed 137 vulnerabilities across the four of them, with the same nine weak points giving out again and again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If these tools build what you ask for, the obvious follow-up is what happens when you ask for something different. Section 9 of the report is that different ask: a hardened build prompt rewritten line by line against the findings. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This post covers how the hardened version differs, which findings the study&#8217;s own data traces back to the prompt, and where vibe coding prompts stop helping you achieve secure vibe coding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_the_original_prompt_asked_for\"><\/span>What the original prompt asked for<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The original prompt was not naive. It named real controls, including bcrypt hashing with a cost factor of at least 12, 15-minute access tokens, and parameterized queries only. When the prompt was that specific, the builds largely held, and SQL injection didn&#8217;t appear among the nine shared weak points.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Other lines stayed general, and those are the ones that gave out. &#8220;CORS enabled for mobile clients&#8221; says nothing about which origins to allow, and &#8220;rate limiting on auth endpoints&#8221; names a mechanism without a threshold. The report found that each of the five weak points in all four apps traces to a security requirement missing from the prompt or stated only in general terms. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The tools read those lines as feature requests and built the feature, which is why the report warns against assuming a platform knows what &#8220;secure login&#8221; means.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Writing_secure_vibe_coding_prompts_What_we_changed\"><\/span>Writing secure vibe coding prompts: What we changed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The rewrite followed one rule, which was to replace every adjective with a number or a named control. Vibe coding prompt engineering here came down to editing. A <a href=\"https:\/\/www.getastra.com\/reports\/vibe-coding-security-risks-study\">good vibe coding prompt template<\/a> reads like a spec, and each line names something a tester can check.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here are three vibe coding prompt examples, before and after, condensed from the report.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Before: <\/strong>CORS enabled for mobile clients.<\/li>\n\n\n\n<li><strong>After: <\/strong>Accept requests only from an explicit allowlist of origins. Never reflect the request Origin header, and never combine a wildcard with credentials.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Before: <\/strong>Rate limiting on auth endpoints.<\/li>\n\n\n\n<li><strong>After: <\/strong>Max 5 failed login attempts per account per 15 minutes, 10 per IP per hour. Return HTTP 429 with a Retry-After header.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Before: <\/strong>(nothing about a default)<\/li>\n\n\n\n<li><strong>After: <\/strong>Every endpoint requires an authenticated session by default. Public endpoints are a named list. Write a test that calls every other route and expects a 401.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Each &#8220;after&#8221; line gives the tool something to build and gives you something to test.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_the_hardened_prompt_closes\"><\/span>What the hardened prompt closes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The five universal weak points account for 66 of the 137 confirmed findings, with CORS misconfiguration alone the most common category in the dataset at 16 confirmed instances. The report classifies all five as low-complexity, config-level fixes with a single root cause: a prompt that under-specified a known control, and calls a more specific prompt a direct fix.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1875\" height=\"1172\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/c4a13847-02-universal-failures.png\" alt=\"Universal failures\" class=\"wp-image-49941\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Count the severity before counting the findings, though. Those 66 sit mostly at Medium and Low. All 13 Critical findings in the study cluster in authentication and authorisation on a single app, and most of the 14 High findings are broken access control. The hardened prompt closes the broadest category of findings, while the most severe category lives elsewhere.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_a_better_prompt_cant_fix\"><\/span>What a better prompt can&#8217;t fix<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The other four weak points, i.e., the 39 confirmed findings across JWT session handling, broken access control, token storage, and user enumeration, each appeared in three of the four apps and come from platform implementation choices. Some of their fixes reach into the data layer or the token lifecycle, where one prompt line no longer maps to one setting.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1536\" height=\"1024\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/78e52d8a-astra-cross-cutting-patterns-radar.png\" alt=\"\" class=\"wp-image-50008\" srcset=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/78e52d8a-astra-cross-cutting-patterns-radar.png 1536w, \/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/78e52d8a-astra-cross-cutting-patterns-radar.png 345w\" sizes=\"auto, (max-width: 1536px) 100vw, 1536px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Access control makes the limit concrete. The original prompt spelled out a four-tier role model with per-endpoint scopes, and one app still shipped admin actions reachable without any login. As the report puts it, &#8220;an explicit instruction was not the same as an enforced one.&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You also can&#8217;t prompt your way to knowing whether the prompt worked, because the only check is to test the running app. A rough version takes ten minutes. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1199\" height=\"1312\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/b2b8a975-astra-universal-security-checklist.png\" alt=\"\" class=\"wp-image-49954\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Log in eight times with the wrong password and confirm a 429 appears around attempt six; check any response in DevTools for a <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Headers\/Content-Security-Policy\" target=\"_blank\" rel=\"noopener\">Content-Security-Policy header<\/a>; then reset a password with a fake email and a real one and confirm the response, wording, and timing match either way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Final_thoughts\"><\/span>Final thoughts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Vibe coding tools build what you ask for and miss what you forgot to ask. Writing your vibe coding prompts like a spec is a cheap fix that closes real ground, since nearly half the confirmed findings in the study trace back to under-specified prompt lines, and it is where secure vibe coding starts. The full report ships the hardened prompt in Section 9, ready to paste before your first feature request.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"933\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/10\/35631463-scr-20260420-ltjq.png\" alt=\"Astra autonomous pentesting let the agents loose\" class=\"wp-image-49217\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For everything a prompt can&#8217;t reach, Astra&#8217;s autonomous pentest tests the running app the way an attacker would. The numbers behind every pattern are in the full <a href=\"https:\/\/www.getastra.com\/reports\/vibe-coding-security-risks-study\">Vibe Coding Security Risks Study<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Analyzing secure vibe coding prompts is crucial as AI adoption grows. In our vibe coding security risk study, Emergent, Replit, Lovable, and Base44 each built a working app from the same vibe coding prompt, and Astra&#8217;s autonomous pentest agents confirmed 137 vulnerabilities across the four of them, with the same nine weak points giving out &#8230; <a title=\"Vibe Coding Prompts: What Makes Them More Secure\" class=\"read-more\" href=\"https:\/\/www.getastra.com\/blog\/ai-security\/vibe-coding-prompts\/\" aria-label=\"Read more about Vibe Coding Prompts: What Makes Them More Secure\">Read more<\/a><\/p>\n","protected":false},"author":100,"featured_media":50009,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[761],"tags":[],"class_list":["post-50007","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-security"],"_links":{"self":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50007","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/users\/100"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/comments?post=50007"}],"version-history":[{"count":2,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50007\/revisions"}],"predecessor-version":[{"id":50019,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50007\/revisions\/50019"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media\/50009"}],"wp:attachment":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media?parent=50007"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/categories?post=50007"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/tags?post=50007"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}