# Why AI-Generated Code Is Easy but Engineering Trust Is Hard

[Salesforce](https://yomu.fyi/company/salesforce) · Scott Nyberg · Aug 20, 2026

**Type:** Problem & solution

## Summary

At Salesforce, engineering teams discovered that AI coding agents could produce internally consistent code and passing test suites that still failed to meet actual requirements. To ensure correctness before writing code, the team developed an agentic Spec-Driven Development workflow centered on explicit specifications and gated verification. The system separates evidence-based repository lookups handled by agents from subjective judgment calls escalated to human engineers. Implementation plans must cite repository evidence reviewed by a Skeptic Agent, while a Compliance Matrix traces each success criterion directly to executable test proof. Finally, a multi-agent review system evaluates the implementation under an asymmetric rule allowing an independent judge to downgrade passing checks but never override failed gates.

## Context

AI coding agents can generate code, unit tests, and pull requests that pass automated builds and human reviews while silently misinterpreting ambiguous requirements. Because agents can produce internally consistent implementations and tests based on flawed premises, standard verification steps fail to guarantee trust, while review capacity struggles to scale with generation volume.

## Approach / What changed

Salesforce introduced an agentic Spec-Driven Development workflow structured across four gated phases. First, a formal specification establishes requirements, assumptions, and success criteria before coding begins. Next, plans must prove repository grounding under review by an independent Skeptic Agent, distinguishing evidence-based lookups from human-escalated judgment decisions. Success criteria are converted into tests and mapped via a Compliance Matrix, followed by an adversarial multi-agent review process called Conclave, where an independent Judge Agent can downgrade results but cannot upgrade failed gates.

## Takeaways

- Uncertainty is split into lookup and judgment: agents resolve lookup questions by finding evidence in repository history, code, and tests, while humans handle judgment decisions that cannot be recovered from evidence.
- A Compliance Matrix maps every specification success criterion to executable test and implementation evidence, ensuring tests validate requirements rather than just self-consistent agent code.
- The Conclave multi-agent review process uses an asymmetric evaluation rule where an independent Judge Agent can downgrade passing results based on critic findings, but cannot upgrade a failed gate.

**Tags:** [Architecture](https://yomu.fyi/topic/architecture), [Code Review](https://yomu.fyi/topic/code-review), [Developer Experience](https://yomu.fyi/topic/developer-experience), [LLMs](https://yomu.fyi/topic/llm), [Testing](https://yomu.fyi/topic/testing)

[Read original post](https://engineering.salesforce.com/why-ai-generated-code-is-easy-but-engineering-trust-is-hard)
