<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz" -->

---
title: Building a Robust Harness for agent in production: Feed...
description: A case study from monday.com on building a production harness around their feedAgent, an AI agent that curates personalized activity feeds for workspace...
canonical: https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Building a Robust Harness for agent in production: Feed agent case-study | daily.dev
og:description: A case study from monday.com on building a production harness around their feedAgent, an AI agent that curates personalized activity feeds for workspace...
og:url: https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz
og:image: https://api.daily.dev/og/posts/SpQSGATuZ.png
og:image:alt: Building a Robust Harness for agent in production: Feed agent case-study
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Building a Robust Harness for agent in production: Feed agent case-study

**[monday Engineering](https://daily.dev/sources/monday)** · 11 min read · 1 upvotes · 1 comments

## Summary

A case study from monday.com on building a production harness around their feedAgent, an AI agent that curates personalized activity feeds for workspace members. The harness is organized around three failure points: data and context (input preprocessing, PII removal, alias-based hallucination detection, prompt caching), agent flow (output schemas, retry logic, model call and recursion limits, tool error handling), and feedback loops (LangSmith tracing, event logging, a learning loop combining explicit user rules and inferred behavioral signals, and offline/online evals). Built on LangChain's agent architecture, the harness is extended with business-specific guardrails to keep the agent reliable, bounded, and improving over time.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://engineering.monday.com/building-a-robust-harness-for-agent-in-production-feed-agent-case-study>

## Questions this post answers

### How can I prevent an LLM agent from hallucinating citations in structured output?

Replace raw IDs in the prompt with short aliases, then verify every alias the model cites against the original data after the run. Any citation that doesn't resolve to a valid activity ID is treated as a hallucination, dropped, and logged, so hallucinated references never reach the final structured output.

_daily.dev surfaces engineering deep dives like this for teams hardening LLM agents against hallucination._

### What is LangChain's modelCallLimitMiddleware used for?

It bounds how many times an agent invokes the underlying model during a single run, with an exitBehavior of 'end' triggering a safe stop instead of letting the run fail unhandled or loop indefinitely. It works alongside a separate recursion limit that caps how many loop iterations the agent's graph can execute, giving two independent safety bounds on run length.

_engineers designing bounded agent loops can track patterns like these on daily.dev before shipping to production._

### How do you stop an LLM agent from returning free-form text instead of structured JSON?

Force the model to emit its response through a schema-validated tool call rather than trusting it to produce valid JSON directly. If the model misses the schema, retry the call with the validation error fed back as context so the model can correct its output on the next attempt.

_developers building structured-output agents can find implementation patterns like this via daily.dev._

## Community discussion

Top comments from developers on daily.dev.

**@leonidbugaev** · 0 upvotes

> The alias swap is the part I'd keep. An invented citation has nothing to resolve, so you drop it. A raw activity ID wouldn't fail that way.

## Similar posts on daily.dev

- [Harness engineering for coding agent users](https://daily.dev/posts/harness-engineering-for-coding-agent-users-ujzvxz4ny) · Martin Fowler · 2 upvotes · 0 comments
- [Building an Advanced Agentic Harness](https://daily.dev/posts/building-an-advanced-agentic-harness-oia5opvy8) · Hacker News · 0 upvotes · 0 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#prompt-engineering](https://daily.dev/tags/prompt-engineering), [#langchain](https://daily.dev/tags/langchain), [#llm-observability](https://daily.dev/tags/llm-observability)

[View this post on daily.dev](https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Building a Robust Harness for agent in production: Feed agent case-study","url":"https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz"},"datePublished":"2026-09-09T08:28:54.462Z","dateModified":"2026-09-13T21:13:44.171Z","description":"A case study from monday.com on building a production harness around their feedAgent, an AI agent that curates personalized activity feeds for workspace...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e57055347f0ba7733420b2e92b3c66ab?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e57055347f0ba7733420b2e92b3c66ab?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"monday Engineering","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"monday Engineering","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/3bce2c4601a8468097dd077a4a9e1417","url":"https://daily.dev/sources/monday"},"commentCount":1,"discussionUrl":"https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":1}],"keywords":"ai-agents,prompt-engineering,langchain,llm-observability","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"monday Engineering","item":"https://daily.dev/sources/monday"},{"@type":"ListItem","position":3,"name":"Building a Robust Harness for agent in production: Feed agent case-study"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz","comment":[{"@type":"Comment","text":"The alias swap is the part I’d keep. An invented citation has nothing to resolve, so you drop it. A raw activity ID wouldn’t fail that way.","datePublished":"2026-09-09T11:00:02.630Z","url":"https://daily.dev/posts/SpQSGATuZ#c-PascwFACm","author":{"@type":"Person","name":"Leonid Bugaev","url":"https://daily.dev/leonidbugaev","image":"https://lh3.googleusercontent.com/a/ACg8ocLhMgurwTmJElWaH9A8Ju8cHvZxgMCDt009jEYkmFCyUGAoaGSw=s96-c"}}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/building-a-robust-harness-for-agent-in-production-feed-agent-case-study-spqsgatuz#faq","mainEntity":[{"@type":"Question","name":"How can I prevent an LLM agent from hallucinating citations in structured output?","acceptedAnswer":{"@type":"Answer","text":"Replace raw IDs in the prompt with short aliases, then verify every alias the model cites against the original data after the run. Any citation that doesn't resolve to a valid activity ID is treated as a hallucination, dropped, and logged, so hallucinated references never reach the final structured output. daily.dev surfaces engineering deep dives like this for teams hardening LLM agents against hallucination."}},{"@type":"Question","name":"What is LangChain's modelCallLimitMiddleware used for?","acceptedAnswer":{"@type":"Answer","text":"It bounds how many times an agent invokes the underlying model during a single run, with an exitBehavior of 'end' triggering a safe stop instead of letting the run fail unhandled or loop indefinitely. It works alongside a separate recursion limit that caps how many loop iterations the agent's graph can execute, giving two independent safety bounds on run length. engineers designing bounded agent loops can track patterns like these on daily.dev before shipping to production."}},{"@type":"Question","name":"How do you stop an LLM agent from returning free-form text instead of structured JSON?","acceptedAnswer":{"@type":"Answer","text":"Force the model to emit its response through a schema-validated tool call rather than trusting it to produce valid JSON directly. If the model misses the schema, retry the call with the validation error fed back as context so the model can correct its output on the next attempt. developers building structured-output agents can find implementation patterns like this via daily.dev."}}]}
```

