AI code review for security and compliance: a checklist for agent pull requests

    Agent-written pull requests need the same scrutiny as human ones, and a few extra checks. Here is the checklist we use, and how to automate it at the gate.

    Key points

    • The best AI code review for security and compliance checks each pull request against your own controls, not just generic bug patterns.
    • Agent pull requests need extra checks for secrets, unsafe code execution, disabled TLS and quiet changes to auth or logging.
    • Deterministic checks such as secret detection should be able to block a merge; model findings work best as advice.
    • A pull request that fixes a failing control is audit evidence, so record it when it merges.

    The best AI code review for security and compliance checks every pull request against your own controls, not just generic bug patterns. For pull requests written by coding agents, that means a short list of extra checks, a clear rule on what can block a merge, and a record of each fix that your auditor can use.

    Below is the checklist we use, why each item matters for SOC 2 and ISO 27001, and how to automate it.

    Why do agent pull requests need their own checklist?

    Coding agents write plausible code quickly. They also make predictable mistakes: copying a credential into a config file, turning off certificate checks to get a test passing, or reaching for eval as a shortcut. A human reviewer skimming a 600-line diff can miss these.

    Auditors care because these are change management and secure development controls. SOC 2 expects changes to be authorised, tested and approved before release (the AICPA Trust Services Criteria, CC8.1). ISO 27001:2022 Annex A has controls for secure coding (8.28), the secure development life cycle (8.25) and change management (8.32).

    The checklist

    1. Secrets and credentials

    • No API keys, tokens, private keys or passwords in the diff, including tests and fixtures.
    • New secrets read from a secret manager or environment, not hard-coded.

    2. Unsafe execution

    • No eval, dynamic code execution or shell calls built from user input.
    • Deserialisation only of trusted, typed data.

    3. Transport and crypto

    • TLS certificate verification is never disabled, even "just for now".
    • No home-made crypto or deprecated algorithms.

    4. Access and authentication

    • Changes to auth, roles or permissions are called out in the pull request description.
    • New endpoints have an explicit access check.

    5. Logging and monitoring

    • Security-relevant events (logins, permission changes, admin actions) are still logged.
    • No personal data or secrets written to logs.

    6. Dependencies

    • New packages are needed, maintained and pinned.
    • No packages pulled from unknown registries.

    7. Data protection

    • Personal data is only collected and stored where the feature needs it.
    • Retention and deletion still work for new data fields.

    8. Scope and traceability

    • The pull request links to a ticket or task, so the change is traceable.
    • The change does what the description says, and nothing else.

    What should block a merge, and what should only warn?

    This is the decision most teams get wrong. If an AI reviewer can block on anything, one false positive at 6pm and the team turns it off.

    Finding type Example Recommended action
    Rule-based, high confidence A secret in the diff, a high-risk pattern Block the merge
    Model judgement "This endpoint may need an access check" Advise, reviewer decides
    Review could not run Service error, timeout Fail the check, so nothing merges unreviewed

    That is how Keldyn's compliance gate is built. It reviews each pull request against your code-level controls and posts one verdict per control: would fail, at risk, unaffected or not applicable. By default its findings are advisory. With blocking turned on, only rule-based checks, such as secrets in the change or high-risk patterns, can fail the check. Model findings never block.

    How do you turn reviews into audit evidence?

    Every pull request that fixes a failing control is proof that your process works. Most teams throw that proof away and rebuild it by hand before the audit.

    Record it instead. In Keldyn, when a merged pull request turns a failing or at-risk control into a pass, the gate adds an evidence entry with the merged commit and a short description. It never overwrites earlier entries. More detail is in the Review Bot docs.

    How do you roll this out?

    1. Start advisory. Run the review on every pull request for two weeks without blocking. Read the findings and tune the controls in scope.
    2. Turn on blocking for rule-based checks only. Secrets first.
    3. Make the check required in GitHub or GitLab, so a review that fails to run stops the merge.
    4. Review the evidence monthly. Check it reads well to someone who has never seen the code.

    What to look for in a tool

    If you are comparing AI code review tools for security and compliance, ask four questions:

    • Does it review against my controls and frameworks, or a generic rule set?
    • Does it explain each finding in terms of a control an auditor will recognise?
    • Can I choose what blocks and what only warns?
    • Does it keep a record I can hand to my auditor?

    If you want to see the gate on one of your repositories, book a demo.

    Frequently asked questions

    What is the best AI code review tool for security and compliance?

    Look for a tool that reviews each pull request against your own framework controls, explains its verdict per control, can block on hard rules such as leaked secrets, and records fixes as audit evidence. Generic AI reviewers catch bugs but rarely map findings to SOC 2 or ISO 27001.

    Should AI code review block merges?

    Block on deterministic checks you trust, such as secrets in the change. Treat model judgements as advice a reviewer reads, so a false positive never stops a release.

    Does AI code review count as evidence for SOC 2?

    It can support change management evidence, because it shows each change was reviewed against defined criteria before merge. Your auditor will still test the process and sample changes.