Agent Resource Management Convergence — 17 endpoints, 15 SDK methods, 8 MCP tools unified

2026-03-10

agent-profilesagent-bootstrapagent-delegationagent-lifecycle

LOCKSTEP TRACEABILITY MATRIX --- api_endpoints: ["none — all 17 endpoints pre-existing"] sdk_methods_updated: ["none — all 15 methods pre-existing in both SDKs"] sdk_parity_status: "pre-existing" mcp_tools_updated: ["none — all 8 tools pre-existing, audit passed clean"] ---

What We Built

Consolidated BrainstormRouter's agent management system — previously scattered across 6 API route files, 2 SDKs, 8 MCP tools, a 506-line dashboard page, and 4 separate concept docs — into a single coherent product area with unified documentation.

Added 3 new documentation pages (API reference, lifecycle concept, SDK reference), 33 lifecycle state machine test cases, and verified cross-surface parity across all 9 surfaces.

Why It Matters

Enterprise teams deploying AI agent fleets need a single source of truth for agent identity, lifecycle governance, budget enforcement, and delegation authority. Before this phase, the agent management capability existed but was documented across scattered concept pages without a unified API reference or SDK guide. Now operators can find everything in one place: bootstrap an agent, manage its lifecycle, delegate budget, and monitor anomalies.

How It Works

Lifecycle State Machine

provisioned → active → quarantined ↔ active → suspended → terminated

Five states, seven valid transitions. Terminated is terminal. Enforcement happens at request time via JWT middleware — suspended agents get 402, terminated get 403.

Budget Delegation (Atomic)

const child = await client.agentProfiles.delegateAgent({
  agent_id: "child-worker-01",
  budget_allocation_usd: 1.0,
  ttl_seconds: 3600,
});

Parent budget decreases and child budget is set in a single Postgres transaction. Parents must retain at least $0.01. Children cannot escalate beyond parent's role.

Self-Awareness

const status = await client.agentProfiles.status();
// { profile, limits, anomaly, governance }

Agents can introspect their own profile, budget remaining, rate limit usage, and security events — all with a single call.

The Numbers

MetricValue
API endpoints17 across 6 route files
TS SDK methods15 (including adminDelegate)
Python SDK methods15 sync + 15 async
MCP tools8
Lifecycle states5
Valid transitions7
Dashboard pages2 (workforce + agents)
New test cases33 (7 valid transitions, 18 invalid, 1 terminal, 4 reachability, 3 role subset)
Ship log entries3 (ARM, bootstrap, convergence)

Competitive Edge

No competing platform (Portkey, OpenRouter, Lasso, Letta) offers a unified agent lifecycle with atomic budget delegation, self-awareness APIs, and TTL enforcement. BrainstormRouter treats agents as workforce members with HR-grade governance: provisioning, quarantine, suspension, termination, and budget reclamation — all auditable, all API-first.

Cross-Surface Parity Matrix

API RouteMethodTS SDKPython SDKMCP ToolDocsDashboard
POST /v1/agent/bootstrapPOSTbootstrap()bootstrap()br_bootstrap_agentAPI refProvision form
GET /v1/agent/statusGETstatus()status()br_agent_statusAPI ref
GET /v1/agent/limits/meGETlimitsMe()limits_me()br_agent_limitsAPI refBudget gauges
GET /v1/agent/anomaly/meGETanomalyMe()anomaly_me()br_agent_anomalyAPI refAnomaly dots
GET /v1/agent/profilesGETlist()list()br_list_agentsAPI refAgent roster
POST /v1/agent/profilesPOSTcreate()create()API ref
GET /v1/agent/profiles/meGETme()me()API ref
GET /v1/agent/profiles/:idGETget()get()API refAgent dossier
PATCH /v1/agent/profiles/:idPATCHupdate()update()API ref
DELETE /v1/agent/profiles/:idDELETEdelete()delete()API ref
PATCH /v1/agent/profiles/lifecycle/:idPATCHtransition()transition()API refLifecycle badges
POST /v1/agent/delegatePOSTdelegateAgent()delegate_agent()br_delegate_agentAPI refHierarchy tree
GET /v1/agent/sub-agentsGETlistSubAgents()list_sub_agents()br_list_sub_agentsAPI refChild list
DELETE /v1/agent/sub-agents/:idDELETEterminateSubAgent()terminate_sub_agent()br_terminate_sub_agentAPI refTerminate btn
POST /auth/agent-profiles/:id/delegatePOSTadminDelegate()admin_delegate()Delegate bridge

Tenant Administration (not part of agent profiles SDK scope):

API RouteMethodTS SDKPython SDKMCP ToolDocsDashboard
GET /v1/agent-limitsGETAPI ref
PUT /v1/agent-limitsPUTAPI ref
PATCH /v1/agent-limitsPATCHAPI ref

Intentional omissions:

  • Profile CRUD (create, get by ID, update, delete, me) are admin operations not exposed via MCP — agents use bootstrap/status instead
  • /v1/agent-limits is tenant-level configuration, not an individual agent operation — excluded from SDK agentProfiles scope by design, managed via tenant settings or direct HTTP
  • adminDelegate uses the /auth/ Supabase bridge, not the /v1/ path — dashboard-specific

MCP Audit Results

All 8 agent MCP tools audited against HTTP RBAC (24 checks):

  • Names: match ✓
  • Descriptions: match ✓
  • Permissions: match ✓

agents.json entries exactly match tool-manifest.ts. src/mcp/server.ts evaluated — agent deps already wired, no changes needed.

Dashboard Verification Audit

Dashboard agent management spans two surfaces: site/dashboard/src/pages/workforce.ts (roster, hierarchy, shadow AI) and site/dashboard/src/components/agent-dossier.ts (full agent detail panel).

Workforce page (workforce.ts, 506 LOC):

  1. Lifecycle state badges — 5 states with color-coded CSS classes (cc-lifecycle-provisioned, etc.) ✓
  2. Delegation hierarchy — tree view with parent-child relationships and TTL indicators ✓
  3. Budget governance — radial gauge per agent card showing daily budget ✓
  4. Shadow AI detection — unmanaged API keys surfaced with "bring under governance" action ✓
  5. Agent provisioning — button always visible (no admin gate on the button itself; the API enforces auth) ✓
  6. Sub-agent termination — admin-gated terminate buttons; page refreshes on success (no budget refund amount displayed in UI) ✓

Agent dossier (agent-dossier.ts, 563 LOC):

  1. Ownership metadata — ownerId and costCenter displayed in dossier header meta row ✓
  2. Lifecycle transition actions — buttons matching backend state machine (fixed in this phase: removed invalid direct-to-terminated transitions) ✓
  3. Budget editing — inline budget editor for daily and monthly limits ✓
  4. Delegation — delegate sub-agent drawer with role selector and JWT display ✓

Corrections from initial audit: Roster cards do not display ownerId/costCenter (those appear in the dossier). Provisioning button is not admin-gated in the UI (API enforces auth). Terminate buttons do not display budget_refunded_usd (page refreshes instead).

Lockstep Checklist

  • N/A API Routes: All 17 endpoints pre-existing across 6 route files. No new endpoints in this phase.
  • N/A TS SDK: All 15 methods pre-existing. No API changes → no SDK updates needed.
  • N/A Python SDK: All 15 sync + 15 async methods pre-existing. No API changes → no SDK updates needed.
  • N/A MCP Schemas: 8 tools audited clean (24/24 checks pass). No updates needed.
  • [x] Docs: 3 new pages added (API reference, lifecycle concept, SDK agents).
  • [x] Dashboard: Fixed lifecycle transition map in agent-dossier.ts (removed invalid direct-to-terminated transitions). Verified workforce page and dossier against acceptance criteria.
  • [x] Tests: 33 new test cases for lifecycle state machine and role subset enforcement.