Skip to main content

Submit Action

Submit an agent action through the complete 7-step governance pipeline for risk assessment, policy evaluation, and authorization.

Endpoint

POST /api/v1/actions/submit

Authentication

This endpoint supports both authentication methods:

  • API Key: X-API-Key header (recommended for SDKs)
  • 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",
"action_type": "database_query",
"description": "Query user records from production database",
"tool_name": "postgresql",
"target_system": "production-db-01",
"nist_control": "AC-3",
"mitre_tactic": "TA0009"
}

Parameters

ParameterTypeRequiredDescription
agent_idstringYesUnique identifier for the AI agent
action_typestringYesType of action (e.g., database_query, file_write, api_call)
descriptionstringYesHuman-readable description of the action
tool_namestringYesName of the tool/service being used
target_systemstringNoTarget system identifier
target_resourcestringNoSpecific resource being accessed
nist_controlstringNoNIST 800-53 control ID (auto-detected if omitted)
mitre_tacticstringNoMITRE ATT&CK tactic ID (auto-detected if omitted)
action_detailsobjectNoAdditional context for code/prompt analysis

Action Details Object

For enhanced security analysis, include action details:

{
"agent_id": "code-assistant",
"action_type": "code_execution",
"description": "Execute SQL query",
"tool_name": "database",
"action_details": {
"query": "SELECT * FROM users WHERE id = $1",
"code": "def process_data(x): return x * 2",
"command": "ls -la /var/log"
}
}

Response

Success (200 OK)

{
"id": 12345,
"action_id": 12345,
"status": "approved",
"risk_score": 35.0,
"risk_level": "low",
"cvss_score": 3.5,
"cvss_severity": "LOW",
"cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N",
"requires_approval": false,
"alert_triggered": false,
"alert_id": null,
"workflow_id": null,
"policy_decision": "allow",
"matched_policies": 2,
"matched_smart_rules": 0,
"correlation_id": "action_20260120_143052_abc12345",
"processing_time_ms": 45,
"action_type": "database_query",
"nist_control": "AC-3",
"nist_description": "Access Enforcement",
"mitre_tactic": "TA0009",
"mitre_technique": "T1005",
"thresholds": {
"auto_approve_below": 30,
"max_risk_threshold": 80,
"agent_type": "supervised",
"is_registered": true
},
"code_analysis": null,
"prompt_security": null,
"message": "Action processed through complete governance pipeline - Status: approved"
}

Pending Approval (200 OK)

When the action requires human approval:

{
"id": 12346,
"action_id": 12346,
"status": "pending_approval",
"risk_score": 75.0,
"risk_level": "high",
"cvss_score": 7.5,
"cvss_severity": "HIGH",
"requires_approval": true,
"alert_triggered": true,
"alert_id": 789,
"workflow_id": 42,
"policy_decision": "require_approval",
"correlation_id": "action_20260120_143055_def67890",
"message": "Action processed through complete governance pipeline - Status: pending_approval"
}

Response Fields

FieldTypeDescription
idintegerUnique action identifier
action_idintegerAlias for id (SDK compatibility)
statusstringapproved, pending_approval, or denied
risk_scorefloatCalculated risk score (0-100)
risk_levelstringlow, medium, high, or critical
cvss_scorefloatCVSS v3.1 base score (0-10)
cvss_severitystringCVSS severity rating
cvss_vectorstringCVSS v3.1 vector string
requires_approvalbooleanWhether human approval is required
alert_triggeredbooleanWhether a security alert was created
alert_idintegerID of created alert (if any)
workflow_idintegerID of assigned approval workflow (if any)
policy_decisionstringPolicy engine decision: allow, deny, require_approval
matched_policiesintegerNumber of policies that matched
matched_smart_rulesintegerNumber of smart rules that matched
correlation_idstringUnique ID for request tracing
processing_time_msintegerTotal processing time in milliseconds
nist_controlstringMapped NIST 800-53 control
mitre_tacticstringMapped MITRE ATT&CK tactic
thresholdsobjectAgent-specific threshold configuration
code_analysisobjectCode security analysis results (if applicable)
prompt_securityobjectPrompt injection analysis results (if applicable)

Errors

CodeDescription
400Bad request - invalid JSON or parameters
401Unauthorized - missing or invalid credentials
402Payment required - spend limit exceeded
403Forbidden - action denied by policy
422Unprocessable entity - missing required fields
429Too many requests - rate limit exceeded
500Internal server error

Validation Error (422):

{
"detail": "Missing required fields: agent_id, action_type",
"error_code": "MISSING_FIELD",
"status": 422
}

Rate Limit Error (429):

{
"detail": "Rate limit exceeded: 100 requests per minute",
"error_code": "RATE_LIMIT_EXCEEDED",
"status": 429,
"retry_after": 45
}

Spend Limit Error (402):

{
"detail": "Spend limit exceeded or kill-switch active",
"error_code": "SPEND_LIMIT_EXCEEDED",
"status": 402
}

Governance Pipeline

The submit endpoint processes actions through a complete 7-step governance pipeline:

  1. Risk Assessment - Security enrichment with NIST/MITRE mapping
  2. CVSS Calculation - Quantitative risk scoring using CVSS v3.1
  3. Policy Evaluation - Check against organization governance policies
  4. Smart Rules Check - Evaluate custom pattern-based rules
  5. Alert Generation - Create alerts for high-risk actions (risk >= 70)
  6. Workflow Routing - Assign to approval workflow if required
  7. Audit Logging - Immutable compliance trail

Risk Thresholds

Actions are evaluated against configurable thresholds:

Risk ScoreRisk LevelDefault Behavior
0-29LowAuto-approved
30-69MediumPolicy-dependent
70-84HighRequires approval, alert generated
85-100CriticalRequires approval, alert generated

Registered agents can have custom thresholds configured.

Examples

cURL

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

Python

from ascend import AscendClient

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

result = client.actions.submit(
agent_id="my-production-agent",
action_type="database_query",
description="Query user records from production database",
tool_name="postgresql",
target_system="production-db-01"
)

if result.status == "approved":
print(f"Action approved! ID: {result.id}")
# Proceed with the action
elif result.status == "pending_approval":
print(f"Action requires approval. ID: {result.id}")
# Wait for approval or notify user
elif result.status == "denied":
print(f"Action denied by policy")
# Handle denial

Node.js

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

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

const result = await client.actions.submit({
agentId: 'my-production-agent',
actionType: 'database_query',
description: 'Query user records from production database',
toolName: 'postgresql',
targetSystem: 'production-db-01'
});

if (result.status === 'approved') {
console.log(`Action approved! ID: ${result.id}`);
} else if (result.status === 'pending_approval') {
console.log(`Action requires approval. ID: ${result.id}`);
} else if (result.status === 'denied') {
console.log('Action denied by policy');
}

Python (requests)

import requests

response = requests.post(
"https://pilot.owkai.app/api/v1/actions/submit",
headers={
"X-API-Key": "owkai_admin_...",
"Content-Type": "application/json"
},
json={
"agent_id": "my-production-agent",
"action_type": "database_query",
"description": "Query user records from production database",
"tool_name": "postgresql",
"target_system": "production-db-01"
}
)

result = response.json()
print(f"Status: {result['status']}")
print(f"Risk Score: {result['risk_score']}")
print(f"Processing Time: {result['processing_time_ms']}ms")