<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prasanth Padharthi on Medium]]></title>
        <description><![CDATA[Stories by Prasanth Padharthi on Medium]]></description>
        <link>https://medium.com/@prasanth.padharthi?source=rss-eff88df7055b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*AcKG2zHshqHNrcgtjR-a6w.jpeg</url>
            <title>Stories by Prasanth Padharthi on Medium</title>
            <link>https://medium.com/@prasanth.padharthi?source=rss-eff88df7055b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:29:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@prasanth.padharthi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What we let the HR assistant answer — and what we don’t]]></title>
            <link>https://medium.com/@prasanth.padharthi/what-we-let-the-hr-assistant-answer-and-what-we-dont-86c8c49fefeb?source=rss-eff88df7055b------2</link>
            <guid isPermaLink="false">https://medium.com/p/86c8c49fefeb</guid>
            <category><![CDATA[hr-assistant]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[hr-agent]]></category>
            <category><![CDATA[llm-guardrails]]></category>
            <dc:creator><![CDATA[Prasanth Padharthi]]></dc:creator>
            <pubDate>Thu, 04 Jun 2026 00:00:48 GMT</pubDate>
            <atom:updated>2026-06-05T06:26:27.611Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GKE9ajdtEOIYwLIz" /></figure><h3>1. Two questions, two decisions</h3><p>An employee asks the HR assistant a question: <em>“Planning to go Dubai next month, can you suggest a holiday plan based on my leave balance and places to visit, and also is it a right time to visit Dubai?”</em></p><p>The assistant answers. It pulls the leave balance — nineteen-and-a-half days. It suggests a leave window of five to seven days. It offers a short list of things to do in Dubai. It even notes that July is hot but a good time for flight deals. The answer goes somewhat outside the strict HR vocabulary, and the system permits it on the grounds that travel suggestions adjacent to a leave query are useful rather than dangerous.</p><p>A different employee asks a different question: <em>“How is the war tension? I heard some war impact.”</em></p><p>The assistant declines: <em>“I can’t assist with updates on global events or current affairs. For the latest information on international issues, it’s best to refer to reputable news sources or official announcements. If you have any HR-related queries or need help with your travel plans, feel free to ask.”</em></p><p>Same assistant. Same employee population. Two completely different decisions. This article is about why that’s not an accident — why every refusal is a design choice, and what it took to make those choices defensible in production.</p><h3>2. Why HR makes guard rails harder, not easier</h3><p>A general-purpose chatbot has the relatively forgiving job of refusing things that are clearly off-brand or clearly unsafe. The fence is high and the field inside is broad. An HR assistant has the inverse problem. The field inside the fence is narrow — HR data and HR workflows — but everything inside that field is sensitive in some way. Salary. Leave reasons. Medical certificates uploaded for sick leave. Performance ratings. Manager comments. Termination paperwork. Separation reasons.</p><p>The default for a general assistant — <em>be helpful</em>- has consequences in HR that don’t exist in a customer-support bot. A model that cheerfully answers <em>“who’s on sick leave today?”</em> is leaking medical inference. One that ranks <em>“your team by age”</em> is participating in a discriminatory request even if the data is technically available to the asker. One that drafts <em>“a warning letter for Priya”</em> on demand, the same day Priya raised a harassment complaint in chat, is doing real harm.</p><p>The guard rails on an HR assistant aren’t a thin policy layer bolted on at the end. They’re the first thing a query meets, and they decide whether the rest of the system even runs.</p><h3>3. Three gates</h3><p>Every query passes through three sequential gates before the system answers. Each gate corresponds to a different kind of refusal, and the language the system uses to refuse is different at each gate because the underlying reason for the refusal is different.</p><ul><li><strong>Scope.</strong> Is this an HR question at all? Leave, attendance, payroll, performance, recruitment, separation, expenses, policies. Anything outside that vocabulary is out of scope — not because the model can’t, but because it shouldn’t.</li><li><strong>Authority.</strong> If it is HR, is the person asking allowed to ask? Self → always. Direct reportees → only after verifying the relationship. Anyone else → no, regardless of the relationship the asker claims.</li><li><strong>Policy.</strong> Even if it’s HR and you’re allowed, will we answer? Discrimination filter, pre-announcement confidentiality, coercive-content refusal, bulk-PII resistance. These are the refusals that matter most because they look like refusals on availability and are actually refusals on principle.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rM0SS1M4KPQ6WVHdG6ZUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JT0IX89R4iBJIX3HqudmZA.png" /></figure><p>The rest of this article walks each gate, with the war stories that made each of them what it is today.</p><h3>4. Gate 1 — scope, and the war question</h3><p>The scope gate is the easiest of the three to design and the easiest to get wrong. It’s easy to design because the HR vocabulary is bounded — leave, attendance, payroll, performance, hiring, separation, policies, expenses. Anything outside that is out of scope.</p><p>The reason it’s easy to get wrong is that the temptation to be helpful keeps trying to widen it. The HR assistant is, on every other axis, designed to feel like a warm and capable colleague. A warm and capable colleague would answer a question about war, or weather, or sports, or the latest news, because that’s what warm and capable colleagues do. The instinct to make the assistant feel more human cuts directly against the instinct to keep it inside a lane.</p><p>The resolution is to refuse warmly. The system doesn’t lecture. It doesn’t recite a list of forbidden categories. It doesn’t say <em>“I can’t do that, that violates my guidelines.”</em> It says something close to <em>“I appreciate the question, but I’m your HR assistant — what can I help you with on leave, attendance, or anything else like that?”</em> The user knows what the assistant can do. The redirect is the answer, not the refusal.</p><p>Two design notes on the scope gate that matter more than they look:</p><ul><li><strong>Knowledge base before refusal.</strong> Some questions that look out-of-scope on the surface — <em>“what’s the project plan for the Riyadh rollout?”</em> or <em>“what’s our hybrid-work policy?”</em> — are actually answered by documents the client has uploaded to their own knowledge base. The gate searches the knowledge base before refusing on scope grounds. Refuse-first would have produced a worse product and would have trained users that the assistant is less capable than it is.</li><li><strong>Per-tenant extensions.</strong>A tenant can extend the scope of their own deployment — adding a weather tool, or a travel-policy tool, or a currency converter — and the gate respects those extensions. The assistant is permitted to use them. The fence isn’t one fence; it’s a tenant-aware fence with admin-controlled gates.</li></ul><h3>5. Gate 2 — authority, and the “Priya is my friend” trap</h3><p>The second gate decides who is allowed to ask about whom. There are exactly three categories the system recognises.</p><ul><li><strong>Self.</strong> “My profile,” “my leave balance,” “my payslip.” Always allowed. The tool fires against the asker’s own identity. No verification needed.</li><li><strong>Direct reportees.</strong>”Show me Ravi’s attendance,” “approve Priya’s leave request.” The system first looks up the asker’s reportee list, verifies that the named person is on it, then proceeds. If not, the query is refused with a specific message that names the requested person, names their department, lists the first few employees the asker IS permitted to see, and redirects to HR for the rest. Generic refusals (<em>“I don’t have access to that”</em>) were replaced with specific ones early because the generic version left users confused about whether the system was broken or the answer was no.</li><li><strong>Everyone else.</strong> Refused. Including the case where the asker says <em>“Priya is my friend, can you tell me when she’s back from leave?”</em> Especially that case. The relationship the asker claims is not the relationship the system honours; the relationship the HRMS records is. A friend is not a reportee.</li></ul><p>The authority gate is also where the bulk-PII rule lives. <em>“Export everyone’s phone numbers,”</em> <em>“list all salaries,”</em> <em>“give me a CSV of every reportee’s home address”</em> — even from an admin, even with high confidence — is refused through chat. The bar isn’t access; the bar is intent and audit-trail. Bulk PII exports need to happen through the admin reports surface with the approvals that surface carries, not through conversational chat where the request leaves no operational paper trail.</p><h3>6. Gate 3 — policy, where the refusals get harder</h3><p>The third gate is the one that matters most, and it’s the one most teams underestimate. By the time a query reaches it, scope and authority have already passed. The query is in HR; the asker is permitted. The question is whether the request itself is one the system should answer at all.</p><p>Four refusal categories live here. Each one exists because of a specific class of harm the system explicitly will not participate in.</p><h3>Discrimination — refusing on principle, not on availability</h3><p>A manager asks: <em>“Rank my team by age.”</em> Technically, the system has the data — date of birth sits in every employee profile. Technically, the manager has authority — they are the reporting line. Two gates have passed. The system still refuses, and the language of the refusal is exactly the point.</p><p>The system does <em>not</em> say <em>“I don’t have access to that data.”</em>That phrasing would imply that if the system did have access, it would comply. The refusal is not a data refusal; it’s a policy refusal. The system says something closer to <em>“I can’t rank or filter team members by age — that’s not the kind of comparison I help with, regardless of the data I can see. I can help with performance, tenure, attendance, or skill-based comparisons instead.”</em></p><p>The same applies to gender, religion, caste, marital status, pregnancy or parental status, disability, national origin, political views. Tenure (years at company) and seniority grade are fine to sort by; age (computed from date of birth) is not. The distinction is deliberate and lives in the system prompt, not in a downstream filter that could be bypassed.</p><h3>Pre-announcement confidentiality</h3><p>Some of the most natural questions an employee can ask are also the ones the system has to refuse most firmly. <em>“Is John being fired?”</em> <em>“Did Priya get promoted?”</em> <em>“Who’s on the layoff list?”</em> <em>“What’s Rahul’s new salary?”</em></p><p>These are questions where, even when the data exists and the asker has technical access, the answer is refused until the relevant person has been told. Pre-announcement confidentiality protects the employee whose status is changing, not the asker asking. Termination, resignation, layoff, promotion, transfer, salary revision, and performance-improvement plans all fall under it.</p><h3>Coerced and retaliatory content drafting</h3><p>The assistant can draft. It can produce a courteous follow-up to a leave request, a reminder note to a team on policy compliance, a brief on a candidate’s interview history. It can also be asked to draft things it should not. A warning letter for an employee the asker has no management authority over. A performance-improvement plan addressed to the person who raised a harassment complaint two messages earlier in the same conversation. A termination memo composed in the heat of a dispute.</p><p>The system refuses these. The refusal is not phrased as <em>“I can’t help with that”</em> — it’s phrased as <em>“this needs HR involvement before I can help, and I’ve flagged it for them.”</em> A refusal that hands off to a human is different from a refusal that closes the door, and the difference matters to the asker.</p><h3>Mental-health and crisis signals — escalation, not refusal</h3><p>A user types <em>“I can’t take it anymore,”</em> or <em>“I’m completely burnt out,”</em> or <em>“I’m being bullied and HR isn’t listening.”</em> The system does not refuse these. Refusing a distress signal would be the wrong answer in a way that would actually hurt someone.</p><p>The system responds with empathy, suggests confidential HR and Employee Assistance Program channels, and triggers a structured escalation to the HR team so a human follows up. The mental-health path is the one place in the architecture where the model is permitted to step outside the normal tool-use vocabulary and respond to the human, not to the workflow.</p><h3>7. False positive — the self-service profile war story</h3><p>Every guard-rail system has a failure mode where it refuses something it shouldn’t have. Ours showed up in the most innocent place possible.</p><p>Early in production, an employee asked: <em>“When’s my birthday?”</em></p><p>The system refused. The exact response was something close to <em>“I don’t have access to your personal information.”</em></p><p>Their own profile. Their own birthday. The data was sitting one tool call away in the same record that stored their name, designation, and reporting manager. The system had every right to fetch it. It refused anyway because the policy layer saw the words <em>“personal information”</em> in the shape of the question and routed to a generic refusal before the self-service path got to run.</p><p>The fix wasn’t to loosen the refusal. The fix was to teach the system the order of operations. For any query containing <em>my</em>, <em>mine</em>, or <em>self</em> — <em>“when’s my birthday,”</em> <em>“who’s my manager,”</em> <em>“what’s my employee code,”</em> <em>“when did I join”</em> — the system now always calls the profile tool first. It never refuses without checking. The profile tool returns the user’s own record, and the system answers the specific field asked for.</p><p>The lesson is bigger than the fix. A safe default isn’t the same as a correct default. A system that says no to its own users about their own data isn’t safe — it’s broken in a way that erodes trust faster than an occasional wrong answer ever would. The refusal vocabulary needs to know what kind of refusal each phrase belongs to, and <em>“personal information”</em>applied to one’s own profile is not the same thing as <em>“personal information”</em> applied to a stranger’s.</p><h3>8. False negative — the pattern that no single query revealed</h3><p>The other failure mode is the inverse — a class of question that, taken one at a time, passed every gate, and was problematic only as a pattern.</p><p>A user asks: <em>“Is Anita in office today?”</em> Anita is on the asker’s visible directory; the question is about presence, not personal data. The system answers.</p><p>The next day, the same user asks the same thing about Anita. Then about Anita’s leave today. Then about Anita’s typical hours. Then about Anita’s next holiday booking. Each individual query stays within the lines — basic whereabouts, presence, who’s on leave today. The information is data the asker is permitted to see. No single query triggers a refusal because no single query deserves one.</p><p>The pattern, though, is something else. A specific employee being asked about, repeatedly, by the same colleague, across days, with no working relationship between them in the org chart. That’s not a workflow. That’s surveillance shaped like workflow.</p><p>The fix wasn’t to refuse the individual queries — they’re legitimate on their face. The fix was a behavioural layer above the per-query gates: a detector that watches the rolling window of who is asking what about whom, looks for repeated interest in a specific person from an asker outside their working relationship, and flags the pattern to administrators for review. The user does not see a refusal. The user is still answered. An administrator gets a quiet alert that says <em>“this is worth a look.”</em></p><p>The lesson here generalises. Some guard rails fire on the query. Others fire on the conversation. The most interesting ones fire on neither — they fire on the cross-conversation aggregate, where the system sees behaviour the individual gates were never supposed to catch.</p><h3>9. Refusal language is part of the architecture</h3><p>One pattern recurs through everything above and is worth naming on its own. The exact words a system uses to refuse a request are not a UX detail. They are an architectural decision that says something about why the refusal exists.</p><p><em>“I don’t have access to that”</em> says: the rules are about data availability. If the data were available, I would comply. That phrasing is correct for some refusals and wrong for others. It’s correct when someone asks about an employee outside their team — the data really isn’t available to them. It’s wrong when someone asks for a ranking by age — the data is available, the refusal is about principle, and claiming unavailability is dishonest.</p><p><em>“That’s not the kind of comparison I help with”</em> is the language of principle. <em>“I’ve flagged this for HR”</em> is the language of escalation. <em>“What can I help you with on leave, attendance, or payroll?”</em> is the language of scope redirect. Each refusal type has a phrasing family, and using the wrong family is the difference between a refusal that builds trust and one that erodes it.</p><h3>10. The audit layer is what makes the system trustable</h3><p>Every gate’s decision — every answer, every refusal, every escalation, every security tag — is written to an audit log. That log is what converts a stream of conversational decisions into a system an enterprise can sign off on.</p><p>The audit serves three different audiences. For administrators: a record of what the assistant did and did not answer for any given user, for any given time window. For security: the structured security tags that flag jailbreak attempts, prompt-injection payloads, and bulk-PII probes, surfaced for review without surfacing them to the user. For the model itself, over time: a feedback signal on which kinds of refusals turned out to be false positives, which escalations were warranted, and which patterns deserve new guard rails.</p><p>The audit also scrubs personally identifiable information from its own writes — emails, phone numbers, salary numbers, national identifiers are redacted before the log is written, so a forensic read of the audit doesn’t become a second copy of the data the assistant was being careful with in the first place. The guard rails apply to the guard rails’ own observability layer.</p><h3>11. What we still don’t trust the model with</h3><p>Three categories are explicitly fenced off even from the parts of the system that have the highest confidence. Naming them is part of the architecture, because the line between <em>“the model is ready for this”</em> and <em>“the model is not”</em> needs to be visible inside the team.</p><ul><li><strong>Professional judgement.</strong> Legal opinions on termination legality, medical-leave recommendations, financial-tax planning. The model can describe a process; it cannot give the opinion. Every query in this space is redirected — to HR, to a labour lawyer, to a tax advisor.</li><li><strong>Coercive content without verification.</strong> Warning letters, performance-improvement plans, and termination notes are drafted only when the asker has verified management authority over the named person, and only when the request is not immediately downstream of a complaint by that person in the same conversation. The model can draft a great PIP. The model cannot decide that this is the moment for one.</li><li><strong>Bulk decisions.</strong>Anything that names a multi-person action — “identify the bottom ten percent,” “rank candidates for termination,” “decide who to put on PIP” — is refused. Per-person decisions on a reportee’s file are fine. Decisions about a list of people, dressed up as a query, are not.</li></ul><h3>12. The honest open question</h3><p>The line between <em>refuse</em>, <em>answer</em>, and <em>escalate</em> is not a static one. The most interesting question about guard rails over the next two years is where it moves. Today, mental-health signals route to HR and the EAP. Today, coercive drafting requires explicit verified authority. Today, pre-announcement confidentiality is absolute.</p><p>As the models get more trustworthy, the temptation to widen the answer surface grows. Models that produce better refusals could be trusted with more of the questions currently escalated. Models that understand context across turns could relax some of the per-query refusals into per-conversation ones.</p><p>The honest open question is whether the right answer gets <em>harder</em>, not easier, as the model gets better. A more capable model is one that can participate in more harm if the guard rails fail. A less capable model fails noisily; a more capable one fails silently and with confidence. The architecture of refusal may need to become more conservative, not less, as the model below it becomes more capable.</p><p>A system that says no carefully is more trustworthy than one that says yes confidently.</p><p>The guard rails on an HR assistant aren’t a veneer on top of the model. They are the architecture. Three gates, three categories of refusal, a behavioural layer above the per-query gates, an audit log underneath all of it — and the editorial discipline to use the right refusal language for the right kind of refusal. The model is the easier part. The gates are the part that decides whether the model gets to be useful.</p><p><em>Originally published at </em><a href="https://www.prasanthpadharthi.com/writing/hr-assistant-guard-rails"><em>https://www.prasanthpadharthi.com</em></a><em> on June 4, 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86c8c49fefeb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we killed the UI — Inside HONO Zero UI’s Architecture]]></title>
            <link>https://medium.com/@prasanth.padharthi/why-we-killed-the-ui-inside-hono-zero-uis-architecture-1176daff0c9b?source=rss-eff88df7055b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1176daff0c9b</guid>
            <category><![CDATA[hrm]]></category>
            <category><![CDATA[hono]]></category>
            <category><![CDATA[zero-ui]]></category>
            <category><![CDATA[cto]]></category>
            <category><![CDATA[headless]]></category>
            <dc:creator><![CDATA[Prasanth Padharthi]]></dc:creator>
            <pubDate>Sun, 24 May 2026 17:01:25 GMT</pubDate>
            <atom:updated>2026-05-24T17:01:25.068Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. The premise</h3><p>For 30 years, enterprise HR software competed on interface density. More screens. More fields. More dashboards. HONO Zero UI takes the opposite bet: the interface is not the product. The execution layer is.</p><p>If any HR action can be expressed as an intent, and any intent can be routed to an API, then the entire HRMS becomes headless. The UI shrinks to a single conversational surface: one chat window, slash commands, generative components rendered inline. Everything else (payroll, leave, attendance, payslips, recruitment, reimbursement, holidays, employee directory) becomes a backend capability the execution engine composes on demand.</p><p>The simple cases (apply leave, check payslip, mark attendance) are not the interesting part. Any transactional chatbot from the last decade could do those. They are intent-to-API mappings.</p><p>The harder case looks like this:</p><blockquote><em>Brief me on my team before tomorrow’s mid-year reviews. Flag anyone who looks at risk.</em></blockquote><p>That single message has no pre-built workflow. The executor has to resolve “my team” from the org chart, pull each report’s last six months of performance reviews, leave and attendance patterns, project allocations, and outstanding 1:1 actions. Then it has to synthesise across all of that and surface the patterns a busy manager is about to miss. Anywhere between eight and a dozen tool calls. Three different ways to define “at risk.” One generative UI card per direct report, rendered inline.</p><p>No transactional chatbot can do that. It requires multi-step planning, conditional tool selection, mid-pipeline reasoning, and the willingness to make a judgment call the user can still override. That is the bar the architecture in the rest of this piece has to clear.</p><h3>2. The stack at a glance</h3><p>Zero UI runs on a deliberately small, modern stack — every choice serves the headless thesis.</p><ul><li><strong>Frontend:</strong> React 19, TypeScript, Vite, TailwindCSS v4, PWA-ready</li><li><strong>Backend:</strong> Express.js, CopilotKit v2 runtime (AG-UI protocol), monolithic by design for deployment simplicity</li><li><strong>Models:</strong> Anthropic Claude (Haiku 4.5, Sonnet 4.6, Opus 4.7) as the primary stack, with 4o/5o-class models accessed through Azure AI and AWS Bedrock, plus self-hosted open-source LLMs. All routed per-tenant from the admin settings.</li><li><strong>Data:</strong> PostgreSQL (Neon serverless) via Prisma ORM</li><li><strong>Observability:</strong> Langfuse for end-to-end AI traces, an internal journey bus for in-app step visibility, an LLM cost dashboard at /admin/llm-costs</li><li><strong>Embeddings:</strong> A small-dimension text embedding model (1.5K-dim) for tool retrieval and the HONO Any-API catalog (~1,429 GraphQL operations indexed). Same options as above: hosted via Azure or AWS Bedrock per-tenant, or self-hosted.</li></ul><p>The product is branded <strong>Era — by HONO</strong> externally; the engineering repo retains the technical identifier HONO_ZERO_UI.</p><p>Before the deep-dive, here’s the whole flow on one page. Each block below the message line is unpacked in the sections that follow.</p><p>Request flow · one user message, end to end</p><p>User message</p><p>“Brief me on my team for tomorrow’s mid-year reviews. Flag anyone at risk.”</p><p>Tier 1 — Classifier</p><p>Lightweight model</p><p>Returns intent + confidence + suggested tools</p><p>cache_control: ephemeral · 5-min TTL · ~90% off cached prefix</p><p>Hybrid tool routing</p><p>Static intent map or embedding RAG</p><p>Narrow intents (≤5 tools) → static allowlist · broad (≥6) → top-K retrieval</p><p>Filtered by tenant.enabled_hrms_modules</p><p>Tier 2 — Executor</p><p>Efficient model · CopilotKit runtime</p><p>Plans the tool sequence, invokes through the action layer</p><p>Action layer</p><p>defineTool wrappers</p><p>45s hard timeout · date validation · OTP gating · auto auth injection</p><p>HONO backend</p><p>GraphQL / REST</p><p>Same APIs the rest of the platform uses — Zero UI is just another caller</p><p>Response</p><p>Generative UI rendered inline</p><p>Plus follow-up suggestions for next steps</p><p>External MCP clients (Claude Desktop, Cursor, ServiceNow, Oracle Fusion, HubSpot) enter at the action layer via the MCP topology — same execution engine, different intent surface.</p><h3>3. Dual-model routing — cheap classifier, smart executor</h3><p>Most chat turns don’t need a frontier model. Looking at a typical HONO conversation:</p><ul><li><strong>60–70% are simple lookups</strong> — “what’s my leave balance?”, “mark me present.” One tool, format the result, done. A lightweight model handles this perfectly.</li><li><strong>20–30% are multi-tool synthesis</strong> — “morning briefing.” Four tool calls plus a written summary. A mid-tier model is fine.</li><li><strong>5–10% need the smart model</strong> — policy-nuance reasoning, ambiguous questions where the wrong tool pick costs three retries.</li></ul><p>Zero UI runs every request through two tiers:</p><p>Tenants configure both tiers from the admin Settings page; cache hit/miss telemetry is logged on every request and surfaced in the LLM cost dashboard. The split is feature-flagged so a tenant can fall back to single-model if a workload shape changes.</p><h3>4. Hybrid tool routing — static intent map + embedding RAG</h3><p>Once intent is classified, the executor needs a focused tool surface. Showing every tool to every request is wasteful (and hurts accuracy — LLMs get worse, not better, with too many tools in scope). Zero UI uses two routing strategies:</p><ul><li><strong>Narrow intents (≤5 tools)</strong> — direct hit via a static intent → tools allowlist. “Apply leave” deterministically resolves to the three or four tools needed. Zero embedding cost, instant.</li><li><strong>Broad intents (≥6 tools)</strong> — embedding-based top-K retrieval. The full tool corpus is embedded once at boot into an in-memory Map&lt;toolName, vector&gt;; queries are embedded on the fly and matched by cosine similarity.</li></ul><p>Both paths run side-by-side in a shadow-mode evaluator that logs which tools each strategy selected. An admin dashboard at /admin/rag-evaluation compares them so we can tighten the cutover threshold based on production data, not guesses.</p><p>Layered on top: per-tenant module gating. The enabled_hrms_modules setting filters which tool modules ship to the LLM at all - a hospitality tenant doesn&#39;t see manufacturing tools, a payroll-only tenant doesn&#39;t see recruitment tools. Module-agnostic tools (marked module: &#39;*&#39;) always pass.</p><h3>5. The Intelligent Execution Engine</h3><p>The IEE is what makes Zero UI “headless” rather than “a chatbot wrapper around a HRMS.” It composes tool calls, validates inputs, talks to the underlying HONO GraphQL/REST backend, and renders structured results back to the conversation.</p><p>Authoring a new capability follows a thin-wrapper pattern. The bulk of HONO operations are GraphQL queries with a single shape — we describe them declaratively via a defineTool factory that bakes in: employee-code gating, per-request throttling, GraphQL invocation, default response wrapping, follow-up suggestion generation, and catch-all error handling. Complex tools that need OTP gating, multi-step orchestration, or external HTTP stay hand-written.</p><p>Three safety invariants govern every tool handler:</p><ul><li><strong>45-second hard ceiling.</strong> The agent stream requires every tool_call to be paired with a tool_result. A hung handler strands the LLM transcript and silently breaks every subsequent message in that thread. The adapter races every handler against a 45-second timeout and synthesises an error result on expiry. Individual network calls have their own shorter, AbortController-driven timeouts inside.</li><li><strong>Date validation on every write.</strong> LLMs reliably misencode dates (“9th April” → 2026-09-04). Every write action funnels user-supplied dates through a shared validator that enforces format AND business window (e.g. futureDays, pastDays). Successful responses echo a human-readable date back (&quot;Friday, September 4, 2026&quot;) so the renderer can surface it prominently - catches residual errors prompt engineering can&#39;t.</li><li><strong>OTP gating on sensitive operations.</strong> Payslip access and similar high-trust actions route through an otpService before the underlying API is even called. Conversation is the interface; security is not optional because of it.</li></ul><h3>6. MCP topology — the external surface</h3><p>Internally, every HONO subsystem already speaks the same tool vocabulary. The MCP layer exposes that vocabulary to external AI assistants — Claude Desktop, Cursor, Zapier, any MCP-compliant client — so they can act on HONO directly.</p><p>Two URL shapes are supported, mounted on the same router:</p><ul><li><strong>Path-based:</strong> /api/:tenant/mcp - tenant resolved from the path parameter.</li><li><strong>Subdomain-based:</strong> &lt;tenant&gt;.mcp.hono.ai/mcp - tenant resolved from the host header. Cleaner to paste into external clients; the preferred form. Slug rules: exactly one level, case-insensitive, tight regex, reserved-subdomain list for confused-deputy safety.</li></ul><p>Each MCP API key has a read_only flag. Classification is fail-closed by name prefix - get_, list_, fetch_, search_, view_, preview_ are read; everything else is mutating by default. New actions default to &quot;protected&quot; until a reviewer explicitly opts them into the read scope. This is layered on top of the tenant module filter, so an external read-only key sees the intersection of (tenant&#39;s enabled modules) ∩ (read-scope tools).</p><h3>7. The cost levers — making AI-native economics work</h3><p>Conversational HRMS sounds expensive until you do the math carefully. Four levers are wired into Zero UI:</p><p><strong>Prompt caching</strong></p><p>~90% off cached reads on Anthropic (opt-in via cache_control); 50% off matched input on 4o-class providers (automatic, ≥1,024-token stable prefix). Both achieved by moving the date-interpolated block out of the cached prefix into a small dynamic suffix.</p><p><strong>Two-tier model routing</strong></p><p>Cheap classifier handles ~60% of turns at a fraction of the execution model’s rate.</p><p><strong>Budget + alerting</strong></p><p>Monthly cap per tenant with 80% / 100% alerts. Visible in the admin LLM cost dashboard with per-day, per-user, per-model breakdowns.</p><p><strong>Prompt &amp; tool description diet</strong></p><p>A prompt:audit script that surfaces stable prefix size and per-tool token cost; a COMPACT_TOOL_DESCRIPTIONS flag that trims schemas the LLM doesn&#39;t need at runtime.</p><p>Combined effect on a typical repeat-user request through a 4o-class model:</p><ul><li>Baseline: ~15,000 tokens × $2.50/M = <strong>$0.0375/request</strong></li><li>+Caching + base diet: ~14,000 tokens, ~13,800 cached at 50% = <strong>~$0.019/request (-49%)</strong></li><li>+Compact descriptions: ~9,000 tokens, ~8,800 cached = <strong>~$0.012/request (-68%)</strong></li><li>+Two-tier (cheap model handles 60% of turns at 1/10 price) = <strong>~$0.005/request (-87%)</strong></li></ul><p>Numbers are illustrative of what the architecture makes possible; actual tenant costs vary by traffic mix and model choice.</p><h3>8. What’s next</h3><ul><li><strong>Any-API Phase 2 — </strong><strong>invoke_hono_api.</strong> Phase 1 (read-only discovery) is live - the LLM can search the ~1,429-row GraphQL catalog and get back an HMAC-signed, single-use, 5-minute-TTL endpoint envelope. Phase 2 wires the actual invocation, opening the long tail of operations the curated tool set doesn&#39;t cover.</li><li><strong>Anthropic caching on the execution layer.</strong> CopilotKit’s built-in agent doesn’t yet expose a message-level hook for cache_control. We&#39;ll either subclass the agent or contribute upstream.</li><li><strong>Multimodal intents.</strong> Voice (phone-calling architecture already in place), document upload as input, on-screen context as input — same execution engine, different intent surface.</li><li><strong>Third-party MCP marketplace.</strong> External systems already plug in. The next step is a curated catalog so any enterprise can participate in the conversation by exposing an MCP server, without bespoke integration work.</li></ul><p>The interface is not the product. The execution layer is.</p><p>Everything above is in production. Some of it is bleeding edge. All of it is open to feedback.</p><p><em>Originally published at </em><a href="https://www.prasanthpadharthi.com/writing/zero-ui-architecture"><em>https://www.prasanthpadharthi.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1176daff0c9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>