Skip to main content

Actions API

Submit agent actions for governance evaluation through the complete 7-step pipeline including risk assessment, CVSS scoring, policy evaluation, and approval workflows.

Base URL: https://pilot.owkai.app/api/v1/actions

Source: routes/actions_v1_routes.py

Compliance: SOC 2 Type II, HIPAA, PCI-DSS, GDPR, SOX

Authentication

All endpoints support dual authentication:

  • API Key: X-API-Key: owkai_admin_... (SDK integration)
  • JWT Token: Authorization: Bearer <token> (Admin UI)

Endpoints

POST /submit

Submit an agent action for governance evaluation through the complete pipeline.

Governance Pipeline:

  1. Risk Assessment (NIST/MITRE enrichment)
  2. CVSS Calculation (quantitative scoring)
  3. Policy Evaluation (governance policies)
  4. Smart Rules Check (custom rules)
  5. Alert Generation (high-risk actions)
  6. Workflow Routing (approval workflows)
  7. Audit Logging (immutable trail)

Request:

curl -X POST "https://pilot.owkai.app/api/v1/actions/submit" \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "customer-service-agent",
"action_type": "email_send",
"description": "Send welcome email to new customer",
"tool_name": "email_service"
}'

Request Body:

FieldTypeRequiredDescription
agent_idstringYesUnique agent identifier
action_typestringYesType of action being performed
descriptionstringYesHuman-readable action description
tool_namestringYesTool/service being used
target_systemstringNoTarget system affected
nist_controlstringNoOverride NIST control mapping
mitre_tacticstringNoOverride MITRE tactic mapping

Response:

{
"id": 1547,
"action_id": 1547,
"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": 0,
"matched_smart_rules": 0,
"correlation_id": "action_20250115_103045_a1b2c3d4",
"processing_time_ms": 145,
"action_type": "email_send",
"nist_control": "AC-3",
"nist_description": "Access Enforcement",
"mitre_tactic": "TA0002",
"mitre_technique": "T1566",
"thresholds": {
"auto_approve_below": 30,
"max_risk_threshold": 80,
"agent_type": "supervised",
"is_registered": true
},
"message": "Action processed through complete governance pipeline - Status: approved"
}

Response Fields:

FieldTypeDescription
idintegerAction ID
statusstringapproved, pending_approval, or denied
risk_scorefloatRisk score (0-100)
risk_levelstringlow, medium, high, critical
cvss_scorefloatCVSS base score (0-10)
cvss_severitystringCVSS severity rating
requires_approvalbooleanWhether human approval is needed
alert_triggeredbooleanWhether an alert was created
correlation_idstringRequest tracing ID
processing_time_msintegerPipeline processing time

Status Determination Logic (SEC-106):

ConditionResult
Policy deniesdenied
Risk < auto_approve_belowapproved (auto)
Risk >= max_risk_thresholdpending_approval
Policy or smart rules require approvalpending_approval
Otherwiseapproved

Unregistered Agent Handling

When an agent submits an action but is not registered in the Agent Registry, ASCEND accepts the action with stricter default thresholds.

Source: /ow-ai-backend/routes/actions_v1_routes.py:414-419

ThresholdRegistered Agent (Typical)Unregistered Agent
Auto-approve below5030 (stricter)
Max risk threshold8070 (stricter)
Agent typesupervised/autonomousunregistered

Why stricter defaults? Unregistered agents have not been explicitly approved by an administrator. Stricter thresholds ensure more human oversight until the agent is formally registered.

Response includes registration status:

{
"id": 12345,
"status": "pending_approval",
"risk_score": 45,
"thresholds": {
"auto_approve_below": 30,
"max_risk_threshold": 70,
"agent_type": "unregistered",
"is_registered": false
}
}

Compliance: SOC 2 CC6.1 (Logical Access Controls)


GET /

List agent actions for the organization.

Request:

curl "https://pilot.owkai.app/api/v1/actions?limit=20&offset=0&status_filter=pending_approval" \
-H "X-API-Key: your_api_key"

Query Parameters:

ParameterTypeDefaultDescription
limitinteger100Max items (max: 1000)
offsetinteger0Skip count
status_filterstringnullFilter by status

Response:

[
{
"id": 1547,
"agent_id": "customer-service-agent",
"action_type": "email_send",
"description": "Send welcome email",
"status": "approved",
"risk_score": 35.0,
"risk_level": "low",
"cvss_score": 3.5,
"cvss_severity": "low",
"timestamp": "2025-01-15T10:30:45Z",
"tool_name": "email_service",
"target_system": "smtp.company.com"
}
]

GET /{action_id}

Get detailed information for a specific action.

Request:

curl "https://pilot.owkai.app/api/v1/actions/1547" \
-H "X-API-Key: your_api_key"

Response:

{
"id": 1547,
"agent_id": "customer-service-agent",
"action_type": "email_send",
"description": "Send welcome email",
"tool_name": "email_service",
"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",
"nist_control": "AC-3",
"nist_description": "Access Enforcement",
"mitre_tactic": "TA0002",
"mitre_technique": "T1566",
"recommendation": "Ensure proper authorization before sending",
"target_system": "smtp.company.com",
"timestamp": "2025-01-15T10:30:45Z",
"user_id": 15,
"organization_id": 4,
"alert": null
}

GET /{action_id}/status

Poll for action decision status (optimized for SDK polling).

Request:

curl "https://pilot.owkai.app/api/v1/actions/1547/status" \
-H "X-API-Key: your_api_key"

Response:

{
"action_id": 1547,
"status": "approved",
"risk_score": 35.0,
"timestamp": "2025-01-15T10:30:45Z",
"decision_ready": true
}

Response Fields:

FieldTypeDescription
action_idintegerAction ID
statusstringCurrent status
risk_scorefloatRisk score
decision_readybooleantrue if approved or denied

SDK Polling Pattern:

import time

def wait_for_decision(action_id, max_wait=300):
start = time.time()
while time.time() - start < max_wait:
response = api.get_action_status(action_id)
if response["decision_ready"]:
return response["status"]
time.sleep(5) # Poll every 5 seconds
return "timeout"

POST /{action_id}/approve

Approve a pending action (admin only, JWT required).

Request:

curl -X POST "https://pilot.owkai.app/api/v1/actions/1547/approve" \
-H "Cookie: access_token=your_session_cookie" \
-H "X-CSRF-Token: your_csrf_token"

Response:

{
"action_id": 1547,
"status": "approved",
"approved_by": 15,
"approved_at": "2025-01-15T11:00:00Z",
"correlation_id": "action_20250115_110000_e5f6g7h8"
}

Requirements:

  • JWT authentication (no API keys)
  • Action must be in pending_approval status
  • User must have approval permissions

POST /{action_id}/reject

Reject a pending action (admin only, JWT required).

Request:

curl -X POST "https://pilot.owkai.app/api/v1/actions/1547/reject" \
-H "Cookie: access_token=your_session_cookie" \
-H "X-CSRF-Token: your_csrf_token" \
-H "Content-Type: application/json" \
-d '{"reason": "Exceeds authorized scope"}'

Request Body (optional):

FieldTypeRequiredDescription
reasonstringNoRejection reason

Response:

{
"action_id": 1547,
"status": "denied",
"rejected_by": 15,
"rejected_at": "2025-01-15T11:05:00Z",
"reason": "Exceeds authorized scope",
"correlation_id": "action_20250115_110500_i9j0k1l2"
}

Error Responses

CodeDescription
400Bad Request - Invalid status transition
401Unauthorized - Missing/invalid authentication
404Not Found - Action does not exist
422Validation Error - Missing required fields
500Internal Server Error

Example Error:

{
"detail": "Missing required fields: agent_id, action_type"
}

Risk Thresholds

Actions are evaluated against configurable thresholds:

ThresholdDefaultDescription
auto_approve_below30Auto-approve below this score
max_risk_threshold80Require approval above this score
requires_mfa_above70Require MFA above this score

Autonomous agents have stricter defaults:

SettingSupervisedAutonomous
Auto-approve<30<20
Max risk8060

CVSS Scoring

Actions receive CVSS 3.1 base scores:

SeverityScore Range
None0.0
Low0.1 - 3.9
Medium4.0 - 6.9
High7.0 - 8.9
Critical9.0 - 10.0

NIST/MITRE Enrichment

Actions are automatically mapped to:

FrameworkExample
NIST ControlsAC-3 (Access Enforcement)
MITRE TacticsTA0002 (Execution)
MITRE TechniquesT1566 (Phishing)

Source: actions_v1_routes.py