matthelam logo
Published on

Agentic Studio: Stage 3, Part 2: Harness Features (Advanced)

Authors
  • avatar
    Name
    Matt Lam

Harness engineering is actively guiding the agent down the right path, not just asking it. Part 1 looked at the harness from the operational level. Part 2 looks at the tools Agentic Studio has to build out more targeted harness mechanisms.

Below is the video. Please watch it before you read the blog. Like the Part 1 post, this is an editorial talkback, not a recap. I've grouped my thoughts by topic, and a topic can draw on more than one part of the video.

Stage 3, Part 2: the SEO tune built as an agent workflow, harnessed by a tool per step, a schema, an HTML template and a human check.

You can also watch it on YouTube.

Quality it adds
Repeatability
What gets built
Part 1: the stage 2 chat and skill, with only the tools the tune needs ticked, and the SEO Jev Analyzer added as a custom MCP. Part 2: an agent workflow with one named tool per step, a schema, an HTML template and a human check.
Designed to show
The same input gives the same shape of answer, checked by a tool rather than by eye.

Further reading: Anthropic, Effective harnesses for long-running agents (opens in a new tab)

The task

How much does a casual bouldering session cost in Adelaide?

Page
/climb/casual-entry on matthelam Boulderfest, the same page as stages 1 and 2
Fields
Page title, meta description, Open Graph title, Open Graph description, JSON-LD structured data
Facts allowed
Only what the Boulderfest Brand Kit states, as in stage 2
Scored by
SEO Jev, out of 10
Pick a stage to see what it adds and what gets built. Each stage's task fills in as its post is released.

Low Barrier of Entry vs Control

In the video I compared a standard agent with a workflow. Agents are about freeform. They're good for exploring, or for starting a new process. Nothing's locked in, and it's cheap to start up. The cost is that it often gets more and more expensive as the complexity of your process increases. Think of getting to 70% as the easy and cheap part. Getting the last 30% is the hard part, and that's where workflows belong compared to unscripted agents.

A workflow leans much closer to a traditional implementation. The more you want to control, the more it becomes an API or integration project. So it's often expensive to implement, but it gives you higher-value outcomes, and it's a little cheaper to run on an agentic level. Not necessarily overall, but in how many tokens you spend.

Both are valid approaches. It really comes down to what you need to achieve, your budget, your timeframe and how complex your task is.

Agents can still get it wrong

In the video I made the comment that agents can still not tell the truth, or hallucinate. Ultimately that's true, and some models will do it more than others.

Something I've learned along the way: I think the Sitecore agents are running Copilot in the back end. That would make it a mixture of different models in the background, depending on the task being asked of it.

Overall, I'd say the risk of it outright lying is fairly small. It's more that the devil's in the detail, so you should always have a human in the loop to review the content. I don't think you could ever truly eliminate hallucinations, especially with what large language models are built on.

General knowledge can lead you down the wrong path

Something probably more relevant: if you just ask the agent for the values and a confidence, that's when a general knowledge set can lead you down the wrong path. That's why I'll be recommending you put in Brand Kits. I think the contents of a Brand Kit deserve a whole episode, and I want to go through them in detail in a separate one.

To cut to it, here's how I've mitigated it. In my SEO Jev Analyzer, I've paired it with the contents of the Brand Kit, where I have an intent statement. That at least tells the AI to push itself towards that intent, or base itself on that outcome: that measurement of good. I've also put it against several search terms, which correlate with the intent.

The whole point of the analyzer, with Jev as a decision engine, is to ask: how close is the content in our current metadata to being representative of the intent statement and the search terms? It returns a score out of 10.

I've counteracted that again by running it ten times over. I initially had it run a hundred times, and it turned out Jev is pretty consistent, which is why I like playing around with it. So I tuned it down to ten runs, to double-check before it returns a confidence rating. And it's super fast.

The HTML template is also a quality harness

One extra point on the HTML template. Because it's a consistent output, it's in its own way a harness on the AI's recommendations. It's also a quality harness. If nothing else, it helps you spot issues: you're looking at the same report every time, your eyes get set, and you more easily see missing fields or irregular output.

Widgets don't travel between instances

Apart from everything I said in the video about widgets, the biggest issue I hit was this. I'd created a widget I really liked, but I couldn't migrate it, copy it or move it to another instance in any way other than the prompt, even within my own subscription.

So I might have nailed the perfect widget, but I couldn't reuse it in production, because the widget only existed in dev. When I ran exactly the same prompt, it just wouldn't give me the same output.

I guess you'd have to invest heavily in a highly articulated prompt, and hope it gives you what you need in another instance ninety or ninety-nine percent of the time. Or, as I mentioned, it might just need a bit more growth before we can fully lean into it.

The approval gate: If/Else or a Loop

In the video, I said I wasn't getting what I needed out of the If/Else, so I used a Loop. That undersells it. While making this video, we tried many times to get an If/Else to take its true branch: around 30 ways of writing the condition, across two sessions. None of them passed, not even 1 === 1. I ran it again on 25 November, and it still goes to Else.

So this looks like a bug, and I'll raise it with Sitecore. Keep in mind it's a fast-moving ecosystem, though. Several issues I've found in the past were resolved quickly without me doing anything, so by the time you read this, it may already work.

Until then, the Loop does the job. The answer moves onto a Review Context Params card, and a Loop over the Approve answer holds the save. Approve runs it once. Reject runs it zero times, and the page isn't touched.

Here's the workflow again, step by step, so you can see where the human check and the gate sit.

  1. hands to
  2. hands to
  3. hands to
  4. then waits for
  5. gates
  6. then

Step 1 of 7

Read page

One Invoke Tool step that names one tool to read the Casual Entry page. The agent does not choose the tool.

The SEO tune as an agent workflow. Each step hands its result to the next; a person approves or rejects before anything is saved.

The irony: we're back to workflow automation

I can't resist saying something here, because I found it incredibly ironic, and actually quite funny.

The focus of this AI boom is on large language models in particular, and in many respects not on any other form of AI. I think most people call them reasoning models, or at least they're very capable of simulating how a human would reason.

The irony is that, as we move into enterprise implementations, we're more and more interested in workflow automation, which is something we've all been working on for most of our careers. Think of DevOps pipelines, any CI/CD release pipeline, even build steps and content syncs, from Unicorn all the way through to SCS. Even Jira, in its own way. We've chained together many technical steps and functions at a lower level to build our processes. So, as is typical, we're harnessing the AI reasoning and minimising it into highly controlled steps that don't involve any real AI at all.

That said, the biggest advantage of these workflows over the approaches we've used in the past is, as I said earlier, that they're cheaper. It's cheaper and more efficient to get an AI to do the small step where reasoning is genuinely required.

MCP connections should belong to an agent

In the video I said there isn't yet an option to add the SEO tool to the workflow, so I add the MCP tool at the start of every chat session where I've selected the custom agent. From inside the build, the workflow's Context tab holds a retrieval profile, with no place to attach a connection. The Invoke Tool picker lists Sitecore's 55 built-in tools and no MCP connectors. And inside a run, the steps didn't have the ticked connector either; the chat called SEO Jev after the run finished.

I genuinely think MCP connections should go as far as being instanced to an agent. I actually want to raise a ticket with Sitecore about this, or maybe start a conversation here.

Within a workflow, an MCP connector shouldn't need to be linked to the overall instance connection. It should be set up as a separate connection, with the ability to enter a service account with its own secret, password or OAuth. More should be allowed in the setup of an MCP connector, and then it should be locked to a particular agent or workflow agent. That way we, as developers, can help harness it in a way that's relevant to the company it's being set up for.

In its current form, I think there'd be a lot more hesitation to open an MCP connection up, because it's so open-ended. I understand where it's coming from. It reflects the typical AI IDE we're now seeing, such as Claude Desktop, or even VS Code. But Sitecore exists in a slightly different dimension. What I'm talking about leans a lot closer to your Azure DevOps or Azure portal type implementations. That's the closer analogy, so I think we should be seeing connection options much more in line with those platforms.

Next

That's Stage 3, Harness Engineering, done. Next in the series is Loop Engineering, where we take our harnessed agent and make it self-improve.