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 Endpoint | TS SDK | Python SDK |
|---|---|---|
POST /v1/agent/bootstrap | bootstrap() | bootstrap() |
GET /v1/agent/status | status() | status() |
GET /v1/agent/limits/me | limitsMe() | limits_me() |
GET /v1/agent/anomaly/me | anomalyMe() | anomaly_me() |
GET /v1/agent/profiles | list() | list() |
POST /v1/agent/profiles | create() | create() |
GET /v1/agent/profiles/me | me() | me() |
GET /v1/agent/profiles/:id | get() | get() |
PATCH /v1/agent/profiles/:id | update() | update() |
DELETE /v1/agent/profiles/:id | delete() | delete() |
PATCH /v1/agent/profiles/lifecycle/:id | transition() | transition() |
POST /v1/agent/delegate | delegateAgent() | delegate_agent() |
GET /v1/agent/sub-agents | listSubAgents() | list_sub_agents() |
DELETE /v1/agent/sub-agents/:id | terminateSubAgent() | terminate_sub_agent() |
POST /auth/agent-profiles/:id/delegate | adminDelegate() | admin_delegate() |
The /v1/agent-limits GET/PUT/PATCH endpoints are managed via direct HTTP calls or the tenant settings API.