Skip to main content

Register Agent

Register a new AI agent with the Ascend governance platform. Registered agents can submit actions for authorization and have configurable risk thresholds.

Endpoint

POST /api/registry/agents

Authentication

This endpoint supports both authentication methods:

  • API Key: X-API-Key header
  • JWT Token: Authorization: Bearer <token> header

Request

Headers

HeaderRequiredDescription
X-API-KeyYes*Your API key
AuthorizationYes*Bearer token (alternative to X-API-Key)
Content-TypeYesMust be application/json

*One of X-API-Key or Authorization is required.

Body

{
"agent_id": "my-production-agent",
"display_name": "Production Database Agent",
"description": "Agent for automated database operations",
"agent_type": "supervised",
"default_risk_score": 50,
"max_risk_threshold": 80,
"auto_approve_below": 30,
"requires_mfa_above": 70,
"allowed_action_types": ["database_query", "database_read"],
"allowed_resources": ["production-db", "staging-db"],
"blocked_resources": ["customer-pii"],
"is_mcp_server": false,
"alert_on_high_risk": true,
"alert_recipients": ["security@company.com"],
"webhook_url": "https://your-server.com/webhooks/ascend",
"tags": ["production", "database"],
"metadata": {
"team": "data-engineering",
"owner": "data-team@company.com"
}
}

Parameters

ParameterTypeRequiredDescription
agent_idstringYesUnique identifier (3-64 chars)
display_namestringYesHuman-readable name (max 255 chars)
descriptionstringNoAgent description
agent_typestringNoType: autonomous, supervised, advisory, mcp_server, custom (default: supervised)
default_risk_scoreintegerNoDefault risk score 0-100 (default: 50)
max_risk_thresholdintegerNoRisk threshold requiring approval (default: 80)
auto_approve_belowintegerNoAuto-approve actions below this score (default: 30)
requires_mfa_aboveintegerNoRequire MFA for approval above this score (default: 70)
allowed_action_typesarrayNoAllowed action types
allowed_resourcesarrayNoAllowed resource targets
blocked_resourcesarrayNoBlocked resource targets
is_mcp_serverbooleanNoWhether this is an MCP server (default: false)
mcp_server_urlstringNoMCP server URL (if MCP server)
mcp_capabilitiesobjectNoMCP capabilities configuration
alert_on_high_riskbooleanNoSend alerts for high-risk actions (default: true)
alert_recipientsarrayNoEmail addresses for alerts
webhook_urlstringNoWebhook URL for notifications
tagsarrayNoTags for organization
metadataobjectNoCustom metadata

Agent Types

TypeDescriptionDefault Thresholds
supervisedHuman oversight required for risky actionsauto_approve < 30, require_approval >= 80
autonomousCan operate independently with stricter limitsauto_approve < 20, require_approval >= 60
advisoryRead-only agent for analysisauto_approve < 40, require_approval >= 90
mcp_serverMCP-compatible server registrationConfigurable per tool
customCustom configurationUser-defined

Response

Success (201 Created)

{
"success": true,
"created": true,
"agent": {
"id": 123,
"agent_id": "my-production-agent",
"display_name": "Production Database Agent",
"status": "draft",
"version": "1.0.0",
"agent_type": "supervised",
"created_at": "2026-01-20T14:30:52Z",
"organization_id": 1
},
"message": "Agent registered: my-production-agent",
"next_steps": [
"Configure policies using POST /api/registry/agents/{id}/policies",
"Activate agent using POST /api/registry/agents/{id}/activate",
"Submit actions using POST /api/v1/actions/submit"
]
}

Already Exists (200 OK)

If the agent already exists:

{
"success": true,
"created": false,
"agent": {
"id": 123,
"agent_id": "my-production-agent",
"display_name": "Production Database Agent",
"status": "active",
"version": "1.2.0",
"agent_type": "supervised",
"created_at": "2026-01-15T10:00:00Z",
"organization_id": 1
},
"message": "Agent already exists: my-production-agent"
}

Response Fields

FieldTypeDescription
successbooleanWhether the operation succeeded
createdbooleanWhether a new agent was created
agent.idintegerInternal database ID
agent.agent_idstringYour unique agent identifier
agent.display_namestringHuman-readable name
agent.statusstringdraft, active, or suspended
agent.versionstringSemantic version of configuration
agent.agent_typestringAgent type
agent.created_atstringISO 8601 creation timestamp
agent.organization_idintegerOrganization ID
messagestringStatus message
next_stepsarrayRecommended next actions

Agent Status Values

StatusDescriptionCan Submit Actions
draftNewly registered, not yet activatedNo
activeActivated and operationalYes
suspendedSuspended by admin or auto-suspensionNo

Errors

CodeDescription
400Bad request - validation error
401Unauthorized - missing or invalid credentials
409Conflict - agent_id already exists
500Internal server error

Validation Error (400):

{
"detail": "agent_id must be 3-64 characters",
"error_code": "VALIDATION_ERROR",
"status": 400
}

Agent Lifecycle

  1. Register - Agent is created in draft status
  2. Configure - Add policies and settings
  3. Activate - Admin activates agent (POST /api/registry/agents/{id}/activate)
  4. Operate - Agent can submit actions
  5. Suspend - Admin or auto-suspend disables agent

Examples

cURL

curl -X POST https://pilot.owkai.app/api/registry/agents \
-H "X-API-Key: owkai_admin_aBcDeFgHiJkLmNoPqRsTuVwXyZ123456789" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "my-production-agent",
"display_name": "Production Database Agent",
"description": "Agent for automated database operations",
"agent_type": "supervised",
"auto_approve_below": 30,
"max_risk_threshold": 80,
"allowed_action_types": ["database_query", "database_read"],
"tags": ["production", "database"]
}'

Python

from ascend import AscendClient

client = AscendClient(api_key="owkai_admin_...")

# Register a new agent
result = client.agents.register(
agent_id="my-production-agent",
display_name="Production Database Agent",
description="Agent for automated database operations",
agent_type="supervised",
auto_approve_below=30,
max_risk_threshold=80,
allowed_action_types=["database_query", "database_read"],
tags=["production", "database"]
)

if result.created:
print(f"New agent registered: {result.agent.agent_id}")
else:
print(f"Agent already exists: {result.agent.agent_id}")

Node.js

import { AscendClient } from '@ascend-ai/sdk';

const client = new AscendClient({ apiKey: 'owkai_admin_...' });

const result = await client.agents.register({
agentId: 'my-production-agent',
displayName: 'Production Database Agent',
description: 'Agent for automated database operations',
agentType: 'supervised',
autoApproveBelow: 30,
maxRiskThreshold: 80,
allowedActionTypes: ['database_query', 'database_read'],
tags: ['production', 'database']
});

console.log(`Agent status: ${result.agent.status}`);

Python (requests)

import requests

response = requests.post(
"https://pilot.owkai.app/api/registry/agents",
headers={
"X-API-Key": "owkai_admin_...",
"Content-Type": "application/json"
},
json={
"agent_id": "my-production-agent",
"display_name": "Production Database Agent",
"description": "Agent for automated database operations",
"agent_type": "supervised",
"auto_approve_below": 30,
"max_risk_threshold": 80,
"allowed_action_types": ["database_query", "database_read"]
}
)

result = response.json()
print(f"Created: {result['created']}")
print(f"Status: {result['agent']['status']}")

After Registration

After registering an agent:

1. Add Policies

curl -X POST https://pilot.owkai.app/api/registry/agents/my-production-agent/policies \
-H "X-API-Key: owkai_admin_..." \
-H "Content-Type: application/json" \
-d '{
"policy_name": "Block PII Access",
"policy_description": "Block access to PII data",
"policy_action": "block",
"conditions": {"resource_contains": "pii"},
"priority": 100
}'

2. Activate the Agent

curl -X POST https://pilot.owkai.app/api/registry/agents/my-production-agent/activate \
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiI..."

3. Submit Actions

curl -X POST https://pilot.owkai.app/api/v1/actions/submit \
-H "X-API-Key: owkai_admin_..." \
-H "Content-Type: application/json" \
-d '{
"agent_id": "my-production-agent",
"action_type": "database_query",
"description": "Query user data",
"tool_name": "postgresql"
}'