Prompt Library

Security Prompts for Your AI Coding Projects

25+ copy-paste prompts that catch the security issues AI coding tools miss.

Sherlock Forensics provides a free library of 25+ security prompts for AI coding tools including Cursor, Bolt, Lovable, Replit Agent and Claude Code. Prompts cover authentication, API security, database hardening, deployment, input validation, session management, dependency verification and error handling. Professional audits from $1,500 CAD. Contact 604.229.1994.

Paste these prompts into your AI coding tool before you ship. Each one targets a specific category of vulnerability that AI-generated code commonly introduces. They are not a replacement for a professional audit, but they are a strong first line of defense.

Authentication (3 Prompts)

Review my authentication implementation for security vulnerabilities. Check for: plaintext password storage (must use bcrypt/scrypt/argon2 with cost factor >= 10), missing rate limiting on login endpoints, JWT tokens without expiration or with expiration longer than 24 hours, session tokens that persist after logout, password reset links that do not expire within 1 hour, and missing CSRF protection on login forms. List each issue found with severity (critical/high/medium) and the exact code change needed to fix it.
What it catches: The most common authentication flaws in vibe coded apps, including plaintext passwords and tokens that never expire.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Run this prompt after every change to your login or signup flow.
Audit my password reset flow end to end. Verify that: reset tokens are cryptographically random (minimum 32 bytes), tokens expire within 1 hour of generation, tokens are single-use and invalidated after consumption, the reset endpoint does not reveal whether an email exists in the system, rate limiting prevents brute-force token guessing, and the new password is validated against complexity requirements before being accepted. Show me the current implementation alongside the secure version for each issue.
What it catches: Password reset bypass is one of the easiest attack vectors in AI-built apps because AI tools generate the happy path but skip the security constraints.
Works with: Cursor, Claude Code, Bolt, Replit Agent
Pro tip: Test your reset flow manually. Send a reset link, use it, then try the same link again. If it still works, you have a problem.
Check my multi-factor authentication implementation. Verify that: TOTP secrets are stored encrypted at rest, backup codes are single-use and hashed, MFA cannot be bypassed by directly accessing API endpoints, the MFA enrollment flow requires re-authentication, and there is no way to downgrade from MFA to password-only without administrator approval. If MFA is not implemented, recommend the simplest secure implementation for my current stack.
What it catches: MFA bypasses and implementation weaknesses that let attackers skip the second factor entirely.
Works with: Cursor, Claude Code, Replit Agent, Windsurf
Pro tip: MFA that can be bypassed by calling the API directly is not MFA. Always check server-side enforcement.

API Security (3 Prompts)

Review all API endpoints in my application for authorization vulnerabilities. For each endpoint check: does it verify the authenticated user has permission to access the specific resource requested (not just that they are logged in), does it prevent horizontal privilege escalation (User A accessing User B's data by changing an ID), does it prevent vertical privilege escalation (regular user accessing admin endpoints), and are all sensitive operations protected by authentication? List every endpoint with its current authorization status and the fix needed.
What it catches: Broken access control, the number one vulnerability on the OWASP Top 10. Nearly every vibe coded app has this.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Test this manually by logging in as one user and changing IDs in API calls to access another user's data.
Audit my API responses for data leakage. For each endpoint, compare what data the frontend actually needs versus what the API returns. Flag any endpoint that returns: password hashes, internal database IDs that could enable enumeration, email addresses or personal information not required by the UI, API keys or tokens in response bodies, or full database records when only specific fields are needed. Provide the minimal response object for each endpoint.
What it catches: Over-verbose API responses that leak sensitive data. AI tools return entire database records because it is simpler than selecting specific fields.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent
Pro tip: Open your browser's Network tab and review every API response your app makes. You will likely find data you did not expect.
Review my API rate limiting and abuse prevention. Check that: all public endpoints have rate limiting configured, authentication endpoints have stricter limits (max 5 attempts per minute), rate limiting is applied server-side (not client-side), failed authentication attempts are logged with IP and timestamp, and there are no endpoints that accept unbounded input sizes or file uploads without limits. Show me how to implement rate limiting for my specific framework if it is missing.
What it catches: Missing rate limiting that enables brute-force attacks, credential stuffing and denial-of-service.
Works with: Cursor, Claude Code, Bolt, Replit Agent, Windsurf
Pro tip: Try hitting your login endpoint 100 times in a row with wrong passwords. If it lets you, rate limiting is missing.

Database Security (3 Prompts)

Audit all database queries in my application for SQL injection vulnerabilities. Find every query that uses string concatenation or template literals to include user input. Replace each one with parameterized queries or prepared statements. Also check for: NoSQL injection in MongoDB queries, ORM misuse that bypasses parameterization, and any raw query functions that accept user-controlled input. Show the vulnerable code and the fixed version side by side.
What it catches: SQL injection and NoSQL injection. AI coding tools frequently use string concatenation for database queries because it is the fastest way to get a working query.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Search your codebase for backtick template literals that include variables in SQL strings. That is where injection lives.
Review my database configuration and access patterns for security issues. Check for: default credentials still in use, database accessible from the public internet without IP restrictions, connections not using SSL/TLS, application connecting with root or admin privileges instead of a least-privilege user, missing connection pooling that could enable connection exhaustion, and any database backups stored without encryption. Provide the specific configuration changes needed for my database.
What it catches: Database misconfigurations that expose your entire dataset. AI tools use whatever credentials work fastest, usually admin.
Works with: Cursor, Claude Code, Replit Agent, Windsurf
Pro tip: Create a dedicated database user for your application with only SELECT, INSERT, UPDATE and DELETE permissions on the tables it needs. Never use root in production.
Check my database schema for sensitive data handling issues. Verify that: passwords are hashed (never stored in plaintext or reversible encryption), PII fields are identified and encrypted at rest where required by regulation, credit card numbers are never stored in full (use a payment processor), session tokens are not stored in plaintext, audit logs capture who accessed what data and when, and there is a data retention policy implemented for user deletion requests. List every sensitive field and its current protection status.
What it catches: Plaintext storage of sensitive data, missing encryption at rest and regulatory compliance gaps.
Works with: Cursor, Claude Code, Bolt, Replit Agent
Pro tip: Query your database directly and look at the users table. If you can read any passwords, you have a critical vulnerability.

These prompts catch the obvious stuff. For everything they miss, there is us.

Quick Audit from $1,500 CAD. Results in 3-5 business days.

Order a Quick Audit

Deployment Security (3 Prompts)

Review my deployment configuration for security issues. Check that: debug mode is disabled in production, error messages do not expose stack traces or internal paths, source maps are not deployed to production, environment variables are used for all secrets (none hardcoded), the deployment uses HTTPS with a valid certificate, HTTP Strict Transport Security (HSTS) is enabled, and the server returns security headers including Content-Security-Policy, X-Frame-Options, X-Content-Type-Options and Referrer-Policy. Show me the exact configuration needed for my hosting platform.
What it catches: Production misconfigurations that leak information and expose attack surface. Debug mode in production is one of the most common findings in vibe coded apps.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent
Pro tip: Visit your production site and check browser developer tools for verbose error messages. If you see file paths or stack traces, debug mode is still on.
Audit my CORS (Cross-Origin Resource Sharing) configuration. Check that: Access-Control-Allow-Origin is not set to wildcard (*) in production, only trusted domains are in the allowed origins list, credentials are not allowed with wildcard origins, preflight caching is configured appropriately, and the CORS configuration cannot be bypassed by manipulating the Origin header. Show me the current CORS configuration and the secure version for my framework.
What it catches: Overly permissive CORS that allows any website to make authenticated requests to your API.
Works with: Cursor, Claude Code, Bolt, Replit Agent, Windsurf
Pro tip: AI tools set CORS to allow all origins because it eliminates development errors. This is a security vulnerability in production.
Review my CI/CD pipeline and deployment process for security vulnerabilities. Check that: secrets are not stored in code repositories or CI configuration files, build artifacts do not include development dependencies, Docker images use minimal base images and run as non-root users, deployment credentials use least-privilege access, and there are no publicly accessible deployment endpoints (like webhook URLs without authentication). Provide specific fixes for each issue found.
What it catches: Deployment pipeline vulnerabilities including exposed secrets in CI configs and overprivileged deployment credentials.
Works with: Cursor, Claude Code, GitHub Copilot
Pro tip: Search your Git history for any secrets that were committed and later removed. They are still in the history and accessible to anyone with repo access.

General Security Review (3 Prompts)

Perform a comprehensive security review of my entire application. Act as a senior penetration tester. Check for the OWASP Top 10 vulnerabilities: broken access control, cryptographic failures, injection, insecure design, security misconfiguration, vulnerable and outdated components, identification and authentication failures, software and data integrity failures, security logging and monitoring failures, and server-side request forgery. For each category, list specific findings in my code with severity ratings and remediation steps. Prioritize findings by risk level.
What it catches: A broad sweep across all major vulnerability categories. Use this as your first prompt before diving into specific areas.
Works with: Cursor, Claude Code, Windsurf, GitHub Copilot
Pro tip: Run this on your full codebase first, then use the category-specific prompts on the areas that need attention.
Search my entire codebase for hardcoded secrets, API keys and credentials. Look for: strings that match API key patterns (sk_, pk_, key_, token_, secret_), database connection strings with embedded passwords, AWS access keys (AKIA...), private keys or certificates stored in code, .env files committed to the repository, and any configuration files that contain credentials. For each finding, show the file, line number and a secure alternative using environment variables.
What it catches: Exposed secrets in source code. This is one of the fastest vulnerabilities to exploit because attackers just search for key patterns.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Also check your Git history. Removing a secret from the current code does not remove it from previous commits.
Review my application's security logging and monitoring. Check that: failed authentication attempts are logged with IP address and timestamp, authorization failures are logged, sensitive data is never written to logs (no passwords, tokens or PII), logs are stored in a location separate from the application, log injection attacks are prevented by sanitizing user input before logging, and there is a mechanism to alert on suspicious patterns like multiple failed logins from one IP. Provide the logging configuration needed for my framework.
What it catches: Missing security monitoring that prevents you from detecting attacks in progress. Most vibe coded apps have zero security logging.
Works with: Cursor, Claude Code, Replit Agent, Windsurf
Pro tip: If you cannot answer "how many failed login attempts happened yesterday," your security logging is insufficient.

Enterprise and Team Security (3 Prompts)

Review this codebase for compliance with our organization's security standards. Check for: data classification labels on all database fields storing PII, encryption at rest for all sensitive data, audit trails for data access and modification, data retention policies implemented in code, consent management for data collection, and cross-border data transfer controls if applicable. Generate a compliance gap report organized by regulation (PIPEDA, GDPR, SOC 2) with specific code references and remediation priority.
What it catches: Regulatory compliance gaps that create legal liability. Critical for applications handling Canadian, EU or healthcare data.
Works with: Cursor, Claude Code, GitHub Copilot
Pro tip: Run this prompt for each regulation that applies to your business. Compliance requirements differ significantly between PIPEDA, GDPR and SOC 2.
Audit this codebase for intellectual property leakage risks when using AI coding tools. Check for: proprietary business logic exposed in AI tool prompts or logs, API endpoints that return proprietary algorithms or models, client code that contains trade secrets, configuration files that reveal infrastructure architecture, and any code comments that reference internal processes or systems. Recommend isolation strategies for sensitive code that should not be processed by AI tools.
What it catches: IP leakage through AI coding tool usage, a growing concern for enterprise teams using Cursor, Copilot and similar tools.
Works with: Cursor, Claude Code, GitHub Copilot
Pro tip: Establish a clear policy on which code repositories are approved for AI tool usage and which contain IP that must be excluded.
Generate a security architecture review for this application. Document: all trust boundaries in the system, data flows between components with sensitivity classification, external service dependencies and their security posture, authentication and authorization mechanisms at each boundary, encryption in transit and at rest for each data flow, and single points of failure. Output as a structured report that can be reviewed by a security team or auditor. Flag any architectural decisions that introduce unnecessary risk.
What it catches: Architecture-level security issues that individual code reviews miss. Essential for applications that have grown beyond a single developer.
Works with: Cursor, Claude Code, GitHub Copilot
Pro tip: Use this prompt at the start of any security review engagement. It maps the attack surface before diving into code-level issues.

These prompts catch the obvious stuff. For everything they miss, there is us.

Quick Audit from $1,500 CAD. Results in 3-5 business days.

Order a Quick Audit

Input Validation (2 Prompts)

Review all user input handling in my application. For every form field, API parameter and URL parameter, check that: input is validated on the server side (not just client side), input length is bounded to prevent buffer overflow and denial of service, special characters are properly escaped before database queries, HTML output and file paths, file uploads are restricted by type, size and content (not just extension), and there is no path traversal vulnerability in file operations. Show every input point and its current validation status.
What it catches: Missing server-side validation. AI tools often only add client-side validation which can be bypassed by sending requests directly to the API.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Test every form by submitting it with your browser's developer tools instead of the UI. If the server accepts invalid input, client-side validation is your only protection, and it is not enough.
Audit my application for Cross-Site Scripting (XSS) vulnerabilities. Check every location where user-supplied data is rendered in HTML. Verify that: output encoding is applied consistently (HTML entities for HTML context, JavaScript encoding for script context, URL encoding for URL context), React's dangerouslySetInnerHTML or equivalent is not used with user input, user-generated content displayed in emails or PDFs is sanitized, and Content-Security-Policy headers restrict inline scripts. Show each vulnerable output point and the fix.
What it catches: XSS vulnerabilities that allow attackers to inject malicious scripts into your application, stealing user sessions and data.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent
Pro tip: Try entering <script>alert(1)</script> in every text field. If you see an alert box, you have XSS.

Session Management (2 Prompts)

Review my session management implementation for security vulnerabilities. Check that: session IDs are cryptographically random (minimum 128 bits of entropy), session cookies use Secure, HttpOnly and SameSite=Strict attributes, sessions expire after a reasonable period of inactivity (recommended 30 minutes for sensitive apps), session IDs are regenerated after authentication to prevent session fixation, concurrent session limits are enforced where appropriate, and logout actually invalidates the session server-side (not just deleting the client cookie). Show the current implementation and required fixes.
What it catches: Session management flaws that let attackers hijack user sessions. AI tools often implement logout by deleting the cookie without invalidating the server-side session.
Works with: Cursor, Claude Code, Bolt, Replit Agent
Pro tip: Copy your session cookie, click logout, then paste the cookie back into your browser. If you are still logged in, server-side invalidation is missing.
Audit my JWT (JSON Web Token) implementation if applicable. Check that: tokens have a reasonable expiration time (access tokens under 15 minutes, refresh tokens under 7 days), the signing algorithm is explicitly set (no "alg: none" vulnerability), the secret key is strong (minimum 256 bits) and stored securely, tokens are validated on every request (not just on login), refresh token rotation is implemented (old refresh tokens are invalidated when a new one is issued), and tokens contain only the minimum claims needed. Show security issues and fixes.
What it catches: JWT implementation flaws including the "alg: none" bypass, overly long expiration and missing token validation.
Works with: Cursor, Claude Code, Bolt, Replit Agent, Windsurf
Pro tip: Decode your JWT at jwt.io and check what data is in the payload. JWTs are base64-encoded, not encrypted. Anyone can read them.

Dependency Verification (2 Prompts)

Audit all dependencies in my package.json (or requirements.txt or composer.json). For each dependency check: does this package actually exist on the official registry (npm, PyPI, Packagist), is the package name spelled correctly (check for typosquatting), does the package have a reasonable number of downloads and a maintained repository, are there any known vulnerabilities reported in the package (check npm audit, pip-audit or similar), is the version pinned to avoid unexpected updates, and are there any packages that could be replaced with built-in language features? Flag any suspicious or unnecessary dependencies.
What it catches: Hallucinated packages (AI tools suggest packages that do not exist, which attackers register), typosquatting and known vulnerable dependencies.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: AI tools hallucinate package names regularly. Always verify every dependency on the official registry before installing. See our package verification guide.
Review my dependency lock file (package-lock.json, yarn.lock, poetry.lock, composer.lock) and verify that: a lock file exists and is committed to version control, all dependency versions are pinned to exact versions, there are no integrity hash mismatches, dev dependencies are not included in production builds, and the total dependency count is reasonable for the application's functionality. Also check if any dependencies request excessive permissions (file system access, network access, native code execution) relative to their stated purpose.
What it catches: Supply chain attacks through manipulated lock files, dev dependencies in production and excessive dependency permissions.
Works with: Cursor, Claude Code, GitHub Copilot
Pro tip: Run "npm ls --production" to see what actually ships to production. The number is often much larger than developers expect.

Error Handling (1 Prompt)

Review my application's error handling for information disclosure vulnerabilities. Check that: production error responses return generic messages (not stack traces, file paths or database schemas), API errors return consistent JSON format with appropriate HTTP status codes, unhandled exceptions are caught by a global error handler, error logging captures full details server-side without exposing them to the client, database error messages are not passed through to users, and custom error pages are configured for 404, 403 and 500 responses. Show every location where detailed errors could leak to users and provide the secure error handling pattern for my framework.
What it catches: Information disclosure through verbose error messages. AI tools leave debug mode enabled because it helps during development, and nobody turns it off before deploying.
Works with: Cursor, Claude Code, Bolt, Lovable, Replit Agent, GitHub Copilot
Pro tip: Intentionally trigger errors in your production app (invalid URLs, malformed input, missing resources). If you see stack traces, your error handling needs work.

These prompts catch the obvious stuff. For everything they miss, there is us.

Quick Audit from $1,500 CAD. Results in 3-5 business days.

Order a Quick Audit

Frequently Asked Questions

Prompt Library FAQs

Can I use these prompts commercially?
Yes. These prompts are free to use in any project, commercial or personal. Copy them, modify them, share them with your team. Attribution is appreciated but not required.
Do these prompts guarantee my app is secure?
No. Prompts are a valuable first pass but they cannot replace a professional security audit. AI tools may miss issues, hallucinate fixes or provide incomplete remediation. For production applications handling user data or payments, a professional audit is essential.
How often should I run these prompts?
Run the relevant category prompts after any significant code change. Run the general security review prompt before every deployment. The authentication and API security prompts should be run whenever you modify login flows or API endpoints.

Beyond Prompts

When prompts are not enough, we are here.

Professional security audits from $1,500 CAD. We find what prompts miss.

Order an Audit