Agent harness: putting guardrails on AI
Published on October 19, 2026
𝗔𝗴𝗲𝗻𝘁 𝗵𝗮𝗿𝗻𝗲𝘀𝘀: 𝗽𝘂𝘁𝘁𝗶𝗻𝗴 𝗴𝘂𝗮𝗿𝗱𝗿𝗮𝗶𝗹𝘀 𝗼𝗻 𝗔𝗜
"Using AI to code" and "putting guardrails on AI so it can't approve its own work" sound similar… but they're not the same 😅 The difference has a name: 𝗵𝗮𝗿𝗻𝗲𝘀𝘀.
Over the past few months I built an agent 𝗵𝗮𝗿𝗻𝗲𝘀𝘀 on top of two backend APIs for a digital health platform — in production, without freezing feature work. Months ago the repo didn't have a single test. Today it has more than 𝟳𝟬𝟬 🔥
What is a 𝗵𝗮𝗿𝗻𝗲𝘀𝘀? It's everything around the model:
→ 𝗖𝗼𝗻𝘁𝗲𝘅𝘁: what the agent knows about the repo (architecture, rules, danger zones)
→ 𝗙𝗹𝗼𝘄: commands that guide plan → implementation → approval
→ 𝗥𝗲𝘃𝗶𝗲𝘄𝗲𝗿𝘀: subagents that review without seeing the conversation or the plan
→ 𝗚𝗮𝘁𝗲𝘀: hooks and CI that block when something doesn't hold
What's it for? To make the coding agent an 𝗮𝘂𝗱𝗶𝘁𝗮𝗯𝗹𝗲 member of the team, not a diff generator you just have to trust 💻
✅ The good:
→ Rules versioned in the repo and shared with the whole team
→ 𝗧𝗗𝗗 with real evidence: the proof comes from 𝗴𝗶𝘁, not from what the AI says
→ Two 𝗵𝘂𝗺𝗮𝗻 𝗴𝗮𝘁𝗲𝘀 the agent can't skip: approving the plan and approving the commit
⚠️ The cost:
→ Building it: months of iterating and fixing bugs in the harness itself
→ Maintaining it: two "identical" scripts drifted by more than 𝟭𝟬𝟬 lines in a few weeks
→ It's not foolproof: it makes cutting corners deliberate and visible, not impossible
💡 Fun fact: an AI review of a diff with more than 5,000 lines took almost 3 minutes and cost just over 𝟭 𝗨𝗦𝗗. The expensive part wasn't the AI… it was my own hook killing it after a minute and a half.
This is the first post of a series 🚀 In the next ones I'll walk you through each piece — and the mistakes that taught me more than the wins.
Are you already using AI agents to code? Do you put any guardrails on them, or do you trust what they generate? Tell me 👇
Keep flying, Champions! ✈️