Reviews and auditing with AI
Reviews and audits involve reading a great deal of material against a set of rules: designs against principles, code and infrastructure against standards, evidence against controls. That makes them a natural fit for AI, which can read a whole repository or a stack of policies in minutes and point to where something looks wrong.
But a review is only as trustworthy as its findings. AI produces false findings with total confidence, and misses context-specific risks no checklist covers. The pattern that works: deterministic tools enforce, AI drafts and explains, humans decide.
Diagram
Section titled “Diagram”- The assistant reads intended design, built code and infrastructure, and runtime evidence against your standards.
- It drafts findings, each pointing to the exact file, line, diagram or document behind it.
- A person confirms or rejects each finding, assigns an owner and decides severity. Unconfirmed findings don't count.
Workflow 1: Review a design against your standards
Section titled “Workflow 1: Review a design against your standards”You are reviewing an architecture design for [organization].Our principles and standards:[paste principles, or a well-architected checklist]
Design under review:[paste design document or ADRs]
For each principle or checklist item, state: MEETS, PARTIAL, DOES NOT MEET,or NOT ADDRESSED. Quote the part of the design that supports yourassessment. Then list the top five risks, most severe first.If the design doesn't give you enough information, say so; do not assume.Verify: check every quote really appears in the design and means what the AI says. Use the output to focus the human review, not replace it. Well-architected checklists from AWS, Azure and Google Cloud make good starting standards.
Workflow 2: First-pass threat model
Section titled “Workflow 2: First-pass threat model”Here is a data flow description of a system, with trust boundaries marked.[paste description or diagram source]
Apply STRIDE to each element and each flow that crosses a trust boundary.For each threat: the element, the STRIDE category, a one-line attackscenario, and a suggested mitigation. Mark threats you consider mostlikely and most damaging. Do not include generic threats that don'tapply to this design.Verify: run the session with the team anyway. AI gives breadth quickly; people supply the risks specific to your business, data and history. See threat modeling.
Workflow 3: Check that what was built matches what was designed
Section titled “Workflow 3: Check that what was built matches what was designed”Architecture drifts. The service that should only call the API gateway now reads another team’s database directly. Two approaches work together:
- Deterministic fitness functions enforce rules on every build: dependency rules in code (for example, ArchUnit for Java), policy as code for infrastructure, contract tests for APIs. These are reliable and repeatable.
- AI helps write those rules, explains failures in plain language, and does one-off sweeps for things that are hard to express as rules.
Our architecture rules:- [e.g. services only access their own database]- [e.g. all external calls go through the integration layer]- [e.g. no personal data in logs]
Review the code and configuration below. For each rule, list anyviolations with file and line, and explain in one sentence why itviolates the rule. Then suggest an automated check (test, lint rule orpolicy) that would catch this in future.
[attach repository or files]Verify: reproduce each violation yourself before raising it. Then turn the useful rules into automated checks so they’re enforced deterministically, not by asking the AI again next quarter.
Workflow 4: Map audit evidence to controls
Section titled “Workflow 4: Map audit evidence to controls”Below are the controls we must evidence for [framework, e.g. SOC 2,PCI DSS, internal policy], and a set of artifacts (policies, configs,screenshots, tickets, logs).
Build a table: control | evidence that supports it (artifact name andsection) | strength (strong / partial / none) | what's missing.Only cite artifacts provided. If no artifact supports a control, say"none" rather than guessing.
[controls][artifacts or descriptions]Verify: auditors check the evidence, not the table. Open every cited artifact. The “none” and “partial” rows are the valuable part: they tell you where to act before the auditor arrives. See scenario: audit season panic.
Workflow 5: Find patterns across incidents and reviews
Section titled “Workflow 5: Find patterns across incidents and reviews”Here are [N] postmortems and architecture review reports from the lasttwo years. Identify recurring causes, components that appear repeatedly,and recommendations that were made more than once but apparently notimplemented. Cite the documents for each pattern.This is often the most revealing review of all, and almost impossible to do by hand.
What to watch out for
Section titled “What to watch out for”- False positives stated as facts. A finding without a precise reference should not leave the review.
- False negatives. “No issues found” from an AI means nothing. Absence of evidence is not evidence of absence.
- Checklist blindness. The worst risks are often specific to your system and not on any list.
- Sensitive material. Code, configs and audit evidence may contain secrets and personal data. Strip them, and use approved tools. See guardrails.
- Auditor expectations. Tell auditors how AI was used, and keep the human sign-off visible.
Related pages
Section titled “Related pages”- Threat modeling
- Well-architected frameworks
- Infrastructure as code, including policy as code
- Incident management
- Prompt library
Further reading
Section titled “Further reading”- Neal Ford, Rebecca Parsons, Patrick Kua and Pramod Sadalage, Building Evolutionary Architectures, 2nd ed. (O’Reilly, 2022), on fitness functions
- ArchUnit (opens in a new tab), architecture rules as unit tests for Java
- OWASP, Threat Modeling Cheat Sheet (opens in a new tab)
Written and edited by Abhinav Taduka, enterprise software architect.
New pages are added regularly. Follow Abhinav on LinkedIn to see them first.