Short answer
- Read AI-written code before it merges, the same way you read a new hire's first pull request. Run tools too, but do not let them replace a person. The OWASP Code Review Guide says tools “always need human verification.”
- The ten checks below cover inputs, queries, access control, secrets, packages, shell and file calls, errors, model calls, and tests. Each one is tied to an OWASP quote or marked as Harbor's view.
- The OWASP LLM Top 10 covers risks in apps that call a language model. It is not a guide to reviewing code an AI wrote. This guide gives no defect-rate figure for AI code, because none of the sources Harbor read has one.
What do the OWASP sources cover?
Harbor used four OWASP sources. None is written for AI-written code, and we say so up front.
- OWASP Top 10 for LLM Applications. This list covers risks in applications that use an LLM, such as prompt injection and unsafe handling of model output. It does not tell you how to review code an assistant produced. We use it only in check 9, for apps that call a model. (OWASP project page, 2025 list)
- ASVS 5.0.0. The Application Security Verification Standard is a long list of web-app requirements. The project page shows “ASVS 5.0.0 Published 30 May 2025.” It is a reference to dip into, not a checklist for one pull request. (OWASP ASVS)
- Code Review Guide v2. Version 2.0, dated 2017. It describes secure code review as auditing source code “to verify that the proper security and logical controls are present, that they work as intended, and that they have been invoked in the right places.” (Code Review Guide PDF)
- Secure Code Review Cheat Sheet. A shorter checklist. Most checks below come from it. (Cheat sheet)
Harbor's view: treat AI-written code like any code from an author who did not see your whole system. The assistant does not know your users, your data or your rules unless the prompt said so.
Ten checks before you merge
1. Know what the change is for
The cheat sheet recommends “Diff-Based Reviews” for “Pull requests and commits” and lists “Understand purpose of changes” as a step (cheat sheet).
Harbor's view: ask the author to write two sentences in the pull request. What should this change do, and what data does it touch? If you cannot tell from the diff, do not merge. Split a diff too big to read.
2. Validate input on the server
The cheat sheet asks: “Server-side validation: All inputs validated on server regardless of client-side checks” and “Allowlist validation: Uses allowlists rather than blocklists for input validation” (cheat sheet). Harbor's view: a check in the browser alone does not count. Look for the matching check on the server.
3. Use parameterized queries
The cheat sheet says: “SQL injection prevention: Parameterized queries or safely implemented stored procedures used, with user-controlled data values passed as parameters instead of concatenated into SQL.” It tells reviewers to “Look for string concatenation in database queries and unsafe query construction” (cheat sheet). Search the diff for query strings built with plus signs or template literals.
4. Check access control on every route
The cheat sheet lists “Server-side enforcement: All access controls enforced server-side,” “IDOR prevention: Proper authorization for resource access” and “Fail-safe defaults: Default deny access policy” (cheat sheet).
Harbor's view: test it. Log in as user A, then request user B's record by its ID. If the data comes back, do not merge.
5. Hunt for secrets
The cheat sheet says: “Secrets management: No hardcoded secrets, proper secret storage and rotation” (cheat sheet). It also has a section called “Command-Line Pattern Detection” for searching code.
Harbor's view: search the diff for keys, tokens and passwords. Check that no .env file is committed. Check that no secret ships in front-end code. If a real secret lands in a commit, rotate it. Deleting the line does not remove it from history.
6. Verify every new package
The cheat sheet checks “Dependency management: Up-to-date libraries without known vulnerabilities” (cheat sheet). The OWASP LLM list advises: “Maintain an up-to-date inventory of components using a Software Bill of Materials (SBOM).” That line is about LLM supply chains, but the habit fits any app (LLM03).
Harbor's view: for each package the diff adds, confirm that it exists on the registry, that it is the one you meant and not a look-alike, and that it is maintained. Commit the lockfile.
7. Read every shell, file and path call
The cheat sheet says to “Identify direct command execution with user input and unsafe system calls” and to “Check for unsafe file path construction and directory traversal vulnerabilities” (cheat sheet). Any place user input reaches a shell command or a file path needs a human to read it.
8. Check errors and logs
The cheat sheet lists “Error messages: No sensitive information disclosed in error responses” and “Logging security: Sensitive data not logged, proper log protection” (cheat sheet). Harbor's view: look for passwords, tokens and personal data in log lines, and for whole request bodies written to a log.
9. Treat model output as untrusted
This check applies only if your app calls a model. OWASP's list names “LLM01:2025 Prompt Injection,” “LLM05:2025 Improper Output Handling” and “LLM06:2025 Excessive Agency” (2025 list).
- On output: “Treat the model as any other user, adopting a zero-trust approach, and apply proper input validation on responses coming from the model to backend functions” (LLM05). The same page says to “Use parameterized queries or prepared statements for all database operations involving LLM output.”
- On access: “Limit the permissions that LLM extensions are granted to other systems to the minimum necessary” (LLM06).
10. Run tools, then test what they miss
The Code Review Guide says: “SAST tools are great for coverage and setting a minimum baseline.” It also says tools “do not understand context, which is the keystone of security code review” (Code Review Guide). The cheat sheet adds that “Manual Code Review complements automated security testing tools (SAST/DAST)” and lists “Business rule enforcement: Cannot bypass rules through direct API access” (cheat sheet).
Harbor's view: for each business rule that matters, such as who can refund, who can see whose invoices and what a free plan may do, write one test that tries to break it. A scanner cannot know your rules.
A merge checklist for a small team
Harbor's view:
- The author states the purpose and the data touched.
- A second person reads the diff. When the author used an assistant, that person must not also be the assistant's prompter.
- A scanner runs in CI. Someone reads its results.
- Checks 2 to 9 get an explicit yes or no in the pull request.
- Check 10's tests pass.
- Anything unclear blocks the merge until someone answers it.
What to ask any reviewer
- Does a person read the code, or only a tool?
- Is the review static only, or does it touch a live system? Hands-on work needs written authorization.
- Does the report show the exact file and line for each finding?
- Do you claim to know which code was AI-written? If so, ask what the claim rests on.
- What do you not promise?
What this guide does not cover
- A defect rate for AI-written code. Harbor read no source that gives one.
- Penetration testing, production configuration or cloud settings.
- The full ASVS. It is far longer than ten checks.
- Any guarantee. A review does not guarantee that no flaw ships.
Want a second pair of eyes on your repo?
Harbor Artificial offers two fixed-price packages. Start with the Code Risk Snapshot. The live page lists:
- Single, $650: one repo up to 25k lines of code, a dependency and secrets scan, static only, in 2 business days after code access and a signed scope and data-handling agreement.
- Deliverables: a 2-page risk snapshot, the top 10 findings with CVSS 4.0 base score, CWE and OWASP Top 10:2025 mapping, a fix-first list and a recommended next package.
- Exclusions: “Full manual review,” fixes, any live-system activity and retest.
The page says the $650 is credited toward “any security package priced $1,500+ booked within 30 days.” By those numbers, the credit would reach the Standard and Advanced tiers of the AI-Generated Code Audit (listed below) and not the Starter tier. Confirm this with Harbor before you book.
The next package is the AI-Generated Code Audit:
- Starter, $1,200: up to 15k lines, 1 app, a findings report and a fix-first list, in 4 business days.
- Standard, $2,400: up to 50k lines, 1 app plus backend, the Starter items plus a database rules review, in 6 business days.
- Advanced, $3,900: up to 120k lines, app, backend and edge functions, the Standard items plus guardrail prompts and rules for the team's AI coding tool, in 10 business days.
Its acceptance line says: “Each finding includes the exact file/line. The report does not claim which code was AI-written.” Harbor works only on systems and code it has written authorization and a signed scope for. The pages say: “Not a penetration test, audit, or certification; no guarantee of breach prevention; written authorization required before any active testing.” See the Code Risk Snapshot or the AI-Generated Code Audit.
Sources
Fetched 2026-10-27 (PT). Status is the HTTP status of the final response.
- https://owasp.org/www-project-top-10-for-large-language-model-applications/ (HTTP 200) - OWASP Top 10 for LLM Applications project page: scope is LLM applications
- https://genai.owasp.org/llm-top-10/ (HTTP 200) - OWASP GenAI LLM Top 10 2025 index: risk names
- https://genai.owasp.org/llmrisk/llm01-prompt-injection/ (HTTP 200) - LLM01 Prompt Injection page: definition
- https://genai.owasp.org/llmrisk/llm032025-supply-chain/ (HTTP 200) - LLM03 Supply Chain page: SBOM line
- https://genai.owasp.org/llmrisk/llm052025-improper-output-handling/ (HTTP 200) - LLM05 Improper Output Handling page: zero-trust and parameterized-query lines
- https://genai.owasp.org/llmrisk/llm062025-excessive-agency/ (HTTP 200) - LLM06 Excessive Agency page: minimum permissions
- https://owasp.org/www-project-application-security-verification-standard/ (HTTP 200) - OWASP ASVS page: version 5.0.0, publication date
- https://owasp.org/www-project-code-review-guide/assets/OWASP_Code_Review_Guide_v2.pdf (HTTP 200) - OWASP Code Review Guide v2 PDF: definition, SAST and human verification
- https://cheatsheetseries.owasp.org/cheatsheets/Secure_Code_Review_Cheat_Sheet.html (HTTP 200) - OWASP Secure Code Review Cheat Sheet: checklist lines
- https://harborartificial.com/security/code-risk-snapshot/ (HTTP 200) - Live Code Risk Snapshot page: price, scope, deliverables, exclusions, credit
- https://harborartificial.com/security/ai-generated-code-audit/ (HTTP 200) - Live AI-Generated Code Audit page: tiers, prices, acceptance, scope line
FAQ
Guide FAQ
Does the OWASP LLM Top 10 tell me how to review AI-written code?
No. It covers risks in applications that use a language model. For example, OWASP defines prompt injection as occurring "when user prompts alter the LLM's behavior or output in unintended ways." Use it for check 9 if your app calls a model. Source: https://genai.owasp.org/llmrisk/llm01-prompt-injection/
Is AI-written code less safe than human-written code?
This guide gives no rate. Harbor did not read a source that measures one. What the OWASP guide says holds for all code: tools "always need human verification." Review AI-written code the same way as any other. Source: https://owasp.org/www-project-code-review-guide/assets/OWASP_Code_Review_Guide_v2.pdf
Can a scanner do this review for me?
Not alone. The Code Review Guide says SAST tools "do not understand context, which is the keystone of security code review." Run the scanner, then have a person read the results and the diff. Source: https://owasp.org/www-project-code-review-guide/assets/OWASP_Code_Review_Guide_v2.pdf
Do I need to meet all of ASVS before I merge?
No. ASVS is a long reference, and version 5.0.0 was published 30 May 2025. Harbor's view: use the ten checks first, then use ASVS to go deeper on the areas your app touches. Source: https://owasp.org/www-project-application-security-verification-standard/
Does the Code Risk Snapshot replace a full code review?
No. The live page lists "Full manual review" under exclusions, and the snapshot is a static dependency and secrets scan. It is a first read of the biggest risks, not a review of your own code logic. Source: https://harborartificial.com/security/code-risk-snapshot/
Can Harbor tell which parts of my code an AI wrote?
No. The AI-Generated Code Audit page says: "The report does not claim which code was AI-written." It reviews the code you give it. Source: https://harborartificial.com/security/ai-generated-code-audit/
Want to see if a package fits?
Share what you’re trying to ship, your timing, and any constraints you already know. We’ll reply from hello@harborartificial.com.