With AI, even people with little programming experience can now build apps, right?

I've been using AI to develop websites, an inventory management app, and AI agents that support my business. When I took part in AI hackathons, I was also able to finish an app within the limited time.

When I tell the AI what I want to do, it writes the code. When an error appears, it investigates the cause and fixes it.

It's so convenient!

But something occurred to me.

Who checks whether the code the AI wrote has security problems?

The AI writes the code, the AI writes the tests, the AI fixes the errors. So is it okay to leave the question of whether that code is safe to the AI, too?

First, what is a vulnerability?

A vulnerability is a security weakness in software or a system.

For example, there are problems like these:

  • A person who isn't logged in can see data they shouldn't be able to see
  • A regular user can run operations meant only for administrators
  • API keys or passwords are included in publicly available code
  • What's typed into a form causes unintended database operations
  • A library you use has a known security problem

Sometimes you won't notice these problems just by using the app normally.

The screen looks clean. The buttons work. The data is saved properly.

But behind the scenes, it may be built in a way that exposes other people's information.

That's the scary part, and ordinary checks that the app works can't reveal it.

IPA (Information-technology Promotion Agency, Japan) also introduces typical vulnerabilities in web applications, such as SQL injection and flaws in access control, along with countermeasures, in its guide "How to Secure Your Web Site" (Japanese). [1]

Is code written by AI safe?

When an AI generates code, it doesn't necessarily understand all of the app's users, operating environment, and business rules.

For example, suppose you ask an AI to "build an inventory management app."

It might build features such as registering products, showing stock counts, editing, and deleting.

But who is allowed to edit which products? Who has permission to delete them? Is it okay to make it accessible from outside?

If you haven't told it those rules, it may build something different from what you intended.

GitHub's official Copilot documentation also explains that generated code may contain security problems and that users need to review and verify it. [2]

OWASP (Open Worldwide Application Security Project) also warns about the problem of placing too much trust in AI-written code. [3]

Of course, code written by humans has vulnerabilities, too. It isn't as simple as AI being dangerous and humans being safe.

What matters, I think, is not skipping the step of checking safety, no matter who wrote the code.

If all the tests pass, does that mean it's safe?

When I develop with AI, I sometimes get a report like this at the end of a session:

  • Tests: all passed
  • Type check: passed
  • Build: passed

Yay! You feel great, right? (laughs)

But that alone doesn't mean there are no security problems.

For example, suppose I turn my inventory management app into a service used by multiple businesses. I want it so that when Business A logs in, only A's products are shown.

Even if the test "A could view A's own products" passes, if there's no test for "A can't view B's products," we don't know whether other people's information is protected.

What to check Ordinary functional test Security-minded test
Login You can log in with correct credentials Access is denied when authentication fails or has expired
Viewing product data Your own product information is displayed Other people's product information can't be retrieved
Editing products Permitted product information can be changed People without permission can't change it
Forms Normal input is saved Invalid or unexpected input is handled properly
Admin features An administrator can change settings Operations from regular users are also rejected on the server side

This table is a hypothetical example I made up for explanation. It doesn't mean these vulnerabilities were actually found in my app.

Tests tell you the results for the conditions they were set up to check. They don't guarantee anything about what wasn't tested.

Especially when you have the AI create the code and the tests together, it's possible for the AI to build both on the same mistaken assumption. I'd also want to check that, in trying to fix a failing test, it hasn't deleted the test itself or loosened the conditions it checks. [4]

Who should check what?

So when developing with AI, do I have to check all the code myself?

For a programming beginner, I think that would be quite difficult.

Here's how I'd divide up the roles.

Who or what checks Strengths and role Things to keep in mind
The AI that wrote the code Explaining the code it wrote, proposing fixes, writing tests It may repeat the same assumptions and oversights
A different AI Reviewing from a different perspective, looking for candidate problems A different AI also misses things. It isn't the same as an independent expert audit
Static analysis tools (SAST) Finding candidates for dangerous implementations without running the code They can't find every design problem
Dependency checks (SCA, etc.) Checking the libraries you use for known vulnerabilities They don't cover unpublished issues or flaws in your own code
Secret scanning Detecting leaks of credentials contained in code and elsewhere They can't detect secrets in every possible format
Dynamic analysis and security testing (DAST, etc.) Verifying the behavior and defenses of a running app Limited by the target and the test conditions
Developers and operators Deciding the required features, what to protect, permissions, and whether to release Get help from experts when technical judgment is difficult
Security experts Reviewing design and implementation, conducting vulnerability assessments, etc. Limited by the scope and point in time of the assessment. They don't guarantee future safety

Rather than trying to check everything with just one of these, combining them seems best.

NIST's Secure Software Development Framework (SSDF), a framework for developing software securely, lists both reviewing and analyzing code (PW.7) and testing executable software (PW.8). [5]

OWASP's ASVS can also be used as a standard for thinking about the security requirements and verification items of a web application. [6]

Have a different AI check the code the AI wrote

When I build apps, I use AI such as Claude Code and ChatGPT.

For example, I first have the AI that wrote the code explain what it did. Then I have a different AI check the design and the changes.

Even something the first AI considered fine might get noticed by checking from a different way of asking or a different perspective.

But if two AIs say "no problem," that doesn't make it safe.

Multiple AIs can make similar mistakes, and just looking at the code doesn't reveal the actual cloud settings or operating rules.

Having a different AI check is just one way to add more checks. It doesn't replace professional assessment or actual verification.

Also, when passing code to a different AI service, check whether it's okay to handle that code in an external service. I'd avoid handing over a team's confidential information, customer data, or credentials as they are.

You can also use security features such as GitHub's

If you use GitHub, there are ways to check besides asking an AI.

  • Code scanning: Detects candidate problems hidden in source code. Analysis tools such as CodeQL can be used.
  • Dependabot alerts: Notifies you of known vulnerabilities reported for the libraries you depend on.
  • Secret scanning: Checks whether credentials of supported formats, such as API keys and tokens, are contained in the repository.

GitHub's official documentation describes these features. [7]

However, not every feature is available for free in every repository. Which features you can use differs depending on whether the repository is public or private, your plan, and your settings, so check what's available in your own environment.

You don't need to make an important private repository public just to get a security feature. If some features aren't available, consider other checking tools that work in your environment.

For example, for a JavaScript or TypeScript project that uses npm, you can also check dependencies for known vulnerabilities with npm audit. [8]

This works by sending dependency information to the configured registry to query it, so run it in line with the information management rules of the environment you're using. Also, even if it finds problems, don't force updates right away. Check the impact first, then fix and retest.

For any of these checks, getting zero results doesn't prove that the whole app is safe.

Even beginners can ask an AI for a security review

For example, here's the kind of instruction I'd want to give the AI that's helping me develop.

Please do a security review of this app.
This time, limit the work to read-only investigation and reporting.
Do not change any code, operate any external systems,
or access the production environment.

Please check the following points.
1. Login, authentication, and access permissions
2. Management of API keys and secret information
3. Input validation and database operations
4. Storage of personal and confidential information, and output to logs
5. Libraries in use and known vulnerabilities
6. Configuration files, scope of exposure, and external communication
7. Missing security tests

For each candidate problem, report the target file, the basis,
the expected impact, a proposed fix, and how to verify it.
Separate confirmed facts from guesses.
Also state any areas you could not check.
Do not display or send the secret information itself.
If external communication or adding tools is needed, consult me before running it.
I will give separate instructions for fixes after reviewing the report.

What matters is not having it fix everything right away, but first confirming what the problems are.

Even if the AI reports "there's a serious problem," you need to verify whether it actually applies. Conversely, even if it reports "no problems," there may be areas it didn't examine.

An instruction alone doesn't enforce access restrictions, so I'd also want to set the AI's permissions and working environment to the minimum necessary.

A hackathon app and an app you actually operate are different

At AI hackathons, it's important to turn an idea into something that actually works in a short time.

But a prototype verified with fictional data and a service that handles real customer information and transaction data require different levels of safety.

When I developed FrostLoop AI at the Vietnam Japan AI Hackathon, I didn't connect it to my real Amazon business account. I figured there was no need to give access to a production account for development.

By developing with real data and permissions kept separate like this, you can also limit the impact if there's a problem.

That said, even a prototype needs a minimum of security measures. With a publicly available demo, the very fact that it can be used from outside is a risk.

Here's how I'd think about it depending on the app's purpose.

  • A prototype used locally: Use dummy data, and check for secret information and unnecessary external communication.
  • A demo published on the internet: Add measures for the scope of exposure, access control, API keys, and usage counts and costs.
  • A service used by real businesses or customers: Review the design, code, and settings, and run sufficient security tests. If you can't judge important features yourself, consult an expert.

What I'd want to confirm, at minimum, before release

  • I've sorted out who can view, edit, and delete what data
  • API keys, passwords, and tokens aren't included in code or public logs
  • I've run security checks on dependencies and code, within what's available to me
  • I've tested not only normal behavior but also the conditions where access should be denied
  • I've reviewed the files the AI changed and the contents of the tests
  • I've separated development and production data and permissions
  • I've decided on a policy of not releasing with serious problems or unverified high-risk features left in
  • I've decided how to check vulnerability information after release, how to update, and how to respond when problems occur

This is a checklist I put together in my own way. It doesn't cover every item of any formal security standard.

Even after release, new vulnerabilities can be found, and the specifications of libraries and environments can change. So it isn't enough to check once during development. We need to keep checking while operating.

If a credential leak is discovered, I'd want to do more than delete it from the code: revoke and reissue the affected keys, and investigate usage and the scope of impact. [9]

Summary: Having AI write code is different from leaving responsibility to AI

Thanks to AI, I've become able to develop apps and AI agents myself.

It's really fun, and I want to keep building more.

But I think the approach I considered in an earlier article, "AI proposes, humans decide," applies to developing code, too.

Have the AI write the code. Have the AI review it. Check it with dedicated tools and tests as well. And consult experts about what I don't understand.

Then, deciding whether to adopt that code, release it, and keep operating it is, I think, the role of the developer or operator.

Of course, legal responsibility when problems actually occur depends on individual contracts, laws, and the position of the parties involved. What I'm talking about here is the practical role in carrying out safe development.

Now that AI has lowered the barrier to programming, I want to build not only the ability to make things, but also the ability to check whether they're safe!

References

  1. IPA: How to Secure Your Web Site (Japanese)
  2. GitHub Docs: Responsible use of Copilot inline suggestions
  3. OWASP Top 10:2025 — Next Steps (Inappropriate trust in AI-generated code)
  4. GitHub Docs: Reviewing AI-generated code
  5. NIST SP 800-218: Secure Software Development Framework (SSDF) Version 1.1
  6. OWASP: Application Security Verification Standard (ASVS)
  7. GitHub Docs: GitHub security features
  8. npm Docs: Auditing package dependencies for security vulnerabilities
  9. GitHub Docs: Remediating a leaked secret in your repository

This article is a general reflection based on public materials as of November 21, 2026 and my own development experience. It doesn't guarantee or determine the safety of any particular app or code, or where legal responsibility lies. Please run security checks only in environments you manage or within the scope you've been explicitly permitted, and consult experts as needed.