Agent registrar: self-service agent identities via the MCP gateway #15

Merged
ClaudiuSchuster merged 1 commit from oss-oo/agent-registrar into main 2026-09-22 22:21:17 +00:00

What

Self-service agent registrar on the MCP gateway: sponsors mint dedicated
agent identities (forge user + scoped token) in one audited call, revoke them
instantly, and list the ledger — no operator bottleneck.

Owner decisions captured in-session (2026-09-23): registrar service account
(admin strategy b), quota 10 per sponsor, JSONL ledger + monthly digest issue,
free logins with reserved-name denylist.

How

  • agent-gateway/registrar.py — registrar engine. Privileged operations run
    through one channel so no admin token ever sits on a sponsor station:
    ssh mode executes forgejo CLI (admin user create --random-password,
    admin user generate-access-token --raw) and server-side curl
    (BasicAuth token delete / user deactivate, credentials sourced from
    /opt/oss-oo/.env); local mode drives the compose stack for e2e.
  • Security: one-time token return (40-hex scrubbed from every error path),
    scope allowlist (no all/admin scopes), login regex + denylist,
    mandatory contact_email, quota per sponsor from the append-only JSONL
    ledger, audit-before-return with mint rollback if the ledger is down.
  • scripts/registrar-digest.sh — monthly digest issue in this repo
    (counts + logins only; idempotent via DB-backed issue list — the q=
    search index races fresh issues).
  • E2E: scripts/e2e-local.sh now proves the full round-trip (gates, mint,
    agent-token API use, admin-API closure, revoke, quota, deactivation,
    one-time discipline, digest create + idempotency). Green on this station
    against the pinned stack, before and after rebase onto current main.

Docs: docs/AGENT_PLATFORM.md (sketch → live API), docs/RUNBOOK.md
(registrar ops + revocation runbook incl. DB+restart last resort),
agent-gateway/README.md, /agents/ page (roadmap → real instructions).

Follow-up after merge: server-side setup (registrar account, .env keys,
ledger dir, digest cron) + live scratch-agent proof — documented in RUNBOOK.

## What Self-service **agent registrar** on the MCP gateway: sponsors mint dedicated agent identities (forge user + scoped token) in one audited call, revoke them instantly, and list the ledger — no operator bottleneck. Owner decisions captured in-session (2026-09-23): registrar service account (admin strategy b), quota 10 per sponsor, JSONL ledger + monthly digest issue, free logins with reserved-name denylist. ## How - `agent-gateway/registrar.py` — registrar engine. Privileged operations run through one channel so no admin token ever sits on a sponsor station: ssh mode executes forgejo CLI (`admin user create --random-password`, `admin user generate-access-token --raw`) and server-side curl (BasicAuth token delete / user deactivate, credentials sourced from `/opt/oss-oo/.env`); local mode drives the compose stack for e2e. - Security: one-time token return (40-hex scrubbed from every error path), scope allowlist (no `all`/admin scopes), login regex + denylist, mandatory `contact_email`, quota per sponsor from the append-only JSONL ledger, audit-before-return with mint rollback if the ledger is down. - `scripts/registrar-digest.sh` — monthly digest issue in this repo (counts + logins only; idempotent via DB-backed issue list — the `q=` search index races fresh issues). - E2E: `scripts/e2e-local.sh` now proves the full round-trip (gates, mint, agent-token API use, admin-API closure, revoke, quota, deactivation, one-time discipline, digest create + idempotency). Green on this station against the pinned stack, before and after rebase onto current main. Docs: `docs/AGENT_PLATFORM.md` (sketch → live API), `docs/RUNBOOK.md` (registrar ops + revocation runbook incl. DB+restart last resort), `agent-gateway/README.md`, `/agents/` page (roadmap → real instructions). Follow-up after merge: server-side setup (registrar account, `.env` keys, ledger dir, digest cron) + live scratch-agent proof — documented in RUNBOOK.
Agent registrar: self-service agent identities via the MCP gateway
All checks were successful
ci / ci (pull_request) Successful in 3s
bcff1f752f
Sponsor-authenticated mint/revoke/list of dedicated agent identities.
Privileged operations never put an admin token on a sponsor station:
user creation and token minting run through the forgejo CLI on the
server (ssh mode) or the local compose stack (e2e mode); token deletion
and user deactivation use registrar-service-account BasicAuth, with
credentials sourced server-side only.

- agent-gateway/registrar.py: registrar engine (create/revoke/list),
  scope allowlist (no all/admin scopes), login regex + reserved denylist,
  contact_email mandatory, quota per sponsor (default 10) from the
  append-only JSONL ledger, one-time token return with 40-hex redaction
  in every error path
- mcp_forgejo.py: three new tools, lazy registrar dispatch, v0.2.0
- scripts/registrar-digest.sh: monthly digest issue in the laboratory
  repo (idempotent; DB-backed issue list because the q= search index
  races a freshly created issue)
- scripts/e2e-local.sh + test_mcp.py: full registrar round-trip against
  the local stack — gates (scope/denylist/format), mint, agent-token API
  use, admin-API closure, revoke, quota, deactivation, one-time-token
  discipline, digest create + idempotency
- docs + /agents/: registrar documented as live, operator flow demoted
  to fallback; RUNBOOK gains registrar ops, revocation runbook incl.
  DB+restart last resort, and digest cron
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
OSS-OO/laboratory!15
No description provided.