Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

feat(integrations): bring your own key, and stop asking users what we already know

richard-epsilladf2a1f59dec3
diff --git a/gateway/app.py b/gateway/app.py
index 309267bf..65ff546c 100644
--- a/gateway/app.py
+++ b/gateway/app.py
@@ -2796,11 +2796,123 @@ _SECRET_SENTINEL = "__secret__"
async def _require_integrations_admin(request: Request) -> dict:
p = await _principal(request)
+ # Self-hosted (identity off) is single-tenant: the one operator IS the administrator, and
+ # bringing your own key is the whole point of running it yourself. Requiring an allow-list
+ # there would lock the owner out of their own box.
+ if HR_IDENTITY_MODE == "off":
+ return p
if (p.get("org") or "") not in _INTEGRATIONS_ADMIN_ORGS:
raise HTTPException(403, "not available for this organization")
return p
+# ── provider catalog ─────────────────────────────────────────────────────────────────
+# What we already know about each vendor, so adding an integration asks for a key and nothing
+# else. A base_url we can look up ourselves is not a question worth putting to a user, and a
+# wrong answer there is a broken integration they can't debug.
+#
+# `base_url` present -> fixed, applied automatically and never asked for.
+# `base_url` None -> genuinely per-deployment (an Azure resource, an AWS region), so it IS
+# asked for, with `fields` naming exactly what to ask.
+_PROVIDER_CATALOG: dict[str, dict] = {
+ "anthropic": {
+ "label": "Anthropic",
+ "base_url": "https://api.anthropic.com",
+ "fields": [],
+ "secret": "api_key",
+ "secret_label": "API Key",
+ "key_hint": "sk-ant-…",
+ },
+ "openai": {
+ "label": "OpenAI",
+ "base_url": "https://api.openai.com/v1",
+ "fields": [],
+ "secret": "api_key",
+ "secret_label": "API Key",
+ "key_hint": "sk-…",
+ },
+ "openrouter": {
+ "label": "OpenRouter",
+ "base_url": "https://openrouter.ai/api/v1",
+ "fields": [],
+ "secret": "api_key",
+ "secret_label": "API Key",
+ "key_hint": "sk-or-…",
+ },
+ "tokenrouter": {
+ "label": "TokenRouter",
+ "base_url": "https://api.tokenrouter.com/v1",
+ "fields": [],
+ "secret": "api_key",
+ "secret_label": "API Key",
+ },
+ "azure-foundry": {
+ "label": "Azure OpenAI",
+ "base_url": None, # one resource per customer — there is no default to know
+ "fields": [{"key": "base_url", "label": "Endpoint URL",
+ "placeholder": "https://<resource>.openai.azure.com/openai/v1"}],
+ "secret": "api_key",
+ "secret_label": "API Key",
+ },
+ "bedrock": {
+ "label": "AWS Bedrock",
+ "base_url": None, # region-addressed, not a URL
+ "fields": [{"key": "aws_region", "label": "AWS Region", "placeholder": "us-east-1"}],
+ "secret": "aws_bearer_token",
+ "secret_label": "API Key (bearer token)",
+ },
+}
+
+
+def _provider_model_id(provider: str, canonical: str) -> str | None:
+ """This provider's real id for a canonical model name, or None when it can't serve it.
+
+ Deliberately reuses the SAME tables the turn loop's _map_model consults, so the catalog can
+ never advertise a model the router would then fail to address. A canonical with no entry in
+ a mapped provider's table (claude-opus-5 today) is omitted rather than guessed — emitting an
+ id the provider rejects is worse than not listing it."""
+ table = {"anthropic": _ANTHROPIC_CLAUDE, "bedrock": _BEDROCK_CLAUDE}.get(provider)
+ if table is not None:
+ key = canonical[len("claude-"):] if canonical.startswith("claude-") else canonical
+ return table.get(canonical) or table.get(key)
+ # Everything else is OpenAI-shaped: _map_model passes the name through untouched, so the
+ # canonical name IS the provider id.
+ return canonical
+
+
+def _provider_models(provider: str) -> list[dict]:
+ """The models an integration with this provider serves, derived rather than configured.
+
+ Union of the catalogs of every backend this provider can carry (_INTEGRATION_WIRING), each
+ resolved to the provider's own id. Growing the model list is therefore a one-line change to
+ _MODEL_CATALOG, not a support ticket asking every user to retype their integrations."""
+ seen: dict[str, str] = {}
+ for (prov, backend), _runner in _INTEGRATION_WIRING.items():
+ if prov != provider:
+ continue
+ for canonical in _MODEL_CATALOG.get(backend, {}).get("models", []):
+ if canonical in seen:
+ continue
+ pid = _provider_model_id(provider, canonical)
+ if pid:
+ seen[canonical] = pid
+ return [{"canonical": c, "provider_id": p} for c, p in seen.items()]
+
+
+def _provider_catalog_public() -> list[dict]:
+ """The catalog the console renders its Add-Integration form from."""
+ return [{"id": pid,
+ "label": meta["label"],
+ "base_url": meta["base_url"],
+ "fields": meta["fields"],
+ "secret": meta["secret"],
+ "secret_label": meta["secret_label"],
+ "key_hint": meta.get("key_hint", ""),
+ "models": _provider_models(pid),
+ "backends": sorted({b for (p, b) in _INTEGRATION_WIRING if p == pid})}
+ for pid, meta in _PROVIDER_CATALOG.items()]
+
+
def _integration_public(integ: dict) -> dict:
"""Integration with secret config values replaced by a sentinel (never round-trip secrets)."""
cfg = dict(integ.get("config") or {})
@@ -2815,7 +2927,8 @@ async def admin_integrations_get(request: Request) -> dict:
await _require_integrations_admin(request)
return {"integrations": [_integration_public(i) for i in await _integrations_doc()],
"model_map": await _model_map_doc(),
- "providers": sorted({p for p, _ in _INTEGRATION_WIRING})}
+ "providers": sorted({p for p, _ in _INTEGRATION_WIRING}),
+ "catalog": _provider_catalog_public()}
class IntegrationsBody(BaseModel):
@@ -2841,10 +2954,20 @@ async def admin_integrations_put(body: IntegrationsBody, request: Request) -> di
if not prior_cfg.get(k):
raise HTTPException(400, f"integration '{name}': missing {k}")
cfg[k] = prior_cfg[k]
+ # A provider whose endpoint we know supplies its own base_url. Asking the user for a
+ # value we can look up is a question with exactly one right answer and many wrong ones.
+ known_base = (_PROVIDER_CATALOG.get(provider) or {}).get("base_url")
+ if known_base and not cfg.get("base_url"):
+ cfg["base_url"] = known_base
models = [{"canonical": str(m.get("canonical") or "").strip(),
"provider_id": str(m.get("provider_id") or "").strip()}
for m in (i.get("models") or [])
if str(m.get("canonical") or "").strip() and str(m.get("provider_id") or "").strip()]
+ # No models given: serve the provider's whole catalog. The list lives in source and grows
+ # there, so an existing integration picks up new models on the next release instead of
+ # every user editing every integration by hand.
+ if not models:
+ models = _provider_models(provider)
out.append({"name": name, "provider": provider, "config": cfg, "models": models})
names = {i["name"] for i in out}
if len(names) != len(out):
@@ -2854,6 +2977,14 @@ async def admin_integrations_put(body: IntegrationsBody, request: Request) -> di
for model, iname in mm.items():
if iname not in names:
raise HTTPException(400, f"model '{model}' maps to unknown integration '{iname}'")
+ # Anything an integration can serve but nothing yet routes gets pointed at it. Without this,
+ # adding a key changes nothing observable: the model stays unmapped, the turn falls through
+ # to a connection chain that doesn't exist, and the user is told there is no connection for
+ # the backend — having just supplied one. First integration to claim a model wins; an
+ # explicit mapping above is never overwritten.
+ for integ in out:
+ for m in integ["models"]:
+ mm.setdefault(m["canonical"], integ["name"])
await _vault_put(GLOBAL_TENANT, _INTEGRATIONS_KEY, json.dumps(out))
await _vault_put(GLOBAL_TENANT, _MODEL_MAP_KEY, json.dumps(mm))
return {"ok": True, "integrations": [_integration_public(i) for i in out], "model_map": mm}
@@ -3219,13 +3350,13 @@ _BEDROCK_CLAUDE = {
"opus-4.8": "us.anthropic.claude-opus-4-8", "opus-4.7": "us.anthropic.claude-opus-4-7",
"opus-4.6": "us.anthropic.claude-opus-4-6", "opus-4.5": "us.anthropic.claude-opus-4-5",
"sonnet-4.6": "us.anthropic.claude-sonnet-4-6", "sonnet-4.5": "us.anthropic.claude-sonnet-4-5",
- "sonnet-5": "us.anthropic.claude-sonnet-5",
+ "opus-5": "us.anthropic.claude-opus-5", "sonnet-5": "us.anthropic.claude-sonnet-5",
"haiku-4.5": "us.anthropic.claude-haiku-4-5-20251001-v1:0", "fable-5": "us.anthropic.claude-fable-5",
}
_ANTHROPIC_CLAUDE = {
"opus-4.8": "claude-opus-4-8", "opus-4.7": "claude-opus-4-7", "opus-4.6": "claude-opus-4-6",
"opus-4.5": "claude-opus-4-5", "sonnet-4.6": "claude-sonnet-4-6", "sonnet-4.5": "claude-sonnet-4-5",
- "sonnet-5": "claude-sonnet-5",
+ "opus-5": "claude-opus-5", "sonnet-5": "claude-sonnet-5",
"haiku-4.5": "claude-haiku-4-5-20251001", "fable-5": "claude-fable-5",
}
@@ -3277,10 +3408,13 @@ _MODEL_CATALOG: dict[str, dict] = {
# claude additions probed through the Bedrock path).
"codex": {"default": "gpt-5.4",
"models": ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5",
- "gpt-5.4", "gpt-5.4-mini", "gpt-5.2"]},
- # claude-opus-5 (Anthropic, launched 2026-07-24): listed for selection; its friendly->provider-id
- # mapping is intentionally LEFT EMPTY for now (not yet in _ANTHROPIC_CLAUDE/_BEDROCK_CLAUDE), so a
- # request resolves through the existing unmapped fallback until the provider id is wired.
+ "gpt-5.4", "gpt-5.4-mini", "gpt-5.2",
+ # Codex-optimized line (separate from the general one; 5.3-codex is
+ # OpenAI's most capable agentic coding model, there is no 5.6-codex).
+ "gpt-5.3-codex", "gpt-5.2-codex"]},
+ # claude-opus-5 is now wired in both _ANTHROPIC_CLAUDE and _BEDROCK_CLAUDE (ids read off
+ # Anthropic's models overview and AWS's own model card), so it routes directly instead of
+ # falling through to the unmapped default it used at launch.
"claude": {"default": "claude-sonnet-4.6",
"models": ["claude-opus-5", "claude-fable-5", "claude-opus-4.8", "claude-sonnet-5",
"claude-opus-4.7", "claude-sonnet-4.6", "claude-haiku-4.5"]},
@@ -3292,6 +3426,7 @@ _MODEL_CATALOG: dict[str, dict] = {
"hermes": {"default": "gpt-5.4",
"models": ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.5",
"gpt-5.4", "gpt-5.4-mini", "gpt-5.2",
+ "gpt-5.3-codex", "gpt-5.2-codex",
"claude-opus-5", "claude-fable-5", "claude-opus-4.8", "claude-sonnet-5",
"claude-opus-4.7", "claude-sonnet-4.6", "claude-haiku-4.5",
# frontier US+China set, served via the TokenRouter/OpenRouter
diff --git a/ui/src/app/(app)/harnesses/[id]/page.tsx b/ui/src/app/(app)/harnesses/[id]/page.tsx
index 075bb122..35579755 100644
--- a/ui/src/app/(app)/harnesses/[id]/page.tsx
+++ b/ui/src/app/(app)/harnesses/[id]/page.tsx
@@ -14,6 +14,7 @@ import { HarnessLogo } from '@/components/HarnessLogo';
import { CopyId } from '@/components/CopyId';
import { SkillEditor, McpModal, type McpServer } from '@/components/HarnessEditors';
import { fetchTraceWindow, statsFor, p95Of, avgCreditsOf, type TraceCard } from '@/lib/revamp-data';
+import { SELF_HOSTED } from '@/lib/edition';
type Skill = CustomHarness['skills'][number];
const isOwnSkill = (s: Skill) => Boolean((s.files && s.files.length) || (s as { content?: string }).content || s.blob);
@@ -127,7 +128,9 @@ export default function HarnessSettingsPage() {
<button className="detail-metric" type="button" onClick={() => router.push(`/tasks?h=${encodeURIComponent(id)}`)}>
<span>Tasks</span><strong>{stats.tasks7d.toLocaleString()}</strong><small>Last 7 days</small></button>
<div className="detail-metric"><span>p95 duration</span><strong>{p95 ?? '—'}</strong><small>Recent tasks</small></div>
- <div className="detail-metric"><span>Credits / Task</span><strong>{creditsPerTask ?? '—'}</strong><small>Avg over priced runs</small></div>
+ {SELF_HOSTED ? null : (
+ <div className="detail-metric"><span>Credits / Task</span><strong>{creditsPerTask ?? '—'}</strong><small>Avg over priced runs</small></div>
+ )}
</div>
<form className="settings-form" onSubmit={(e) => { e.preventDefault(); void save(); }}>
diff --git a/ui/src/app/(app)/harnesses/page.tsx b/ui/src/app/(app)/harnesses/page.tsx
index 5055991d..88db26e9 100644
--- a/ui/src/app/(app)/harnesses/page.tsx
+++ b/ui/src/app/(app)/harnesses/page.tsx
@@ -9,6 +9,7 @@ import { OOB, oobById, oobDefaultModel, oobModels, useModelCatalog, createCustom
import { HarnessLogo } from '@/components/HarnessLogo';
import { CopyId } from '@/components/CopyId';
import { fetchHarnessRows, groupByHarness, timeAgo, p95Of, avgCreditsOf, type HarnessRow, type TraceCard } from '@/lib/revamp-data';
+import { SELF_HOSTED } from '@/lib/edition';
export default function HarnessesPage() {
useModelCatalog(); // model list comes from the gateway, not a local copy
@@ -94,7 +95,7 @@ export default function HarnessesPage() {
</div>
<div className="table-wrap">
<table className="harness-inventory-table">
- <thead><tr><th>Harness</th><th className="harness-desktop-col">Harness ID</th><th>Health</th><th className="harness-desktop-col">Base Harness</th><th className="harness-desktop-col">Tasks (7d)</th><th className="harness-desktop-col">Success</th><th className="harness-desktop-col">p95</th><th className="harness-desktop-col">Credits / Task</th><th className="harness-desktop-col">Last activity</th><th aria-label="Open"></th></tr></thead>
+ <thead><tr><th>Harness</th><th className="harness-desktop-col">Harness ID</th><th>Health</th><th className="harness-desktop-col">Base Harness</th><th className="harness-desktop-col">Tasks (7d)</th><th className="harness-desktop-col">Success</th><th className="harness-desktop-col">p95</th>{SELF_HOSTED ? null : <th className="harness-desktop-col">Credits / Task</th>}<th className="harness-desktop-col">Last activity</th><th aria-label="Open"></th></tr></thead>
<tbody>
{filtered.map((r) => {
const bad = isDegraded(r);
@@ -112,7 +113,7 @@ export default function HarnessesPage() {
<td className="number harness-desktop-col">{r.stats.tasks7d}</td>
<td className="number harness-desktop-col">{r.stats.success != null ? (r.stats.success * 100).toFixed(1) + '%' : '—'}</td>
<td className="number harness-desktop-col">{p95Of(byHarness.get(r.id)) ?? '—'}</td>
- <td className="number harness-desktop-col">{avgCreditsOf(byHarness.get(r.id)) ?? '—'}</td>
+ {SELF_HOSTED ? null : <td className="number harness-desktop-col">{avgCreditsOf(byHarness.get(r.id)) ?? '—'}</td>}
<td className="harness-desktop-col">{timeAgo(r.stats.lastActivity)}</td>
<td><button className="row-action" type="button" aria-label={`Open ${r.name}`}><iconify-icon icon="tabler:chevron-right"></iconify-icon></button></td>
</tr>
diff --git a/ui/src/app/(app)/integrations/page.tsx b/ui/src/app/(app)/integrations/page.tsx
index 131478ab..a3ebd06d 100644
--- a/ui/src/app/(app)/integrations/page.tsx
+++ b/ui/src/app/(app)/integrations/page.tsx
@@ -1,60 +1,54 @@
'use client';
-// Integrations, token-provider routing console (platform org only for now; the config is
-// GLOBAL: it decides which provider serves each model for every harness). Two sections per
-// the 2026-07-22 wireframe: (1) named provider integrations, each with credentials and its
-// supported-model list (canonical name -> the provider's real model id); (2) the
-// Model - Integration Mapping (canonical model -> which integration serves it).
+// Integrations — bring your own provider keys.
+//
+// An integration is a provider connection plus the models it serves; the mapping below decides
+// which integration serves each model when a harness runs it.
+//
+// The form is driven by the SERVER's provider catalog, not by a copy of it here. That catalog
+// knows each vendor's endpoint and the models it can address, so adding an integration asks for
+// a key and nothing else: a base URL we can look up is not a question worth asking, and a model
+// id the user has to transcribe is a support ticket waiting to happen. Both would also rot here
+// the moment the gateway learns a new model.
+//
// Server: GET/PUT /v1/admin/integrations (secrets sentinel'd, never round-tripped).
-// Later: customer BYOK writes the same schema to the org tenant.
import { harnessFetch } from '@/lib/hfetch';
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useRouter } from 'next/navigation';
import { SkelRows } from '@/components/Skel';
import { getSession } from '@/lib/auth';
import { authHeaders } from '@/lib/chat';
-import { PLATFORM_ADMIN_ORGS } from '@/lib/edition';
+import { PLATFORM_ADMIN_ORGS, SELF_HOSTED } from '@/lib/edition';
interface ModelRow { canonical: string; provider_id: string }
interface Integration { name: string; provider: string; config: Record<string, string>; models: ModelRow[] }
-interface Doc { integrations: Integration[]; model_map: Record<string, string>; providers: string[] }
+interface ProviderField { key: string; label: string; placeholder?: string }
+interface ProviderMeta {
+ id: string;
+ label: string;
+ /** Known endpoint, applied server-side. null means it genuinely varies, so `fields` asks. */
+ base_url: string | null;
+ fields: ProviderField[];
+ secret: string;
+ secret_label: string;
+ key_hint?: string;
+ models: ModelRow[];
+ backends: string[];
+}
+interface Doc {
+ integrations: Integration[];
+ model_map: Record<string, string>;
+ providers: string[];
+ catalog: ProviderMeta[];
+}
const SECRET = '__secret__';
-// Per-provider config fields (which of them is the secret). Shown in the Add/Edit panel.
-const PROVIDER_FIELDS: Record<string, { key: string; label: string; secret?: boolean; placeholder?: string }[]> = {
- 'azure-foundry': [
- { key: 'base_url', label: 'Endpoint URL', placeholder: 'https://<resource>.openai.azure.com/openai/v1' },
- { key: 'api_key', label: 'API Key', secret: true },
- ],
- bedrock: [
- { key: 'aws_region', label: 'AWS Region', placeholder: 'us-east-1' },
- { key: 'aws_bearer_token', label: 'API Key (bearer token)', secret: true },
- ],
- openrouter: [
- { key: 'base_url', label: 'Base URL', placeholder: 'https://openrouter.ai/api/v1' },
- { key: 'api_key', label: 'API Key', secret: true },
- ],
- tokenrouter: [
- { key: 'base_url', label: 'Base URL', placeholder: 'https://api.tokenrouter.com/v1' },
- { key: 'api_key', label: 'API Key', secret: true },
- ],
- openai: [
- { key: 'base_url', label: 'Base URL', placeholder: 'https://api.openai.com/v1' },
- { key: 'api_key', label: 'API Key', secret: true },
- ],
- anthropic: [
- { key: 'base_url', label: 'Base URL (optional)', placeholder: 'https://api.anthropic.com' },
- { key: 'api_key', label: 'API Key', secret: true },
- ],
-};
-const PROVIDER_LABEL: Record<string, string> = {
- 'azure-foundry': 'Azure OpenAI', bedrock: 'AWS Bedrock', openrouter: 'OpenRouter',
- tokenrouter: 'TokenRouter', openai: 'OpenAI', anthropic: 'Anthropic',
-};
export default function IntegrationsPage() {
const router = useRouter();
const org = getSession()?.orgId || '';
- const allowed = PLATFORM_ADMIN_ORGS.includes(org);
+ // Self-hosted is single-tenant: the operator owns the box and the keys, so there is nobody
+ // to withhold this from. The gateway makes the same call server-side.
+ const allowed = SELF_HOSTED || PLATFORM_ADMIN_ORGS.includes(org);
const [doc, setDoc] = useState<Doc | null>(null);
const [err, setErr] = useState('');
const [busy, setBusy] = useState(false);
@@ -90,6 +84,12 @@ export default function IntegrationsPage() {
} finally { setBusy(false); }
}
+ const catalog = useMemo(() => doc?.catalog || [], [doc]);
+ const metaFor = useCallback(
+ (id: string) => catalog.find((c) => c.id === id), [catalog]);
+ const labelFor = useCallback(
+ (id: string) => metaFor(id)?.label || id, [metaFor]);
+
// All canonical model names across integrations, the option set for the mapping rows.
const allCanonicals = useMemo(() => {
const s = new Set<string>();
@@ -136,7 +136,7 @@ export default function IntegrationsPage() {
<tr key={i.name} className="object-row" style={{ cursor: 'pointer' }}
onClick={() => { setEditing(JSON.parse(JSON.stringify(i))); setEditingOriginal(i.name); }}>
<td><strong>{i.name}</strong></td>
- <td>{PROVIDER_LABEL[i.provider] || i.provider}</td>
+ <td>{labelFor(i.provider)}</td>
<td className="itg-desktop-col"><span className="itg-models">{i.models.map((m) => m.canonical).join(', ') || '—'}</span></td>
<td className="itg-row-actions">
<button className="button danger-ghost" type="button" disabled={busy}
@@ -222,48 +222,76 @@ export default function IntegrationsPage() {
onChange={(e) => setEditing({ ...editing, name: e.target.value })} /></div>
<div className="field"><label>Provider</label>
<div className="itg-provider-list">
- {(doc.providers.length ? doc.providers : Object.keys(PROVIDER_FIELDS)).map((p) => (
- <button key={p} type="button"
- className={'itg-provider' + (editing.provider === p ? ' on' : '')}
+ {catalog.map((c) => (
+ <button key={c.id} type="button"
+ className={'itg-provider' + (editing.provider === c.id ? ' on' : '')}
disabled={Boolean(editingOriginal)}
- onClick={() => setEditing({ ...editing, provider: p, config: {} })}>
- {PROVIDER_LABEL[p] || p}
+ onClick={() => setEditing({ ...editing, provider: c.id, config: {} })}>
+ {c.label}
</button>
))}
</div>
</div>
- <div className="field"><label>Configs</label>
- <div className="field-stack">
- {(PROVIDER_FIELDS[editing.provider] || []).map((f) => (
- <div className="field" key={f.key}>
- <label htmlFor={`itg-${f.key}`} className="itg-sublabel">{f.label}</label>
- <input id={`itg-${f.key}`} type={f.secret ? 'password' : 'text'}
- value={editing.config[f.key] || ''} placeholder={f.secret && editing.config[f.key] === SECRET ? '•••••••• (saved)' : f.placeholder || ''}
- onChange={(e) => setEditing({ ...editing, config: { ...editing.config, [f.key]: e.target.value } })} />
- </div>
- ))}
- </div>
- </div>
- <div className="field"><label>Supported models</label>
- <p className="field-help">Canonical name (what users pick) → this provider&rsquo;s model id (what the API call uses).</p>
- <div className="itg-modelgrid">
- {editing.models.map((m, idx) => (
- <div className="itg-modelrow" key={idx}>
- <input value={m.canonical} placeholder="claude-opus-4.8" aria-label="Canonical model name"
- onChange={(e) => setEditing({ ...editing, models: editing.models.map((x, k) => k === idx ? { ...x, canonical: e.target.value } : x) })} />
- <span className="itg-arrow">→</span>
- <input value={m.provider_id} placeholder="anthropic/claude-opus-4.8" aria-label="Provider model id"
- onChange={(e) => setEditing({ ...editing, models: editing.models.map((x, k) => k === idx ? { ...x, provider_id: e.target.value } : x) })} />
- <button className="icon-button" type="button" aria-label="Remove model"
- onClick={() => setEditing({ ...editing, models: editing.models.filter((_, k) => k !== idx) })}>
- <iconify-icon icon="tabler:x"></iconify-icon></button>
- </div>
- ))}
- <button className="button" type="button"
- onClick={() => setEditing({ ...editing, models: [...editing.models, { canonical: '', provider_id: '' }] })}>
- <iconify-icon icon="tabler:plus"></iconify-icon>Add model</button>
- </div>
- </div>
+ {(() => {
+ const meta = metaFor(editing.provider);
+ if (!meta) return null;
+ // Only what varies by deployment. A provider with a known endpoint never
+ // shows a Base URL field — the server fills it in.
+ const fields = [...meta.fields,
+ { key: meta.secret, label: meta.secret_label,
+ placeholder: meta.key_hint }];
+ return (
+ <div className="field-stack">
+ {fields.map((f) => {
+ const secret = f.key === meta.secret;
+ const saved = secret && editing.config[f.key] === SECRET;
+ return (
+ <div className="field" key={f.key}>
+ <label htmlFor={`itg-${f.key}`}>{f.label}</label>
+ <input id={`itg-${f.key}`} type={secret ? 'password' : 'text'}
+ value={saved ? '' : (editing.config[f.key] || '')}
+ placeholder={saved ? '•••••••• (saved, leave blank to keep)' : f.placeholder || ''}
+ autoComplete="off"
+ onChange={(e) => setEditing({
+ ...editing,
+ config: { ...editing.config, [f.key]: e.target.value },
+ })} />
+ </div>
+ );
+ })}
+ {meta.base_url ? (
+ <p className="field-help">Endpoint: <code>{meta.base_url}</code></p>
+ ) : null}
+ </div>
+ );
+ })()}
+ {(() => {
+ const models = metaFor(editing.provider)?.models || [];
+ return (
+ <div className="field">
+ <label>Supported models</label>
+ <p className="field-help">
+ Maintained here, not by you: this integration serves the{' '}
+ <strong>{models.length}</strong> model{models.length === 1 ? '' : 's'} below, and
+ picks up new ones as they are added.
+ </p>
+ <details className="itg-modellist">
+ <summary>{models.map((m) => m.canonical).slice(0, 4).join(', ')}
+ {models.length > 4 ? ` and ${models.length - 4} more` : ''}</summary>
+ <ul>
+ {models.map((m) => (
+ <li key={m.canonical}>
+ <span>{m.canonical}</span>
+ {m.provider_id !== m.canonical
+ ? <code>{m.provider_id}</code>
+ : null}
+ </li>
+ ))}
+ </ul>
+ </details>
+ </div>
+ );
+ })()}
</div>
<div className="modal-actions">
<button className="button" type="button" onClick={() => setEditing(null)} disabled={busy}>Cancel</button>
@@ -273,7 +301,10 @@ export default function IntegrationsPage() {
// renames retarget the mapping rows that pointed at the old name
const mm = Object.fromEntries(Object.entries(doc.model_map).map(([k, v]) =>
[k, v === editingOriginal ? editing.name.trim() : v]));
- if (await persist({ integrations: [...rest, { ...editing, name: editing.name.trim() }], model_map: mm })) setEditing(null);
+ if (await persist({
+ integrations: [...rest, { ...editing, name: editing.name.trim(), models: [] }],
+ model_map: mm,
+ })) setEditing(null);
}}>{busy ? 'Saving…' : editingOriginal ? 'Save' : 'Create'}</button>
</div>
</div>
diff --git a/ui/src/components/revamp/Shell.tsx b/ui/src/components/revamp/Shell.tsx
index 5b215948..12cd7c0f 100644
--- a/ui/src/components/revamp/Shell.tsx
+++ b/ui/src/components/revamp/Shell.tsx
@@ -341,7 +341,9 @@ export function Shell({ children, credits }: { children: React.ReactNode; credit
<iconify-icon icon={n.icon}></iconify-icon>{n.label}
</Link>
))}
- {PLATFORM_NAV.filter((n) => n.orgs.includes(s?.orgId || '')).map((n) => (
+ {PLATFORM_NAV.filter((n) => (SELF_HOSTED
+ ? SELF_HOSTED_NAV.includes(n.href) // your own keys, on your own box
+ : n.orgs.includes(s?.orgId || ''))).map((n) => (
<Link key={n.href} className="side-nav" href={n.href} aria-current={isActive(n.href) ? 'page' : undefined}>
<iconify-icon icon={n.icon}></iconify-icon>{n.label}
</Link>
diff --git a/ui/src/lib/edition.ts b/ui/src/lib/edition.ts
index 41c1d964..4faf5bca 100644
--- a/ui/src/lib/edition.ts
+++ b/ui/src/lib/edition.ts
@@ -23,8 +23,12 @@ export const LOCAL_ORG = 'local';
export const LOCAL_MEMBER = 'local@localhost';
/** Sidebar entries a self-hosted box can actually serve. Everything else in the nav needs a
- * service that isn't in the container. */
-export const SELF_HOSTED_NAV = ['/harnesses', '/tasks'];
+ * service that isn't in the container.
+ *
+ * Integrations is here because bring-your-own-key IS the self-hosted product: without it the
+ * box has no credentials and every turn fails. Hosted it stays a platform-admin surface, since
+ * there the routing config is global. */
+export const SELF_HOSTED_NAV = ['/harnesses', '/tasks', '/integrations'];
/** Orgs allowed to see platform-admin surfaces (global model routing).
*