chatGPT explains the dangers of AI code development

I’ve been playing with chatGPT a lot lately (as many have). There’s been some debate on the merits and security risks around using it and similar large language models to do things like develop code, so I thought it’d be fun to ask it how it felt about that topic.

To start, I asked “write a technical blog post about the potential security risks of using AI to write source code for a business”. The results were OK, but sort of generic, so I followed up by asking it “can you rewrite this with source code examples and more specific tips on how to mitigate the security risks of using AI to create software”.

Here’s what it came back with:


The use of Artificial Intelligence (AI) in software development has the potential to transform the industry by automating the coding process and reducing the time and costs associated with software development. However, the use of AI also raises several security concerns that must be addressed. This blog post will examine the potential security risks associated with using AI to write source code and provide specific tips on how to mitigate these risks.

Potential Security Risks:

  1. Code Quality: AI generated code may contain bugs, security vulnerabilities, and other issues that could compromise the security of the software. For example, a vulnerability in AI generated code could allow an attacker to execute arbitrary code on a system. To mitigate this risk, it is recommended to use code reviews and code quality tools, such as SonarQube, to catch any potential security issues.
  2. Data Privacy: AI models are trained on large datasets, which may contain sensitive information such as customer data, trade secrets, and other confidential information. This information could be leaked if the AI model is not properly secured. To mitigate this risk, it is recommended to use secure data storage solutions, such as Amazon S3, and to implement proper access controls and data encryption.
  3. Algorithm Bias: AI models are trained on data, and if the training data is biased, then the AI generated code will also be biased. This could lead to security vulnerabilities, as the AI generated code may not take into account all potential security risks. To mitigate this risk, it is recommended to use diverse and representative training data and to regularly monitor the results to detect and address any biases.
  4. Vulnerability to Hackers: AI generated code may be more vulnerable to hacking than traditional code. For example, an attacker could use a vulnerability in the AI generated code to gain access to sensitive data or control over the software. To mitigate this risk, it is recommended to regularly update the AI models and the underlying software, to use secure algorithms, such as encryption and authentication, and to perform regular penetration testing.


In conclusion, while AI generated code has the potential to speed up software development and reduce costs, businesses must be aware of the potential security risks and take the necessary steps to mitigate them. By using code reviews, secure data storage solutions, diverse training data, and secure algorithms, businesses can reduce the risk of security incidents associated with using AI in software development. Additionally, by regularly monitoring the results and updating the AI models and software, businesses can ensure the security and reliability of the code generated by AI.

Leave a Reply

Your email address will not be published. Required fields are marked *