AI coding tools are increasingly becoming a part of the software development process. They are used by developers to produce code, correct errors, create tests, learn about the function of new functions and to streamline repetitive tasks. The more these tools are able to penetrate in development environments the more they are on the software security surface.

It’s not just about code that is vulnerable to being written by AI. Coding assistants can communicate with various repositories, documentation, dependencies, configuration files, APIs and development tools. This can introduce extra avenues in which security issues can infiltrate a software project.

AI Assistants Are Moving Inside the Development Trust Boundary

Today’s code assistants are able to comprehend more than one question. They can be given repository context, existing functions, information on configuration, documentation and other project data, to be able to make more accurate suggestions.

The access to the repository creates a sensitive data path.

Proprietary code, internal URLs, authentication logic, infrastructure information, configuration values or credentials that are not supposed to be there, are possible to be included in repository context. Organizations should therefore be able to restrict access and use of AI tools to information of their choosing.

Developers also need to be aware of whether project information is being sent to the outside world, what is done with it, and if it’s OK for AI to assist in building it, and how.

Code generated still needs a security review.

Like humans, AI-powered code can exhibit many common software vulnerabilities. Additionally, when code is generated more rapidly, unsafe patterns can spread rapidly as well if the developers take code suggestions without proper scrutiny.

Security teams should particularly check for:

  • Failure of input validation and improper handling of data
  • Injection-prone database queries or commands
  • Limited authentication and/or authorization capabilities.
  • Hard-coded credentials, tokens, or API keys
  • Reliable and up-to-date third party dependencies

Prompt Context Additional Security Entry Point

Instruction and context information are the medium through which AI assistants operate. If tools are able to retrieve data from several sources, then the developers have to determine if the data they receive from the project sources might affect the output of the tools.

Project Files May Contain Untrusted Instructions

The README file, comments, documentation, issues, configuration files and third-party material are located in repositories. This content could end up being part of the context of an AI Assistant.

This risk is even greater when coding agents can interact with development systems, install agents, packages, or execute commands, or modify files. This kind of ability is only possible with more powerful permission boundaries.

More Automation Demands More Permissions

Increasing the access given to an AI coding tool can make it more useful, but also raise the risk of being misled or put in a situation where the wrong or unsafe action could have a significant impact.

Teams can limit exposure by:

  • Restricting access according to developer responsibilities
  • Isolating sensitive repositories from the unconstrained AI workflows.
  • Needs to be given permission to carry out any consequential commands
  • Making marks on important development actions assisted by AI.
  • Applying least-privilege access to tools and credentials

AI Recommendations Impact on Software Supply Chain.

There are already other libraries, frameworks, packages, registries, APIs and development tools that are used by software projects. AI assistants provide yet another way in which these elements can be found and/or chosen.

Packages need to be verified independently.

An AI assistant can suggest a package that looks like a great fit, but is not the most recent, has the wrong name, is not properly maintained or isn’t actually a fit. Don’t assume the recommendation is correct; developers should check the recommendation and install only if it is.

Before a new dependency is added to production software, it should be verified that the package is the same as the one already used, the source is the official one, the version is the same as required, it is known if there are any vulnerabilities, maintenance has been performed on it, and there is no other license in place.

Security Controls Must Adhere to AI-Generated Code

Security measures that are applied to human-written code should be used for code generated by AI. While syntactically correct code isn’t necessarily secure code, it is certainly not the only kind of code that is.

Existing AppSec Practices Remain Essential

AI in development doesn’t lose ground to these other areas of software security: Code review, static analysis, dependency scanning, secret detection, software composition analysis and security testing all continue to be significant.

Special care should be taken in writing code that deals with authentication, authorization and/or cryptography, payments or personal data, or other sensitive functions. When generated code impacts on critical functionality, it is important to review the code by a human.

Governance Needs to Cover Everyday AI Coding

AI Coding Governance Framework
Governance policies securing everyday AI assisted coding workflows.

Clear guidelines about where AI coding tools can be applied, what type of information developers can give them and how much review is needed for changes generated by AI need to be established.

Clear rules for AI development in teams

Development governance should include approved tools, permissions in the repositories, the requirements of handling data, dependency checking and human approval procedures.

What isn’t being intended is to stop developers from employing AI. It’s to make sure that AI helped development happens on the same principles as all other software development, and that security is taken into consideration.

Conclusion

As AI coding tools get in contact with more source code, repositories, dependencies, project context and development environments, they’re becoming a part of the software security surface.

AI-generated code and recommendations should not be taken as gospel; organizations need to verify this code and recommendations. Teams can leverage AI coding tools without compromising existing software security practices through access control, least privilege, human review, dependency checks, security testing, and having strong governance.

FAQs

1. Do AI coding tools create vulnerabilities?

Yes. Weak validation, exposed secrets, authorization issues, insecure patterns, and inappropriate dependencies are some of the common issues that can be found in AI-generated code. It’s best to review and test it prior to using it in production.

2. Why is access to a repository a problem of security?

Organizations may have proprietary code, internal documentation, configuration information, credentials and information about their infrastructure to protect, which can be contained in repositories.

3. Can developers trust the packages suggested by the AI?

NO: Developers should check the version, maintenance and security history of a package before installing it, as well as its official source and suitability, before installation.

4. Do existing security tools work with AI-generated code?

Yes. The traditional tools of static analysis, dependency scanning, secret detection, code review and security testing are still helpful for finding issues in AI-generated code.

5. What are some ways for companies to make AI coding safer?

Organizations can control which tools are used in the repository, allow certain AI tools, give access using least privilege, check dependencies, mandate human oversight and integrate generated code into current security testing.

Leave a Reply

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