Risk decisioning: end-to-end implementation in Quarreh
A risk decision is more than a score. In Quarreh we are building it as a traceable workflow: request, evidence, policy, outcome and review.
Risk decisioning is often described as a model that returns a number. In a live commerce and delivery platform, the model is only one input. The harder engineering is the path around it: how a decision is requested, what evidence it can see, which policy is in force, what happens when the answer is “review”, and how the decision can be explained afterwards.
What the decision has to answer
For Quarreh, a risk decision answers a narrow operational question: should this order or payment proceed, should it wait for a person, or should it be stopped? The answer needs to be consistent, timely and attributable to a policy version that was in force at the time.
That framing matters. A decision engine that returns a score without recording the request, the evidence and the policy is difficult to operate and almost impossible to audit. We treat the decision as a record, not just a response.
Where decisioning sits
Decisioning is a boundary, not a step buried inside the order service. Order and payment flows call a decision service with a stable request shape. The service evaluates policy, records the outcome and returns an action. It does not create the order, assign a courier or move money.
type DecisionRequest = {
idempotencyKey: string;
subject: {type: "order" | "payment"; id: string};
context: {
amountMinor: number;
currency: "GMD";
channel: "app" | "counter";
merchantId: string;
};
signals: Record<string, unknown>;
};
type Decision = {
outcome: "allow" | "review" | "decline";
reasons: Array<{code: string; message: string}>;
policyVersion: string;
};Evidence before evaluation
A decision without its evidence is not reproducible. The request carries signals already known to the platform, and the decision service snapshots the exact values used, including their source and the time they were read.
Signals include order value, channel, delivery destination, merchant history and account age. We treat them as facts with provenance, not as a single blended score that cannot be inspected later.
Signals are data, not destiny
A signal can be missing, delayed or wrong. The service records whether a signal was present, inferred or unavailable so that the eventual outcome can be read in context rather than as an unexplained verdict.
Rules first, models where they earn their place
Deterministic rules are the backbone: amount thresholds, blocked destinations, velocity limits and review triggers. A model can add a signal, but it does not silently become the policy. Each model output is named, versioned and reported alongside the rule outcome.
This keeps the first version operable: when a decision is challenged, the team can point to the rule or signal that drove it. Models are introduced only where they improve a decision we can already evaluate.

