Skip to main content

Quick Start

Get your first AI agent action governed by ASCEND in under 10 minutes.

Prerequisites

  • Python 3.8+
  • An ASCEND API key (from your dashboard at pilot.owkai.app)
  • An agent registered and activated in the Agent Registry (Register Your Agent)

Install the SDK

pip install ascend-ai-sdk==2.6.1

Register Your Agent

Before initializing, register your agent in the Agent Registry. See Register Your Agent for the full walkthrough.

If you are using the SDK:

# Register once (idempotent — safe on every startup)
result = client.register()

Note: client.register() uses the agent_id and agent_name from the AscendClient constructor.

Initialize the Client

from ascend import AscendClient, FailMode

client = AscendClient(
api_key="owkai_your_key_here",
api_url="https://pilot.owkai.app",
agent_id="my-agent",
agent_name="My Agent",
fail_mode=FailMode.CLOSED, # Block if ASCEND unreachable (recommended)
)

fail_mode=FailMode.CLOSED means if ASCEND is unreachable, actions are blocked by default. Use FailMode.OPEN only when availability takes priority over security.

Govern Your First Action

from ascend import Decision

result = client.evaluate_action(
action_type="database_write",
resource="customer_db",
wait_for_decision=False,
)

if result.decision == Decision.ALLOWED:
# Proceed with the action
print(f"Approved — risk score: {result.risk_score}")
elif result.decision == Decision.PENDING:
# Action queued for human review
print(f"Pending approval — action ID: {result.action_id}")
elif result.decision == Decision.DENIED:
# Blocked by policy
print(f"Denied — {result.reason}")

Wait for Human Approval

When an action returns Decision.PENDING, poll for the approver's decision:

final = client.wait_for_decision(
action_id=result.action_id,
timeout=300, # seconds
poll_interval=5.0, # polling frequency
)

if final.decision == Decision.ALLOWED:
print("Approved — proceeding")
else:
print(f"Not approved: {final.reason}")

Govern MCP Server Actions

Pass mcp_server_name to trigger Layer 13 MCP governance. Unregistered or deactivated servers are denied.

result = client.evaluate_action(
action_type="tool_call",
resource="crm_system",
mcp_server_name="salesforce-mcp",
wait_for_decision=False,
)
print(result.mcp_governance)

Enforce Model Registry Compliance

Pass model_id to check against your organization's model registry. Non-compliant models are denied.

result = client.evaluate_action(
action_type="model_inference",
resource="ml_pipeline",
model_id="gpt-4-production",
wait_for_decision=False,
)
print(result.model_governance["compliance_status"])

Verify Your Connection

status = client.test_connection()
print(status)

Error Handling

from ascend.exceptions import (
AuthenticationError,
ConnectionError,
RateLimitError,
ValidationError,
)

try:
result = client.evaluate_action(
action_type="database_write",
resource="customer_db",
)
except AuthenticationError:
print("Invalid API key")
except ConnectionError:
print("Could not reach ASCEND platform")
except RateLimitError:
print("Rate limit exceeded — back off")
except ValidationError as e:
print(f"Invalid request: {e}")

Next Steps