Repository navigation
Proposal: Agent-native Admin API (scoped mnfst_admin_ai_* key) for self-hosted management #2746
sponsorrockit1
started this conversation in
Feature request
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
Self-hosted Manifest instances today are managed almost entirely through the
dashboard (browser session / owner API key). There is no stable, key-authenticated
machine surface for programmatically administering agents, attaching provider
keys, and reading routing/usage — the exact thing an AI agent or ops automation
needs to onboard and operate harnesses (OpenClaw, Hermes, etc.) without a human
in the browser.
I'd like to propose adding a scoped AI-admin API under
/api/v1/admin,gated by a new key scope (
ai_admin) carried on a dedicated key prefixmnfst_admin_ai_*. This is a thin, additive layer over the existing NestJSservice layer (agents, providers, routing, timeseries) — no new business logic,
no new infrastructure.
Why a new scope instead of reusing owner keys
Owner keys (
api_keysrows withscope='owner', prefixmnfst_*) resolve to thetenant but are also accepted by the dashboard's owner-only endpoints. An AI-admin
key should be narrowly scoped so it can administer agents/providers/observability
but cannot, by construction, hit owner-only account/session endpoints. The guard
enforces this:
AdminAiGuardrejects owner keys with 403 and unknown keys with 401.Design (additive, no breaking changes)
scopecolumn onapi_keys(defaultowner). Migration included.key_hashcolumn ontenant_providers(so provider keys can bematch-verified without ever returning the raw secret). Migration included.
ApiKeyGuardstashes the resolved scope on the request;AdminAiGuardauthorizes
/api/v1/admin/*toai_adminonly.GET/POST/DELETE /api/v1/admin/keys— mint/list/revoke admin keys (raw key returned exactly once at mint).GET/POST/PATCH/DELETE /api/v1/admin/agents[/:name]— full agent CRUD +rotate-key+duplicate(reusesAgentLifecycleServiceetc.).GET/POST /api/v1/admin/providers[/:provider/keys]— list + attach/update provider key.POST /api/v1/admin/providers/:provider/keys/verify— match-verify: you POST the key, it returns{ match: boolean }. The raw secret is never returned (addresses the "can I confirm a key is correct without exposing it" problem for BYOK).GET /api/v1/admin/observability/*— read-only usage + per-agent routing.Security properties
verifyKey), never a raw compare.Status
Implemented on a fork branch
feat/agent-admin-api, built into a local image,deployed to a live self-hosted instance, and exercised end-to-end (agent
CRUD, key rotate/duplicate, provider attach + match-verify both directions,
observability, scope enforcement 401/403). Build green, existing
custom-provider+provider-keyspecs still pass (22/22). A changeset is included.Questions for maintainers
ai_adminscope the preferred modeling, or would you rather see this expressed as a permission bitmask on the existing key?match-verify— useful as a first-class endpoint, or should it be folded into the existing provider update response?mnfst_admin_ai_*prefix — acceptable, or prefer something else?I've opened a corresponding PR from
sponsorrockit1:feat/agent-admin-apiso theimplementation can be reviewed alongside this proposal. Happy to adjust the
scope/shape to match project conventions before merge.
All reactions