Skip to content

Gate API

POST /gate/check

Execute a gate check before AI action.

Request

bash
curl -X POST https://sovrapp.com/api/sovr/gate/check \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_..." \
  -H "x-tenant-id: tenant_123" \
  -d '{
    "tenantId": "tenant_123",
    "action": "send_email",
    "context": {
      "recipient": "client@example.com",
      "subject": "Invoice #1234"
    }
  }'

Parameters

FieldTypeRequiredDescription
tenantIdstringYesTenant identifier
actionstringYesAction type
contextobjectNoAdditional context
planobjectNoPre-computed plan

Response

json
{
  "success": true,
  "data": {
    "decision": "allow",
    "reason": "Action matches approved pattern",
    "riskScore": 15,
    "plan": {
      "action": "send_email",
      "validated": true
    }
  }
}

Decision Values

DecisionDescription
allowSafe to execute
denyBlocked
require_approvalNeeds human approval

POST /gate/risk

Risk assessment only (no decision).

Request

bash
curl -X POST https://sovrapp.com/api/sovr/gate/risk \
  -H "Content-Type: application/json" \
  -H "x-api-key: sk_..." \
  -H "x-tenant-id: tenant_123" \
  -d '{
    "action": "transfer_funds",
    "context": { "amount": 50000 }
  }'

Response

json
{
  "success": true,
  "data": {
    "score": 72,
    "factors": [
      { "name": "amount", "weight": 0.4, "contribution": 32 },
      { "name": "action_type", "weight": 0.3, "contribution": 24 }
    ]
  }
}

The AI Responsibility Layer