Keeping Your AI-Built Project Safe and Secure

Keeping Your AI-Built Project Safe and Secure

Learn the checks to make before and after putting an AI-built website or app live. AI tools are good at producing code that works, but they do not always produce code that is safe, so it is worth going through this list for every project.

Steps

  1. Ask your AI tool to review its own work: Review this project for security problems, including SQL injection, missing login checks, unsafe file uploads and exposed secrets, and fix what you find
  2. Move API keys and passwords out of your code. See Storing API Keys and Secrets Safely on Your Hosting
  3. Point your domain at your project's public folder so visitors cannot reach your source files. See Setting the Document Root for Your Project in Plesk
  4. Check that your website has an SSL certificate and loads over https. See SSL Certificate in Plesk
  5. In the Plesk Files section, remove anything that is not part of the live website, such as uploaded .zip files, .sql database exports, test pages and the .git folder
  6. Turn off debug output. Set display_errors to Off for PHP, set APP_DEBUG=false in a Laravel .env file, and set Application Mode to production for Node.js
  7. Use a supported PHP or Node.js version. See Choosing the PHP Version and Settings for Your Project
  8. Give each project its own database and database user with a strong password. See Creating a New Database in Plesk
  9. If a part of your website is unfinished or only for you, such as an admin area, click Password-Protected Directories under Security in Websites & Domains and protect that folder
  10. Take a backup before every major change. Click Backup & Restore in Websites & Domains
  11. Scan your website from time to time. See Scanning Your Website for Malware

Important: Keep your project's packages up to date. Known security holes in old packages are one of the most common ways websites are broken into. For PHP projects, use Update in PHP Composer. For Node.js projects, ask your AI tool to update the packages, then upload the project and run NPM install again.

Please note: We protect the server your website runs on with a firewall and malware scanning. The code inside your project is your responsibility, including code written by an AI tool.

Note: Do not paste live passwords or API keys into an AI tool when asking for help. Replace them with placeholder text first.

Your project now has the main protections in place for a live website.