Skip to main content

Using AI to Build AI: How Agentforce Engineers Scale Automation Without Sacrificing Reliability

Fereydoon Vafaei
Nov 09 - 7 min read
Using AI to Build AI: How Agentforce Engineers Scale Automation Without Sacrificing Reliability featured image

In our Engineering Energizers Q&A series, we highlight the engineering minds driving innovation across Salesforce. Today, we spotlight Fereydoon Vafaei, a Principal Software Engineer on the Agentforce team, who faced a formidable challenge: using AI engineering automation to help build and maintain the Atlas Reasoning Engine, the brain of Agentforce, without allowing unreliable AI-generated work to compromise it. By solving that problem, the team reduced typical bug-resolution time from two to four weeks to one or two days while helping system availability reach 100% in weekly reports during the observed period.

Explore how Fereydoon’s team connected fragmented engineering knowledge through semantic retrieval and combined layered AI evaluation with human oversight to scale automation without sacrificing reliability.

What is your team’s mission, and what made safely automating the Atlas Reasoning Engine’s software engineering lifecycle so difficult?

The central risk was that AI could diagnose a problem, modify the Atlas Reasoning Engine, test the fix, and review its own work while being confidently wrong. Models can generate unreliable findings, favor their own output, and struggle to evaluate decisions without validated ground truth. Because AI was being used to help engineer the brain of Agentforce, reliability had to govern everything that was automated.

Within that constraint, the mission is to make the reasoning engine’s full software engineering lifecycle repeatable, observable, reusable, and increasingly autonomous. That includes development, testing, shipment, maintenance, enhancements, problem diagnosis, and bug resolution. The goal is not simply to use AI to write code faster. It is to use AI-assisted software development to help build, observe, evaluate, and continuously improve an AI system while engineers retain visibility and control wherever outcomes cannot be safely verified or reversed.

In practice, that means applying the same principles that make an agent reliable at runtime, including persistent memory, orchestration, grounding, verification, and feedback, to the way the reasoning engine itself is built. Agentforce uses the reasoning engine to reason about a customer’s work; the team uses those same agentic principles to reason about how the engine is developed, tested, shipped, and maintained.

The same loop that runs the reasoning engine builds it.

Why did fragmented engineering knowledge make recurring Atlas Reasoning Engine failures harder to diagnose and prevent?

Before this automation shift, engineering work could resemble thousands of disconnected islands. Hundreds of engineers responded to incidents across different parts of the Atlas Reasoning Engine, but there was no reliable, systematic way to preserve and share everything they learned. Teams could repeat investigations or rediscover resolutions that already existed elsewhere. The engine’s modular architecture made those patterns harder to recognize. Modules can operate independently without being fully aware of what is happening elsewhere, so related failures may not look connected.

In response, the team began building an integrated engineering knowledge base that connects incidents with previous fixes, code, Slack discussions, and notes from incident bridges. Semantic retrieval is essential because related incidents do not always share the same titles, keywords, or terminology. The system can connect information through semantic and technical similarity, helping engineers discover relevant history that conventional keyword search could miss. It also prunes outdated and superseded information as the codebase evolves, countering the context bloat that degrades retrieval-augmented coding agents and preserving useful engineering knowledge without letting obsolete material overwhelm the current signal.

Every fix feeds memory that informs the next investigation.

What made measuring the speed, scale, and reliability of AI engineering automation challenging?

The measurement challenge was proving that automation improved the entire software engineering lifecycle when its impact varied across workflows and was still being quantified. Faster code generation alone would not demonstrate better engineering. The team needed evidence that AI-assisted bug resolution reduced resolution time, AI code review expanded capacity, knowledge retrieval surfaced the right information, and system reliability improved without weakening human accountability.

In response, the team measures several concrete signals. A bug ticket that previously required one or two two-week sprints can now be resolved in approximately one or two days. An agent developed by the team can also perform approximately 10 automated code reviews at once, allowing engineers to inspect its findings and sign off on the results instead of conducting every review individually. Knowledge retrieval is evaluated through precision and recall, measuring whether the system finds relevant information without introducing excessive noise or missing important context. System availability has also reached 100% in weekly reports during the observed period, a level those reports had not previously achieved.

Not every improvement can be generalized across every workflow, but bug-resolution time, AI code-review scale, retrieval quality, and availability give the team concrete ways to measure progress.

How could you trust AI to evaluate AI-generated code and fixes when models can favor their own work and no ground truth exists?

AI evaluation became the hardest engineering problem because every AI-generated diagnosis or code fix must eventually be judged. The team needed to determine whether the diagnosis was correct, whether the resolution worked, and whether the change introduced other risks. Yet many situations had no established answer or ground truth against which the system could compare its work.

Another AI evaluation step did not automatically solve the problem. Models can exhibit self-preference bias, favoring work produced by the same model and creating a circular process in which AI generates and evaluates its own engineering work. Returning every decision to an individual human would strengthen oversight but restrict the scale that automation was meant to create.

The team addressed that tension through layered, iterative evaluation and an agent-as-a-judge model with human in the loop. Because the reasoning engine is nondeterministic, there is rarely a single correct output to compare against. The team therefore evaluates the agent’s full trajectory: the intermediate reasoning, tool calls, and decisions along the way, not just the final response. It uses scenario tests, replay, and mutation testing against a reusable regression dataset run both locally and against the deployed service. Evaluating the whole trajectory, rather than only the final answer, shows the system reasoned its way to a correct fix instead of passing by chance.

Different models and specialized AI agents review the work from different perspectives, following established LLM-as-a-judge practice so that no model grades its own work and the self-preference bias is held in check. Some perform engineering tasks, while others specialize in judging the results. Engineers then oversee evaluations across many incidents, identify patterns, and sign off on the findings. This combination of diverse AI judges, multiple evaluation layers, and human oversight increases confidence without giving up scale.

Different models judge each other; engineers sign off.

What made safely increasing AI autonomy while preserving human oversight so challenging?

The danger was treating every software engineering task as equally safe to automate. AI might perform a bounded code change with a verifiable outcome, but an architectural decision could affect the entire organization. If requirements were ambiguous, production impact was high, or the system lacked a reliable reference, greater AI autonomy could increase risk instead of reducing it.

To manage that tension, the team uses a risk-based autonomy model. Automation is applied aggressively when outcomes are strongly verifiable, actions are bounded or reversible, the system has sufficient context, and failures are detectable. Human oversight and engineering judgment are preserved when those conditions are not met. In practice, that line is explicit: agents design, implement, review, and deploy changes to non-production environments, but they never merge to the main branch or deploy to production without explicit human approval.

Bug reproduction demonstrates that boundary. Before fixing an issue, an engineer typically recreates it to confirm that it exists and is not a false positive. AI can struggle when that process requires access across secure environments or authentication involving a human. The team therefore considers whether an outcome can be verified, the system has sufficient knowledge, failure would be detectable, and the risk is manageable before determining how much autonomy to allow.

The next challenge is moving from cognition toward metacognition. AI can perform engineering work without fully understanding its broader consequences, so greater autonomy will require stronger evaluation, observability, guardrails, and risk controls. A further frontier is proactive detection: shifting from automation that responds to reported issues to automation that surfaces and fixes them before they are reported. The goal is not to eliminate engineers. It is to shift them from performing isolated tasks to architecting the system, supervising its behavior, evaluating patterns, and controlling consequential decisions.

Learn more

Related Articles

View all