חינם · 3 פרומפטים מלאים

הפרומפט המאובטח —
0 פרצות בקוד ש-AI כותב לך

שמונה מתוך 10 אפליקציות AI שבדקתי היו פרוצות — באותן 3 שורות בדיוק. הפרומפט הזה הוא מה שאני שולח לקלוד לפני כל בקשת קוד. מאז שאני משתמש בו: אפס פרצות. דקה הקמה, שלושה בלוקים, ואחרי זה הקוד מוגן כברירת מחדל.

3 פרומפטים מוכנים
10 כללי אבטחה
0 פרצות
קח את הפרומפטים ↓ מה זה מונע

מה יש בפנים

3 פרומפטים שמתחברים לוורקפלו אבטחה אחד. כל אחד מהם פותר חלק שונה.

1

הוראות פרויקט אבטחה

מגדירים לקלוד את 10 כללי האבטחה שהוא חייב להחיל אוטומטית בכל קוד שהוא כותב לך.

2

פתיח לבקשת קוד

שורה אחת שמדביקים לפני כל בקשת קוד — מאלצת את קלוד למפות פרצות לפני הקוד עצמו.

3

פרומפט אודיט

בודק קוד קיים. סורק את 8 הפרצות הנפוצות ומחזיר רשימה מסודרת עם תיקונים.

מה הפרומפט מונע

XSS · אקס.אס.אס

הזרקת קוד דרך קלט משתמש

dangerouslySetInnerHTML עם תוכן לא מסונן. הפרומפט מאלץ סניטייז של כל HTML ממשתמש.

SQL Injection

הזרקה דרך שאילתות

סטרינג קונקטנציה ב-SQL. הפרומפט אוסר על זה לחלוטין — תמיד פאראמטרייזד קוויריז.

Token Theft

גניבת אסימוני התחברות

localStorage לאסימוני התחברות = פתח רחב ל-XSS. הפרומפט דוחף לcookies עם דגלי httpOnly.

Secrets Leak

חשיפת מפתחות ב-Frontend

API keys בקוד הקליינט. הפרומפט פוסל את זה ושולח אותם ל-environment variables בשרת.

Authorization

אמון בלקוח על זהות משתמש

שימוש ב-userId שהקליינט שלח. הפרומפט מאלץ ולידציה מחדש בשרת לכל פעולה.

Rate Limiting

חוסר הגבלות על אנדפוינטים

אנדפוינטים פתוחים לעולם בלי הגבלה. הפרומפט מוסיף מידלוור עובד, לא TODO.

הפרומפטים

לחצו "Copy" בכל בלוק והדביקו לקלוד. סדר השימוש: הוראות פרויקט (חד-פעמי) → פתיח (לפני כל בקשה) → אודיט (לבדיקת קוד קיים).

01

הוראות פרויקט אבטחה

איך משתמשים: פותחים פרויקט חדש בקלוד (claude.ai → New Project). מדביקים את הפרומפט הזה לתוך שדה ה-Instructions. זה הופך כל בקשת קוד עתידית לבטוחה כברירת מחדל.
You are my secure code generation partner. I am building applications with you and I do not always read the code carefully. Your job is to make sure that even when I don't catch it, the code you produce is secure by default.

# Security defaults (always apply, never ask)

1. **User input is hostile.** Treat every input from a user, query string, request body, or external API as potentially malicious. Validate, sanitize, and parameterize.

2. **Never use string concatenation for SQL queries.** Always use parameterized queries / prepared statements. If the language doesn't support it, flag it explicitly.

3. **Never use `dangerouslySetInnerHTML` (or equivalent raw-HTML rendering) without a sanitizer.** If user content needs to be rendered as HTML, use sanitize-html, DOMPurify, or equivalent. If you can avoid rendering raw HTML entirely, do that instead.

4. **Never store auth tokens in localStorage or sessionStorage.** Use httpOnly cookies with Secure and SameSite=Strict flags. The browser sends them automatically; JavaScript cannot read them.

5. **Never expose secrets to the client.** API keys, database credentials, and signing secrets must be in server-side environment variables only. If I ask for code that does this insecurely, refuse and explain why.

6. **Never trust user IDs from the client for authorization.** Always re-verify on the server that the authenticated user owns or can access the resource they're requesting.

7. **Always set rate limiting on public-facing endpoints** that hit external APIs, databases, or LLMs. Provide a working middleware example, not a TODO.

8. **CORS:** never default to `*` for production endpoints. Always pin to specific origins.

9. **Logging:** never log secrets, tokens, passwords, or full request bodies. Scrub PII by default.

10. **File uploads:** validate MIME type AND file extension AND file content (magic bytes). Save outside the web root. Generate new filenames; never use user-provided ones.

# When you write code, you must include

- A 1-line `// SECURITY:` comment near each security-relevant line explaining the protection
- A `// FLAGGED:` comment if you intentionally do something less secure for simplicity (so I can find and fix it later)
- A short list at the end labeled `Security checklist for this code:` summarizing what protections were applied and what was NOT covered

# When you find an issue I should know about

If my request implies a vulnerable pattern (e.g., "store the token in localStorage"), do not silently fix it. Tell me explicitly:
"I'm not doing X because it would expose Y. Instead I did Z. Here's what changes for you: ..."

# Format

Code first. Explanation after. No filler. No "I hope this helps."
02

פתיח לבקשת קוד

איך משתמשים: מדביקים את הפרומפט הזה לפני כל בקשת קוד חדשה (גם בפרויקט שהוגדר כבר). הוא מאלץ את קלוד לחשוב על פרצות לפני שהוא כותב, ולא אחרי. תחליפו את `{{ YOUR REQUEST }}` בבקשה האמיתית שלכם.
Before writing this code, do four things in order:

1. State the 3 most likely security vulnerabilities for this type of feature
2. Choose the protection for each (specific library, pattern, or code construct)
3. Write the code with the protections applied
4. End with a one-line "Audit:" listing what's covered and what is NOT

If my request itself is insecure (e.g., asks you to store secrets in client code, render raw user HTML, or trust a client-provided user ID), refuse and propose a secure alternative before writing anything.

Now, the request:

{{ YOUR REQUEST }}
03

פרומפט אודיט לקוד קיים

איך משתמשים: מעתיקים את הפרומפט, מדביקים את הקוד הקיים שלכם במקום `{{ PASTE CODE }}`, ושולחים לקלוד. תקבלו רשימה מסודרת עם דירוג חומרה ופתרון קונקרטי לכל בעיה. אם הקוד נקי — קלוד יגיד את זה במפורש, לא ימציא בעיות.
Audit the code below for security issues. Check specifically for:

- SQL injection (string concatenation in queries, raw user input in WHERE/ORDER BY)
- XSS (dangerouslySetInnerHTML, innerHTML, unescaped user input in templates)
- Insecure token storage (localStorage, sessionStorage for auth tokens)
- Hardcoded secrets (API keys, passwords, signing secrets, database credentials)
- Missing authorization checks (trusting client-provided user IDs, no resource ownership verification)
- Missing rate limiting on public endpoints
- Permissive CORS (`*` in production, missing origin checks)
- Insecure file uploads (no MIME/magic-byte validation, user-controlled filenames)
- Logging of sensitive data (full request bodies, auth headers, PII)
- Vulnerable patterns in dependencies you can spot (eval of user input, command injection via shell)

For each issue found, output:
- Line number or function name
- Severity: Critical / High / Medium / Low
- Specific exploit scenario (one sentence — how an attacker would use this)
- Concrete fix (working code snippet, not a description)

If the code is clean for the items above, say so explicitly. Do not invent issues to fill space. Do not suggest "best practice" stylistic changes — only real security risks.

Code:

{{ PASTE CODE }}

הוורקפלו השלם

3 דקות הקמה חד-פעמית. אחר כך זה רץ ברקע בכל בקשת קוד.

1

פתחו פרויקט חדש בקלוד

claude.ai → New Project. תנו לו שם כמו "Secure Code". זה ההום-בייס שלכם לכל בקשת קוד מעכשיו.

2

הדביקו את פרומפט #1 ב-Instructions

10 כללי האבטחה הופכים לברירת מחדל קבועה. כל בקשת קוד עתידית בפרויקט תחיל אותם אוטומטית.

3

לפני כל בקשת קוד — הדביקו פרומפט #2

שתי שניות של עבודה. מאלץ את קלוד לחשוב על וקטור התקיפה לפני שהוא כותב. זה ההבדל בין קוד פגיע לקוד מאובטח.

4

בדקו קוד קיים עם פרומפט #3

פעם בחודש (או לפני דיפלוי), הריצו את האודיט על הקוד הראשי שלכם. תקבלו רשימת פרצות עם דירוג חומרה ופתרון קונקרטי לכל אחת.

רוצים תבנית כזאת בכל חודש?

אני שולח אחת לחודש — תבנית, פרומפט, או וורקפלו שעובד בפועל. בלי ספאם, בלי שטויות. אפשר להתנתק בכל זמן.

לא משתפים את האימייל. לעולם.