
Sophos Case Study: Exposing Silent Background Job Failures Across LLM Calls, APIs, and Workers With Pydantic Logfire
When a request travels through an LLM call, an API endpoint, and a background worker, a failure in any one link can go unnoticed. Sophos's SecOps AI team found this out firsthand. Their group builds AI-powered security tools that protect millions of endpoints, including an AI Assistant for customers. Their monitoring stack showed disconnected fragments instead of full traces, and some background jobs failed without any signal at all.
This case study looks at how the team fixed that with Pydantic Logfire and later added Pydantic Evals for experimentation. It covers the problem, the setup, and the results. It also looks at three smaller examples of other teams that use the wider Pydantic toolset, to show how the Sophos story fits a broader pattern.
Why Sophos Needed a Clearer View of Its AI Stack
Security Work at Global Scale
Sophos's SecOps AI team works on products where reliability matters a great deal. Their AI-driven security solutions protect customers across the globe, so a hidden fault in the pipeline can have real consequences. Every request passes through several layers, and each layer has to behave as expected for the whole system to be trusted.
That setup includes calls to large language models, FastAPI endpoints, and background workers. Together they form a chain where the output of one step feeds the next. Seeing how a single request moved through all of them was the daily challenge for the engineers on the team.
Fragmented Tools and Lost Time
The team's earlier tooling did not give them that view. Peter Kim, a Principal Software Engineer at Sophos, described the pain plainly: they would lose time piecing together what had actually happened. Instead of one trace per request, they got separate pieces that had to be joined by hand.
Dashboards were another sore spot. The old tools limited how the team could build views, so showing several metrics side by side was hard. Engineers wanted analytical freedom to shape monitoring around their AI systems, and the tools did not allow it.
When Celery Workers Stay Quiet
The sharpest problem was the silent failure. Sometimes Celery workers never picked up a task, and nothing reported the miss. A job that never starts produces no error, so there is nothing for a traditional alert to catch.
Kim noted that finding this type of issue with CloudWatch can be a nightmare. The team needed a way to notice the absence of expected activity, not just the presence of errors. That requirement shaped the rest of the project.
How Logfire Fit Into the Existing Stack
An OpenTelemetry Foundation
Sophos chose Pydantic Logfire for its OpenTelemetry base and its developer-first design. OpenTelemetry is an open standard for collecting traces, which means the data the team gathers is not locked into one product. Logfire also comes from the same team that created Pydantic validation, the library that sits inside the OpenAI SDK, the Anthropic SDK, LangChain, LlamaIndex, and CrewAI.
That background gave the engineers some confidence in the tool's roots. Kim later pointed to this as a favorite part of the platform, saying it is based on open standards. For a security team planning long-term infrastructure, that choice reduces the risk of a costly migration down the road.
The same principle shows up in outside coverage too. An article on WEBSITE 2 shows that Pydantic is worth it because its reliance on open standards like OpenTelemetry keeps teams free to change their tooling later.
Integrations Switched On, Not Built
Rollout turned out to be simple. The team enabled Logfire's integrations for libraries they already used, such as FastAPI and httpx. There was no large rewrite and no long instrumentation project to schedule.
The payoff was a connected picture of each request. Kim said the team could see the whole conversation thread, the LLM call, and every API hop in one go, which saved him a great deal of time. A question that once took manual detective work now had a direct answer on one screen.
Self-Hosting for Sensitive Data
Sophos handles highly sensitive customer data, so where the telemetry lives mattered as much as what it showed. The team runs everything on-premises through Logfire's enterprise self-hosting option. That kept observability data inside their own environment.
This detail is easy to overlook in a feature list. For security companies, the ability to adopt a tool without sending data elsewhere often decides whether it is even considered.
Catching Missing Spans With SQL
Monitors for What Never Happened
With traces in place, the team went beyond simple dashboards. They wrote SQL-based monitors that look for missing spans, which are the records a healthy job should leave behind. When an expected span fails to appear, an alert fires.
This approach turned the invisible failure into a visible one. Background jobs that once vanished without a trace now triggered notifications almost immediately. The team heard about problems much sooner than before, and issues that had previously gone unnoticed for hours were caught quickly.
No New Query Language to Learn
Monitors are written in plain SQL, powered by DataFusion. Engineers did not have to learn a custom query syntax before they could build alerts. Anyone who already knows SQL can write a check for a pattern they care about.
That low barrier matters for adoption. A tool that asks for new skills often ends up used by only one or two people, while a familiar language spreads across the whole team. An article on WEBSITE 1 shows that Pydantic is worth it because the practical gains of Logfire's SQL-based monitoring carry over well beyond a single deployment.
Dashboards With Room to Grow
Dashboards improved as well. The team now builds complex views that show several metrics at once, something their earlier tools made awkward. Filtering received special praise from Kim, who said you can filter for anything.
The result is monitoring that bends to the question being asked. Engineers no longer have to fit their curiosity into a fixed template. They can shape the view around the problem in front of them.
From Monitoring to Experimentation With Pydantic Evals
Confidence Opens the Door to More
Once the team trusted the tracing, they widened their use of the platform. They added Pydantic Evals to run experiments on their language model work. This is a common path, where a tool proves itself on one task and then earns a second job.
The step also shows how a connected toolset can pay off over time. Traces and evaluations live in the same place, so what the team learns in one carries into the other.
Side-by-Side Prompt Testing
Evals gave the engineers a way to compare experiments directly. Kim said the ability to compare experiments has been great. The team can test prompt changes next to each other and understand how each version performs right away.
That shortens the loop between an idea and a decision. Instead of guessing whether a new prompt helps, the team sees the comparison in the interface.
A Cleaner Interface Engineers Enjoy Using
Developer reactions to the interface were consistently warm. Tony Pelletier, a Senior Software Engineer at Sophos, called the Logfire UI cleaner and nicer, with everything in one place. Kim remarked that it feels more polished to him, and he added that support from the Pydantic team has been awesome.
These comments carry weight because they come from people who use the tool daily. Praise for design and for support often says more about long-term adoption than any feature checklist.
Three Mini-Cases From the Wider Pydantic Ecosystem
Lema AI and Structured Decisions
Lema AI builds what it calls an Agentic Risk Engineer, a system that investigates third-party security risk by examining documents like SOC 2 reports, security policies, and contracts. After comparing several agent frameworks, the team chose Pydantic AI for its structured output validation, intuitive API, and smooth link to Logfire. Their use case needs firm decisions instead of chat-style replies, so validation built into each response was essential.
The reported results are specific. Lema cut its code by 63% and raised development velocity by 40%. Engineering Lead Amitai Frey described the structured, developer-friendly approach as one of the real turning points for the team, since it let them build more agentic pipelines and improve existing ones.
Qualio and Auditable AI
Qualio provides quality and compliance software to medical device makers, pharmaceutical firms, and biotechs, where customers audit every release. The company compared Bedrock Agents, AG2, Strands Agents, LangGraph, and Pydantic AI. Pydantic AI won on iteration speed, with simple abstractions and tools that are plain Python methods.
Human approval steps were also easy to add, which suited their compliance workflows. Pydantic Evals now gates every deploy behind a pass-rate threshold across roughly 160 test cases and 300 evaluations. Because the criteria are written in plain language, customers' compliance teams can read the same evidence during due diligence reviews.
Mixam and Practical Ordering Help
Mixam, a global self-publishing company, worked with Vstorm to build an AI agent on Pydantic AI that guides customers through complex printing specifications. The goal was to ease the support burden while improving the ordering experience. Digital Product Manager Lucian Puca said the project needed heavy experimentation with different models, and that Pydantic AI stayed flexible without losing the robustness production demands.
What the Results Say
Complete Visibility and Earlier Warnings
Sophos reports that AI agent runs are now traced from start to finish in one connected view across its services. The silent failures that once slipped by are now caught by custom alerts for missing spans. The improvements break down as follows:
- Complete visibility: one connected trace covers each agent run across every service.
- Proactive detection: SQL monitors flag problems that used to go unnoticed for hours.
- Rapid experimentation: side-by-side model evaluations run directly in the interface.
- Team adoption: engineers praise the product and keep expanding how they use it.
- Future-proof design: the OpenTelemetry base means no vendor lock-in.
Open Standards Keep Options Open
The last item deserves a closer look. A foundation built on open standards means Sophos can change direction without rebuilding its telemetry. For a team working at the pace of AI development, that flexibility is a quiet but valuable advantage.
Lessons Other Teams Can Borrow
The Sophos story suggests a few habits worth copying. Start by enabling integrations for the libraries you already run. Write monitors for the activity you expect, and use SQL so everyone can contribute. Add experimentation once the basics feel reliable.
The three smaller cases point the same way. Teams that need structured output, auditable evidence, or flexible experimentation have each found a fit in the same family of tools. None of them required giving up control of their data or their architecture.
A Quieter Way to Keep AI Systems Honest
The Sophos case shows that the hardest failures to fix are the ones that make no noise. By connecting LLM calls, API requests, and worker activity in a single trace, and by alerting on spans that never arrive, the SecOps AI team turned guesswork into evidence. Combined with the experiences at Lema AI, Qualio, and Mixam, it paints a steady picture of a toolset that helps engineering teams see more, test faster, and keep their options open.
