mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
hanzoskills.com/llms.txt now opens with the install line, the API reference index and the company index, so an agent that lands on any one of the three can find the rest. robots.txt claimed 537 documents while llms.txt counts 920. The number is gone from robots.txt; llms.txt derives it. public/ is regenerated from scripts/site.py, which it had fallen behind: the copy-prompt menu and agent bar were in the generator and not in the committed pages. tests/site.mjs passes against the result. Co-authored-by: Hanzo Dev <[email protected]>
297 lines
32 KiB
HTML
297 lines
32 KiB
HTML
<!doctype html>
|
|
<html lang="en"><head>
|
|
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
<title>hip-1320</title>
|
|
<meta name="color-scheme" content="dark">
|
|
<style>
|
|
/* Committed to one visual world: a dark instrument panel. No light variant —
|
|
the dot field and the hairline rules only read on black, and a naive
|
|
inversion would wash both out. Every colour is painted explicitly so the page
|
|
never borrows a host background. */
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
|
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
|
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
|
|
|
|
:root{
|
|
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
|
|
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
|
|
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
|
|
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
|
|
--font-zen-pixel-square:'Zen Pixel Square',monospace;
|
|
--mono:var(--font-zen-mono);
|
|
--sans:var(--font-zen-sans);
|
|
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
|
|
--r:999px; --r-soft:14px;
|
|
}
|
|
*{box-sizing:border-box}
|
|
html{-webkit-text-size-adjust:100%}
|
|
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
|
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
|
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
|
|
|
|
/* The dot field. A halftone made of one repeating radial-gradient, faded out
|
|
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
|
|
/* No overflow clip here: the dot field is inset to the box already, and a clip
|
|
would cut off the copy-prompt menu. */
|
|
.hero{position:relative;border-bottom:1px solid var(--line)}
|
|
.hero::before{content:"";position:absolute;inset:0;
|
|
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
|
|
background-size:7px 7px;
|
|
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
|
pointer-events:none}
|
|
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
|
|
|
|
nav{border-bottom:1px solid var(--line)}
|
|
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
|
|
justify-content:space-between;align-items:center;gap:1rem}
|
|
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--ink);text-decoration:none;
|
|
display:inline-flex;align-items:center;gap:.6rem}
|
|
.brand i{font-style:normal;color:var(--faint)}
|
|
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
|
|
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
|
|
text-transform:uppercase;color:var(--soft);text-decoration:none}
|
|
nav a.up:hover{color:var(--ink)}
|
|
|
|
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
|
|
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
|
|
h1 em{font-style:normal;color:var(--faint)}
|
|
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
|
|
|
|
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
|
|
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
|
|
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
|
|
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
|
|
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
|
|
line-height:1.2;font-weight:400}
|
|
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
|
|
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
|
|
.btn.solid:hover{background:#d8d8d4}
|
|
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
|
|
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
|
|
|
|
/* Copy-prompt selector. Each row copies the prompt for its own target. */
|
|
.copy{position:relative;display:inline-flex}
|
|
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
|
|
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
|
|
padding:.4rem;display:flex;flex-direction:column;
|
|
box-shadow:0 12px 32px rgba(0,0,0,.75)}
|
|
.menu[hidden]{display:none}
|
|
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
|
|
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
|
|
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
|
|
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
|
|
white-space:nowrap}
|
|
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
|
|
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
|
|
.mi:hover .mark{color:var(--ink)}
|
|
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
|
|
letter-spacing:.1em;text-transform:uppercase}
|
|
|
|
/* Works-with bar: one scrolling row, name and mark per agent. */
|
|
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
|
|
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
|
|
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
|
|
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
|
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
|
|
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
|
|
display:flex;align-items:center}
|
|
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
|
|
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
|
|
-webkit-overflow-scrolling:touch;
|
|
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
|
|
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
|
|
.bar::-webkit-scrollbar{display:none}
|
|
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
|
|
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
|
|
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
|
|
text-decoration:none;background:var(--ground)}
|
|
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
|
|
.agent .mark{width:.95rem;height:.95rem}
|
|
|
|
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
|
|
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
|
|
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
|
|
p{margin:0 0 1rem;max-width:70ch}
|
|
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
|
|
li{margin:.22rem 0}
|
|
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
|
|
text-decoration-color:var(--line-hi)}
|
|
a:hover{text-decoration-color:var(--ink)}
|
|
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
|
|
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
|
|
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
|
|
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
|
|
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
|
|
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
|
|
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
|
|
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
|
|
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
|
|
display:block;overflow-x:auto}
|
|
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
|
|
|
|
.curl{display:block;background:var(--panel);border:1px solid var(--line);
|
|
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
|
|
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
|
|
white-space:pre;line-height:1.9}
|
|
.curl b{color:var(--ink);font-weight:400}
|
|
.curl i{font-style:normal;color:var(--faint)}
|
|
|
|
/* index */
|
|
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
|
|
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
|
|
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
|
|
#q:focus{outline:none;border-color:var(--soft)}
|
|
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
|
|
text-transform:uppercase;margin:0 0 2rem}
|
|
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
|
|
padding-bottom:.45rem}
|
|
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
|
|
border-radius:var(--r-soft);text-decoration:none}
|
|
.row:hover{background:#0a0a0a}
|
|
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
|
|
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
|
|
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
|
|
color:var(--faint);font-size:.85rem}
|
|
footer a{color:var(--soft)}
|
|
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
|
|
margin:0 0 2rem;font-size:.85rem}
|
|
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
|
|
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
|
|
border-bottom:1px solid var(--line);padding-bottom:.4rem}
|
|
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
|
|
.fmap a:hover{text-decoration:underline}
|
|
.fmap div{color:var(--faint);line-height:1.5}
|
|
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
|
|
|
|
@media (max-width:640px){
|
|
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
|
|
.btns{gap:.5rem}
|
|
.btn{padding:.75rem 1.15rem;font-size:.68rem}
|
|
.copy,.copy .btn{width:100%;justify-content:center}
|
|
.menu{left:0;right:0;min-width:0}
|
|
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
|
|
.strip b{border-right:0;padding-right:0}
|
|
.bar{width:100%}
|
|
}
|
|
</style>
|
|
<link rel="alternate" type="text/markdown" href="/hip-1320.md">
|
|
|
|
<link rel="icon" href="/favicon.svg">
|
|
<link rel="canonical" href="https://hanzoskills.com/hip-1320">
|
|
</head>
|
|
<!-- Reading this with a machine? Every page here is also plain markdown.
|
|
This one: https://hanzoskills.com/hip-1320.md
|
|
Index: https://hanzoskills.com/llms.txt
|
|
Corpus: https://hanzoskills.com/all.md
|
|
Append .md to any path for the markdown twin. -->
|
|
<body>
|
|
<nav><div class="in">
|
|
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
|
|
<a class="up" href="/">All skills</a>
|
|
</div></nav>
|
|
|
|
<div class="wrap">
|
|
<h1>hip-1320</h1><p class="lede">HIP-1320: Admin — The Operator Console. Status Final. Hanzo architectural specification.</p><h1>HIP-1320: Admin — The Operator Console</h1>
|
|
<h2>Abstract</h2>
|
|
<p><code>/v1/admin</code> is the operator's view of the fleet: the tenant directory, what each org is spending and owes, the credit an operator grants, the flags and caps it sets, the infrastructure it watches, and what each host is running. It is <code>hanzoai/cloud</code> <code>apps/admin</code>, and it is the one capability whose audience is not a customer.</p>
|
|
<p>It owns no store. Every panel is a read fanned into IAM, commerce, the ledger, o11y and the cluster; every mutation is somebody else's write, recorded first in the tamper-evident trail. What admin owns is the ADMISSION and the AGGREGATION — one predicate at the endpoint, and the fold that turns a hundred upstream reads into one board.</p>
|
|
<p>This HIP states that surface, the two-tier gate it admits through, and why a capability nobody outside the reserved org can call is nonetheless <code>ga</code>.</p>
|
|
<h2>Motivation</h2>
|
|
<p>Every other capability in the fleet answers to a customer, and the shape of a capability HIP assumes one: the store it owns, the tenant a request becomes, the unit it meters. Admin answers to the operator and inverts each of those — no store, a caller who is deliberately NOT pinned to one tenant, and nothing metered at all. A specification that only describes the customer-facing shape leaves the one surface that can grant credit, set a cap and reload a binary as the only surface with no spec.</p>
|
|
<p>The address family is already specified: HIP-0139 §3.2 fixes <code>/v1/admin/<name></code> as the operator's view of <code><name></code>, served by <code><name></code>, dropped from the public document by address. What was never written down is the capability at the ROOT of that family — the console itself, which serves <code>/v1/admin</code> and is not the operator view of anything.</p>
|
|
<h2>Specification</h2>
|
|
<p>The key words MUST, MUST NOT, SHOULD, SHOULD NOT and MAY are to be interpreted as in RFC 2119.</p>
|
|
<h3>§1 One root, two kinds of address under it</h3>
|
|
<p>Every route admin serves MUST be under <code>/v1/admin</code> (<code>manifest/apps.go</code>: <code>{Name: "admin", Prefixes: []string{"/v1/admin"}}</code>). The surface is 55 paths and 60 operations, in 33 groups (<code>plugin/admin/openapi.json</code>, measured <code>python3 -c "import json; d=json.load(open('plugin/admin/openapi.json'))"</code>, 2026-08-20).</p>
|
|
<p>Two kinds of address share that root and MUST NOT be confused:</p>
|
|
<ol><li><strong>Admin's own nouns</strong> — the console. <code>me</code>, <code>overview</code>, <code>orgs</code>, <code>users</code>,</li></ol>
|
|
<p> <code>customers</code>, <code>usage</code>, <code>analytics</code>, <code>revenue</code>, <code>money</code>, <code>finance</code>, <code>invoices</code>, <code>subscriptions</code>, <code>grants</code>, <code>promos</code>, <code>caps</code>, <code>flags</code>, <code>roles</code>, <code>applications</code>, <code>products</code>, <code>providers</code>, <code>services</code>, <code>subsystems</code>, <code>infra</code>, <code>volumes</code>, <code>compute</code>, <code>bases</code>, <code>metrics</code>, <code>aimetrics</code>, <code>o11y</code>, <code>audit</code>, <code>sync</code>, <code>waitlist</code>, <code>plugins</code>. The second segment names a thing the OPERATOR works with, and admin is the capability that answers for it.</p>
|
|
<ol><li><strong>Another capability's operator view</strong> — <code>/v1/admin/<name>/*</code>, served by</li></ol>
|
|
<p> <code><name></code> and not by admin (HIP-0139 §3.2). <code>referral</code> is the worked example: <code>/v1/admin/referrals/bonuses</code> is the referrals capability's row in the manifest, not admin's.</p>
|
|
<p>A reader tells them apart by the manifest, which is the only place that decides: the app whose row carries the prefix is the app that serves it. Admin MUST NOT claim <code>/v1/admin/<name></code> for a <code><name></code> that is itself a capability, and a capability MUST NOT serve <code>/v1/admin/<noun></code> for a noun that is admin's.</p>
|
|
<p><code>/v1/admin/plugins</code> is the case that looks like the second and is the first. What it changes is not a capability's state but the BINARY a host is running, and a binary belongs to the fleet rather than to any one capability, so the console that watches every capability is the capability it belongs to (§7).</p>
|
|
<h3>§2 The gate: one predicate, two tiers</h3>
|
|
<p>Admission is decided at the top of every handler by one of two functions, and by nothing else (<code>apps/admin/core/typed.go</code>).</p>
|
|
<p><strong><code>core.Admit</code> — platform tier.</strong> Admits if and only if <code>principal.IsSuperAdmin</code> holds, which is HIP-0118's predicate and no second term. Everything that reads across tenants or changes fleet state goes through it.</p>
|
|
<p><strong><code>core.AdmitScoped</code> — org tier.</strong> Admits a SuperAdmin unconditionally, or a caller for whom THREE facts all hold: the caller administers their own org (<code>principal.IsOrgAdmin</code>), the caller is a validated principal pinned to that org (<code>principal.Org</code>), and that org is an enabled white-label tenant (<code>State.IsWhiteLabelTenant</code>). The allowlist is seeded from <code>ADMIN_WL_TENANT_ORGS</code> and is fail-closed: unset means SuperAdmins only. Passing the gate is not the end of the scoping — the handler then folds every read through <code>ResolveScope</code>/<code>ScopedOrgs</code>, which hard-limits a non-super caller to their own org subtree whatever the request says.</p>
|
|
<p>Three rules follow, and each is a refusal:</p>
|
|
<ol><li>The predicate is EVALUATED ONCE, at the identity boundary, and thereafter</li></ol>
|
|
<p> READ. <code>SanitizeIdentity</code> deletes every authority header a client sent, then mints <code>X-User-IsAdmin</code> only from a validated credential whose signed <code>orgs</code> set contains the reserved org (<code>middleware_identity.go</code>). It is never restored from client input on any path, including the anonymous one. A capability MUST NOT re-derive the predicate from a claim it reads itself.</p>
|
|
<ol><li>Membership is the predicate, at ANY position in the signed set. Reading it</li></ol>
|
|
<p> positionally — <code>Orgs[0]</code>, the home org — refuses every operator who holds admin-org membership without their user row living there, which is the defect <code>middleware_identity.go</code> records against its own earlier form.</p>
|
|
<ol><li>The gate is CALLED, not wrapped. Each handler calls <code>Admit</code> or <code>AdmitScoped</code></li></ol>
|
|
<p> on its first line, so the tier is read where the handler is read and applies to the MCP and CLI projections too, which never touch the router (<code>apps/admin/admin.go</code>, <code>routes</code>). A middleware gate protects one projection of four.</p>
|
|
<p>The reserved org's slug is <code>IAM_ADMIN_ORG</code>, default <code>admin</code> (<code>apps/admin/admin.go</code>, <code>adminOrgOf</code>).</p>
|
|
<h3>§3 Refusal is 403, and that is deliberate</h3>
|
|
<p>A refused caller gets <code>403</code> with <code>SuperAdmin required</code> or <code>admin required</code>, not <code>404</code>. This is the opposite of the stage rule (HIP-0139 §8.2), where a capability a customer has not been let into answers 404 so the refusal is not an existence oracle — and the difference is the point. <code>/v1/admin</code> is documented, addressed and known to exist; there is nothing for a probe to learn. Hiding it would buy no secrecy and would cost the operator a diagnosable error.</p>
|
|
<h3>§4 The store it owns: none</h3>
|
|
<p>Admin opens no store. There is no <code>cek.Open</code> under <code>apps/admin</code>, and there is no <code>admin</code> datastore anywhere in the fleet. Every board is a fan-in over planes that own their own data:</p>
|
|
<p>| upstream | what admin reads | |---|---| | IAM (<code>apps/admin/iam</code>) | the org and user directory, on the management surface, replaying the caller's own credential | | commerce (<code>apps/admin/commerce</code>) | balances, spend, credits, invoices, subscriptions | | the AI ledger (<code>apps/admin/ledger.go</code>) | what was served: 30-day AI spend and tokens | | o11y / health (<code>apps/admin/health</code>) | service health and the incident board | | the cluster (<code>apps/admin/infra</code>) | nodes, pods, volumes, services — read through the k8s API | | DigitalOcean (<code>apps/admin/digitalocean</code>) | the droplets and volumes behind the fleet | | the audit trail (<code>deps.Audit</code>) | the grant history, projected — never a second copy |</p>
|
|
<p>This is a REQUIREMENT and not an accident. A console that kept its own copy of a number would be a second source of truth for that number, and the operator would have no way to tell which one was wrong. Every figure a board shows MUST be attributable to the plane that owns it, and a plane that fails MUST degrade its own row honestly rather than let a fleet total read healthy — the overview answers 200 always and reports each upstream in <code>sources[]</code> as ok, degraded or not-configured.</p>
|
|
<h3>§5 Mutations, and the trail they are written to first</h3>
|
|
<p>Admin's writes land in other planes: a credit grant in commerce's ledger, a cap or promo in the usage plane, a flag in <code>flags</code>, a suspend in IAM, a reload in the host. Every one of them MUST be recorded in the tamper-evident, hash-chained audit trail (HIP-1103) BEFORE it is reported as done, and a deployment with no durable audit store MUST refuse to mutate rather than mutate unrecorded:</p>
|
|
<blockquote><p>refused: no durable audit store is configured on this deployment; a plugin lifecycle change must be recorded before it is made — <code>apps/admin/plugins/fleet.go:155</code></p></blockquote>
|
|
<p>Recording FIRST is what makes the trail complete: a write recorded afterwards loses exactly the attempts that crashed between the act and the record, which are the ones worth having. Failed attempts are recorded too, which is why the grant history is a projection of the trail rather than a table of successes — <code>GET /v1/admin/grants</code> reads back <code>admin.customer.credit</code> entries, so the view cannot drift from what happened.</p>
|
|
<h3>§6 Tenant, price, events, telemetry</h3>
|
|
<p><strong>Tenant.</strong> Admin is the one capability whose caller is deliberately NOT pinned to a tenant. A SuperAdmin's window is the fleet; a white-label admin's window is their own org subtree, computed by <code>ResolveScope</code> from the validated principal and never from a request field.</p>
|
|
<p><strong>Price.</strong> Free, in those words: <code>Price: cloud.Free</code> (<code>plugin/admin/main.go</code>), and <code>admin</code> is absent from <code>meteredApps</code> (<code>spend.go</code>). It meters nothing and charges nobody, because the operator is not a customer. A capability whose audience is the operator MUST NOT be metered — a meter on this surface would bill the house for looking at its own books.</p>
|
|
<p><strong>Events.</strong> Admin publishes no <code>admin.<noun>.<verb></code> events on the platform bus, so a customer's webhooks (HIP-1310) receive nothing from it. That is correct and MUST stay so: an operator's action is not a customer's event, and a fan-out that delivered one would tell a tenant what the operator is doing. The audit trail is where an operator action is durably visible, and its audience is the operator.</p>
|
|
<p><strong>Telemetry.</strong> Beyond the request span every route already gets, admin emits logs and no metrics of its own. The one publication it makes is in-process — the per-provider funding split, handed to the <code>ai</code> module's funding state (<code>apps/admin/finance/finance.go</code>) — and reaches no bus and no tenant.</p>
|
|
<h3>§7 The reload endpoint</h3>
|
|
<p><code>/v1/admin/plugins</code> is four operations: the fleet's per-host account of what it is running, and reload, enable and disable for one plugin. Each is <code>core.Admit</code> (platform tier) and each mutation is audited under §5. They are the most dangerous routes in the fleet — any of them can take production down — and they are specified here rather than anywhere else because they change a BINARY, which is the fleet's and not a capability's.</p>
|
|
<p>The identity of what is running is the artifact's SHA-256 and MUST NOT be a version string, because the digest is the only identifier that cannot drift from the bits actually serving.</p>
|
|
<p>Three rules bind the endpoint:</p>
|
|
<ol><li><strong>The version-to-digest mapping has one author.</strong> A version resolves through</li></ol>
|
|
<p> <code>CLOUD_PLUGIN_ORIGIN</code> to <code><origin>/<version>/binaries.json</code> — the index CI already writes. Admin MUST NOT compute a digest and MUST NOT accept one from the caller alone.</p>
|
|
<ol><li><strong>Verification precedes execution.</strong> The digest is handed to <code>zip</code>, which</li></ol>
|
|
<p> verifies the download against it BEFORE the file is made executable or given its final name, and uses it as the cache key, so a version this host has already run needs no network.</p>
|
|
<ol><li><strong>Hosts are reported, never merged.</strong> The listing answers per host. During a</li></ol>
|
|
<p> rollout the hosts disagree BY DESIGN, and a merged view hides exactly the state an operator is watching for. A peer that could not be reached reports its error and an empty plugin set, which is NOT the same as none, and nothing downstream may conclude drift from it.</p>
|
|
<p>A pin rolls back as readily as it rolls forward: the same route with an older version is the rollback, so there is one mechanism and not two.</p>
|
|
<h3>§8 Withheld, not hidden</h3>
|
|
<p>Admin is <code>ga</code> — its manifest row declares no stage, and absent is <code>ga</code> (HIP-0139 §8). It is core: the fleet cannot be operated without it. It is simply not customer-facing, and those are different properties that a single "is it finished" axis cannot carry.</p>
|
|
<p>The whole capability is dropped from the public document BY ADDRESS, in one place: <code>openapi/public.go</code> reserves the product <code>admin</code> for the operator (<code>const Operator = "admin"</code>) and refuses any path whose first segment after <code>/v1</code> is that word. Everything downstream follows without a second decision — no generated client class, no MCP tool, no CLI command group, no public page.</p>
|
|
<p>This MUST remain an address rule and MUST NOT become a per-route annotation. A list of operations to withhold is a list somebody maintains, and the operation added next week is the one that is not on it. The address is a property of the route itself and cannot be forgotten.</p>
|
|
<p>The consequence is deliberate and stated so it is not mistaken for an omission: admin is a <code>ga</code> capability with no SDK method, no tool and no public page, and the operator reaches it through the console at <code>admin.hanzo.ai</code> (HIP-0118 §6) and through the internal document.</p>
|
|
<h3>§9 Upstream</h3>
|
|
<p>Admin derives from no OSS project: it forks, embeds and mirrors nothing. It is cloud's own aggregation over planes that have their own upstreams — IAM (HIP-0026), commerce (HIP-1220), the audit trail (HIP-1103). The infrastructure board reads the cluster through <code>k8s.io/client-go</code> (Apache-2.0), which is a client library for an API and not a project this capability derives from.</p>
|
|
<h2>Rationale</h2>
|
|
<p>The alternative considered was for each plane to serve its own operator surface and for the console to be a client that calls thirty of them. It was rejected for the reason §4 gives: the fold is the product. An operator asking "what is this org costing us" needs IAM, commerce and the ledger reconciled onto one row with an honest freshness flag per source, and a client that calls three services and renders three spinners has moved that reconciliation into a browser where it cannot be tested and each failure reads as a blank.</p>
|
|
<p>The second alternative was to gate admin at the edge alone — a proxy in front of <code>admin.hanzo.ai</code> — and to leave the handlers ungated. That is one projection of four. The MCP endpoint and the CLI reach the same typed operations without passing any edge, so a gate that lives at the edge is a gate two callers walk around; this is why §2.3 puts the call in the handler.</p>
|
|
<h2>Security Considerations</h2>
|
|
<p>This is the capability an attacker wants. It reads every tenant, grants money, sets caps, suspends users and replaces running binaries. The whole design is one predicate, evaluated once, plus a trail that is written before the act.</p>
|
|
<p><strong>Escalation by claim confusion.</strong> Trusting a per-org <code>isAdmin</code> for platform-level gating is HIP-0118's named privilege-escalation bug, and it is the one this surface would suffer first: a customer administering their own org is one boolean away from the fleet. <code>AdmitScoped</code> admits that caller only with the white-label allowlist ALSO satisfied, and even then narrows every read to their own subtree. <code>Admit</code> does not admit them at all.</p>
|
|
<p><strong>Escalation by header.</strong> <code>X-User-IsAdmin</code> is an ordinary header on the wire. Every authority header is deleted on ingress before anything reads one, and the admin bit is re-minted only from a validated credential — never restored from client input, on any path, including the one where the data plane still passes a client <code>X-Org-Id</code> through. If the validator cannot verify a token, the request resolves anonymous and admin fails closed.</p>
|
|
<p><strong>Escalation by position.</strong> Reading membership positionally silently refuses legitimate operators, and the fix for that class of bug is where the danger is: a "make it work" patch that widens the test to any org in the set, or to the isAdmin bit, converts a refusal bug into an escalation. Membership of the reserved org, at any position, is the predicate; nothing else is.</p>
|
|
<p><strong>The reload endpoint as the shortest path to code execution.</strong> An attacker who reaches it does not need a vulnerability in any handler — they need a URL. This is why the origin is deployment config and not a request field, why the digest comes from the index CI writes rather than from the caller, and why zip verifies before the artifact is executable. An unset origin refuses the request rather than falling back to anything.</p>
|
|
<p><strong>The trail as the last line.</strong> Everything above can fail and still leave the operator able to say what happened, provided the record precedes the act and the chain is hash-linked. A deployment with no durable audit store therefore refuses to mutate at all — an unrecorded grant is worse than a refused one.</p>
|
|
<p><strong>Tenant isolation on a surface built to cross it.</strong> Admin exists to read across orgs, so the isolation cannot come from the address; it comes from the scope resolved on the caller. Every non-super read folds through <code>ResolveScope</code>, and a request field that names an org is not a scope — it is a filter within one.</p>
|
|
<h2>References</h2>
|
|
<ul><li>HIP-0026 — Identity & Access Management Standard</li><li>HIP-0106 — The Hanzo Plugin Contract</li><li>HIP-0118 — SuperAdmin & Tenant Isolation Model</li><li>HIP-0135 — What Is Public</li><li>HIP-0139 — Capability</li><li>HIP-1103 — Audit — The Tamper-Evident Trail</li><li>HIP-1220 — Commerce — The Merchant Half</li><li>HIP-1310 — Webhooks — Outbound Delivery</li></ul>
|
|
<h2>Copyright</h2>
|
|
<p>Released under CC0 1.0 Universal Public Domain Dedication.</p>
|
|
<footer>
|
|
<div class="fmap">
|
|
<div><b>Build</b>
|
|
<a href="https://hanzo.app">hanzo.app</a> app builder
|
|
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
|
|
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
|
|
<div><b>Run</b>
|
|
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
|
|
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
|
|
<div><b>Account</b>
|
|
<a href="https://hanzo.id">hanzo.id</a> sign in
|
|
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
|
|
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
|
|
<div><b>Company</b>
|
|
<a href="https://hanzo.ai">hanzo.ai</a> canonical
|
|
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
|
|
</div>
|
|
<div class="fend"><a href="/hip-1320.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
|
</footer>
|
|
</div></body></html> |