Warddocs
Introduction

Quick start

1. Get an API key

Sign up at console.mandatelabs.ai. You get a sandbox key at once (ward_test_…); a live key (ward_live_…) is issued once Mandate validates the account. Sandbox calls run the same engine and are never billed.

export WARD_API_KEY="ward_test_..."

Keys go in the X-API-Key header. Keep them server-side: never ship a key in a browser or mobile app.

2. Make a decision

Screen a name against the sanctions, PEP and enforcement lists:

curl https://api.mandatelabs.ai/api/v1/decide \
  -H "X-API-Key: $WARD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"type": "screen", "input": {"name": "Ana Maria Perez", "date_of_birth": "1990-05-01", "country": "PAN"}}'
from ward import Ward

client = Ward()  # reads WARD_API_KEY
d = client.decide("screen", {"name": "Ana Maria Perez", "date_of_birth": "1990-05-01", "country": "PAN"})
print(d.decision, d.signals)
import { Ward } from "@mandatelabs/ward";

const client = new Ward(); // reads WARD_API_KEY
const d = await client.decide("screen", { name: "Ana Maria Perez", date_of_birth: "1990-05-01", country: "PAN" });
console.log(d.decision, d.signals);

3. Act on the decision

if d.decision == "APPROVE":
    onboard()
elif d.decision == "STEP_UP":
    send_to_review(d.id, d.signals)   # a person looks; Ward never auto-declines a namesake
else:  # DECLINE
    block(d.id)

Every decision has an id. Keep it: it is how you give feedback, fetch the evidence and ask follow-up questions.

4. Tell Ward what happened

curl https://api.mandatelabs.ai/api/v1/decide/dec_01JC4Z.../feedback \
  -H "X-API-Key: $WARD_API_KEY" -H "Content-Type: application/json" \
  -d '{"correct": false, "right_decision": "APPROVE", "label": "false_positive"}'
client.feedback(d.id, correct=False, right_decision="APPROVE", label="false_positive")
await client.feedback(d.id, { correct: false, right_decision: "APPROVE", label: "false_positive" });

Feedback tunes thresholds and trains a model for your account. See Feedback and learning.

Next