Agent Profiles

SDK methods for agent bootstrap, profiles, lifecycle, delegation, and self-awareness.

Agent Profiles SDK

Both the TypeScript and Python SDKs cover agent bootstrap, profiles, lifecycle, delegation, and self-awareness through the agentProfiles resource. These 15 methods cover individual agent operations.

> Note: The /v1/agent-limits endpoints (GET/PUT/PATCH) are tenant-level configuration endpoints not included in the agentProfiles resource. Manage agent limits via tenant settings or direct HTTP. See the Agent API Reference for details.

TypeScript

import { BrainstormRouter } from "brainstormrouter";

const client = new BrainstormRouter({ apiKey: "br_..." });

Bootstrap

const result = await client.agentProfiles.bootstrap({
  agent_id: "sales-bot-01",
  display_name: "Sales Assistant",
  budget_daily_usd: 5.0,
  metadata: { can_delegate: true },
});
// result.jwt — use for subsequent agent-authenticated calls
// result.profile — the created AgentProfile
// result.budget — enforced limits

Self-Awareness

// Full status (requires agent JWT auth)
const status = await client.agentProfiles.status();
// status.profile, status.limits, status.anomaly, status.governance

// Budget and rate limits only
const limits = await client.agentProfiles.limitsMe();
// limits.limits.enforced_daily_remaining_usd

// Security events
const anomaly = await client.agentProfiles.anomalyMe();
// anomaly.events

Profile CRUD

// List all profiles (admin/operator)
const { profiles, total } = await client.agentProfiles.list();

// Create profile directly (without JWT minting)
const { profile } = await client.agentProfiles.create({
  agentId: "my-agent",
  displayName: "My Agent",
  role: "agent",
});

// Read
const { profile } = await client.agentProfiles.get("my-agent");

// Self-read (agent JWT auth)
const { profile } = await client.agentProfiles.me();

// Update
const { profile } = await client.agentProfiles.update("my-agent", {
  costCenter: "eng-team",
});

// Delete (admin only — hard delete)
await client.agentProfiles.delete("my-agent");

Lifecycle Transitions

// Requires agent.lifecycle.manage permission
const { profile } = await client.agentProfiles.transition("my-agent", "quarantined");

Delegation

// Parent delegates to child (requires agent JWT + can_delegate)
const child = await client.agentProfiles.delegateAgent({
  agent_id: "child-worker-01",
  budget_allocation_usd: 1.0,
  requested_role: "agent",
  ttl_seconds: 3600,
});
// child.jwt — child's JWT
// child.profile — child's profile

// List children
const { sub_agents } = await client.agentProfiles.listSubAgents();

// Terminate child and reclaim budget
const result = await client.agentProfiles.terminateSubAgent("child-worker-01");
// result.budget_refunded_usd

Admin Delegation (Dashboard Bridge)

> adminDelegate() targets POST /auth/agent-profiles/:id/delegate, which requires Supabase dashboard auth — not API-key auth. Use a dashboard-authenticated client:

import { BrainstormRouter } from "brainstormrouter";

// Dashboard-authenticated client (Supabase bearer token)
const dashClient = new BrainstormRouter({ apiKey: supabaseAccessToken });

const child = await dashClient.agentProfiles.adminDelegate("parent-agent", {
  childAgentId: "child-01",
  role: "agent",
  budgetUsd: 2.0,
});

---

Python

from brainstormrouter import BrainstormRouter

client = BrainstormRouter(api_key="br_...")

Bootstrap

result = client.agent_profiles.bootstrap(
    agent_id="sales-bot-01",
    display_name="Sales Assistant",
    budget_daily_usd=5.0,
    metadata={"can_delegate": True},
)
# result["jwt"], result["profile"], result["budget"]

Self-Awareness

status = client.agent_profiles.status()
limits = client.agent_profiles.limits_me()
anomaly = client.agent_profiles.anomaly_me()

Profile CRUD

profiles = client.agent_profiles.list()
profile = client.agent_profiles.create(agent_id="my-agent", role="agent")
profile = client.agent_profiles.get("my-agent")
profile = client.agent_profiles.me()
profile = client.agent_profiles.update("my-agent", costCenter="eng-team")
client.agent_profiles.delete("my-agent")

Lifecycle Transitions

profile = client.agent_profiles.transition("my-agent", "quarantined")

Delegation

child = client.agent_profiles.delegate_agent(
    agent_id="child-01",
    budget_allocation_usd=1.0,
    ttl_seconds=3600,
)
sub_agents = client.agent_profiles.list_sub_agents()
result = client.agent_profiles.terminate_sub_agent("child-01")

Async Python

All methods are also available on AsyncAgentProfiles:

from brainstormrouter import AsyncBrainstormRouter

client = AsyncBrainstormRouter(api_key="br_...")
result = await client.agent_profiles.bootstrap(agent_id="my-agent")

---

Method Coverage

API EndpointTS SDKPython SDK
POST /v1/agent/bootstrapbootstrap()bootstrap()
GET /v1/agent/statusstatus()status()
GET /v1/agent/limits/melimitsMe()limits_me()
GET /v1/agent/anomaly/meanomalyMe()anomaly_me()
GET /v1/agent/profileslist()list()
POST /v1/agent/profilescreate()create()
GET /v1/agent/profiles/meme()me()
GET /v1/agent/profiles/:idget()get()
PATCH /v1/agent/profiles/:idupdate()update()
DELETE /v1/agent/profiles/:iddelete()delete()
PATCH /v1/agent/profiles/lifecycle/:idtransition()transition()
POST /v1/agent/delegatedelegateAgent()delegate_agent()
GET /v1/agent/sub-agentslistSubAgents()list_sub_agents()
DELETE /v1/agent/sub-agents/:idterminateSubAgent()terminate_sub_agent()
POST /auth/agent-profiles/:id/delegateadminDelegate()admin_delegate()

The /v1/agent-limits GET/PUT/PATCH endpoints are managed via direct HTTP calls or the tenant settings API.