United States

How do I do a code audit to verify what I received from a development agency?

A code audit verifies that the software a development agency delivered is secure, maintainable, and actually matches what you paid for. Run it across four areas: architecture and code quality, security vulnerabilities, test coverage, and documentation completeness. You can hire an independent firm, use automated tooling, or do both — and you should do it before signing off on final payment.

Why You Need an Independent Code Audit

Taking delivery of a codebase without verifying it is like buying a house without an inspection. In the US, most commercial contracts tie final payment to acceptance — an audit gives you objective grounds to accept, reject, or negotiate fixes before that milestone closes.

The Four Areas to Cover

1. Architecture and Code Quality

  • Does the structure match what was scoped (monolith vs. microservices, chosen frameworks)?
  • Is the code readable and consistently formatted, or is it held together with workarounds?
  • Are there hard-coded credentials, secrets, or environment variables baked into the repo?
  • Run static analysis tools: SonarQube, ESLint, or language-specific linters depending on the stack.

2. Security Vulnerabilities

  • Scan dependencies for known CVEs using tools like Snyk, OWASP Dependency-Check, or npm audit.
  • Check for OWASP Top 10 issues: SQL injection, XSS, broken authentication, insecure direct object references.
  • Verify that secrets management (API keys, DB passwords) follows best practices — nothing committed to version control.

3. Test Coverage

  • Request the test suite and run it yourself. What percentage of critical paths have unit or integration tests?
  • Low coverage (under ~60–70% on critical modules) means bugs are hidden, not absent.
  • Check whether CI/CD pipelines exist and whether tests actually run on every commit.

4. Documentation and IP Completeness

  • Is there a README, architecture diagram, and deployment guide — or do you need the agency to explain every component?
  • Confirm you received full source code, not just a build artifact or hosted environment access.
  • In the US, make sure your contract assigns IP to you explicitly; a code audit is also a good moment to verify there's no GPL-licensed code embedded in a commercial project without a license exemption.

How to Run the Audit

  1. Get a full repo export — all branches, commit history, environment configs (sanitized).
  2. Run automated tools first — they surface the obvious issues cheaply and fast.
  3. Bring in a senior independent engineer or firm — automated tools miss logic errors, poor architecture, and hidden backdoors.
  4. Document findings in a written report — categorized by severity (critical, high, medium, low). This report becomes your negotiating document if remediation is needed.

Honest Tradeoffs

ApproachCost signalBest for
Automated tools onlyLow / free tiers availableQuick first pass, small projects
Freelance senior engineerMid-rangeSpecific stack expertise
Independent audit firmHigherRegulated industries, large codebases, investor due diligence

CodeNicely offers independent code audits and can assess codebases built by any agency — not just their own work. That said, any experienced independent engineering firm or a US-based freelance CTO can do this competently; the key is that the auditor has no financial stake in the original build.

Related questions

How long does a code audit typically take?

It depends on codebase size and complexity. A focused audit of a small MVP might take a few days; a large enterprise system can take several weeks. Automated tooling runs in hours, but the manual review of architecture and security logic takes the most time.

Can I withhold final payment while the audit is in progress?

That depends on your contract. Many US development agreements allow you to withhold final payment until formal acceptance — review your contract's acceptance clause before engaging the agency. If there's no explicit clause, consult a US tech contract attorney before withholding payment to avoid a breach-of-contract claim.

What if the agency used open-source libraries with restrictive licenses?

This is a real risk in US commercial software. GPL-licensed libraries in a commercial product can require you to open-source your entire codebase. An audit should include a dependency license scan using tools like FOSSA or Black Duck to flag any license incompatibilities before you ship.

Should I audit the code before or after launch?

Before launch is strongly preferred, especially for any product handling user data, payments, or healthcare information. A post-launch audit is still valuable but riskier — vulnerabilities found after go-live may already be exploitable, and remediating them in production is more disruptive.

Want a direct answer for your project?

CodeNicely builds AI products, MVPs, and custom software for founders and teams worldwide. Tell us what you're building.

Talk to our team