Security scanning for AI-generated code

AI coding assistants can write code that works but is not secure. This scanner looks for security problems often found in AI-generated code.

Included in Ultimate.

In AquilaX

AquilaX security policy editor with a switch for each scanner
In the security policy editor, the AI-generated code scanner is called Vibe.

Screenshots that show scan results use our public test apps, which are vulnerable on purpose. Select an image to enlarge it.

What it looks for

Missing checks

Code without the access or input checks it needs.

Unsafe settings

Security features that have been turned off.

Secrets

Keys or passwords added directly to code. Use the secrets scanner as well.

Examples

These examples show common problems and safer ways to write the code. They are not AquilaX results, and scanner coverage can vary.

A package the model made up

SlopsquattingPythonCritical
Vulnerable · requirements.txt
# prompt: "add JWT auth to my FastAPI app"
$ pip install fastapi-jwt-guard

from fastapi_jwt_guard import JWTGuard
Why it's exploitable

Models suggest package names that sound right but don't exist. A 2024 study of 16 code models found almost 20% of suggested packages pointed to nothing. Attackers register those names and wait for pip install.

The fix
# use a known, maintained library
$ pip install pyjwt
# and check the package page before installing anything new

JWT signature check switched off

CWE-347PythonCritical
Vulnerable · auth/deps.py
# prompt: "fix jwt.exceptions.InvalidSignatureError"
def current_user(token: str):
    payload = jwt.decode(token, options={"verify_signature": False})
    return db.get_user(payload["sub"])
Why it's exploitable

The error went away because the check went away. Any token with any sub is now accepted, so an attacker writes {"sub":"admin"}, base64-encodes it, and is admin.

You asked for the error to disappear, and the assistant did exactly that.

The fix
payload = jwt.decode(token, SECRET_KEY, algorithms=["HS256"])
# the real bug was a different SECRET_KEY between services

TLS verification disabled on a payment call

CWE-295PythonHigh
Vulnerable · billing/client.py
# prompt: "requests SSLError: certificate verify failed"
resp = requests.post(PAYMENT_API, json=charge, verify=False)
Why it's exploitable

Same pattern: the fix removes the protection that raised the error. With verify=False, anyone on the network path can present any certificate and read or change the payment request.

This line is all over Stack Overflow, which is why models reproduce it so easily.

The fix
# trust your internal CA instead of trusting everyone
resp = requests.post(PAYMENT_API, json=charge,
                     verify="/etc/ssl/certs/corp-ca.pem")

What to know

  • No scanner can always tell whether a person or AI wrote the code.
  • Use SAST, SCA and secrets scanning as well. AI-generated code can have the same problems as any other code.
  • Before you install a suggested package, check that it exists and comes from a trusted source.
  • Review and test AI-generated code before you release it.

See all scanners How to fix findings

Questions and answers

What is vibe coding?

It means building software mainly by asking an AI assistant to write the code.

Is AI-generated code less secure?

It can be. The result depends on the model, the request, the code and the review. Check it as carefully as any other code.

Can AquilaX tell whether AI wrote my code?

Not with certainty. People and AI can write similar code. Use the findings to review security problems, not to prove who wrote the code.

Does it matter which AI coding assistant I use?

You can scan the code in your repository whichever assistant you use. Results can differ, so review the code whichever tool you choose.

Should I use this scanner instead of SAST?

No. Use both. SAST checks for a wider range of security problems. SCA and secrets scanning can also help with AI-generated code.

Can this scanner run in a diff scan?

Diff scans skip the AI-generated code checks that use repository history. Run a full scan to include them.

Why is this scanner called Vibe in AquilaX?

Vibe is its name in the security policy editor. It is short for vibe coding. On this website, we call it AI-generated code scanning.

What should I check before I use AI-generated code?

Check access rules, how it handles user input, and whether it contains secrets or unsafe settings. Make sure any suggested packages are real and trusted. Then review and test the code.

Which plan includes this scanner?

Included in Ultimate. Compare plans.

Try it on one of your repositories

Create a free account and run a scan. If you need Ultimate, self-hosting or a larger rollout, talk to our team.

No credit card needed. Read the documentation