Compliance Engine
The Compliance Engine decides whether a proposed journey, match or booking satisfies the currently approved operating rules.
It can ALLOW, BLOCK, REVIEW, SUSPEND or ESCALATE.
What it does not do
The engine never asserts that an activity is legally compliant because an internal rule passed.
It applies the policy configuration supplied by the approved operating and regulatory framework. That framework is external and versioned; the engine is only its mechanical interpreter. If the policy is wrong, the decision is wrong in a consistent and inspectable way.
Separation from matching
Matching Engine
│
│ "These journeys are geographically compatible."
▼
Candidate Match
│
▼
Compliance Engine
│
│ "Is this permitted under the currently approved rules?"
▼
┌────┴─────┐
▼ ▼
ALLOW BLOCK / REVIEWA match can be geographically excellent and still require review or blocking. This is the most important structural decision in the platform: it lets the operating model change without rebuilding the matching system, and it is the reason RTA can approve a different framework than the initial assumptions without invalidating the matching work.
Policy configuration
Rules are configuration, never code. The active policy is a versioned document.
{
"policyVersion": "PILOT-0.1",
"identity": {
"driverVerificationRequired": true,
"passengerVerificationRequired": true
},
"vehicle": {
"verificationRequired": true
},
"journey": {
"existingJourneyRequired": true
},
"relationship": {
"enabled": true,
"approvedTypes": []
},
"contribution": {
"enabled": false,
"approvedModes": []
},
"matching": {
"maxDetourMeters": null,
"maxDetourSeconds": null
}
}An empty array or a null value means the value must be supplied by an approved policy. It never means "no limit" and it never means "not applicable". A policy that leaves maxDetourMeters unset does not permit unlimited detour; it is incomplete and evaluation returns REVIEW.
Decision states
| Decision | Meaning |
|---|---|
ALLOW | Every mandatory configured requirement is satisfied. |
REVIEW | The system cannot determine automatically whether the activity should proceed. A human decides. |
BLOCK | A mandatory configured condition has failed. |
SUSPEND | An account-level control is applied, taking the subject out of service pending review. |
ESCALATE | The matter is handed to the regulatory workflow. |
REVIEW and BLOCK are different in kind: BLOCK is a known failure, REVIEW is indeterminacy. Collapsing them would hide operational problems behind a clean failure, and would stop distinguishing "we know this is not allowed" from "we cannot tell yet".
HOLD is a fifth action available to the administrative workflow — it is a temporary control applied while a review is open, not an engine output.
{ "status": "ALLOW", "reasonCodes": [] }{
"status": "REVIEW",
"reasonCodes": ["RELATIONSHIP_REQUIRES_REVIEW"]
}{
"status": "BLOCK",
"reasonCodes": ["DRIVER_NOT_VERIFIED"]
}Compliance domains
The engine evaluates fourteen domains.
| # | Domain | Rule prefix |
|---|---|---|
| 1 | Identity | IDENTITY- |
| 2 | Driver | DRIVER- |
| 3 | Vehicle | VEHICLE- |
| 4 | Journey | JOURNEY- |
| 5 | Passenger | PASSENGER- |
| 6 | Relationship / eligibility | RELATIONSHIP- |
| 7 | Route behaviour | ROUTE- |
| 8 | Frequency / activity | ACTIVITY- |
| 9 | Contribution | CONTRIBUTION- |
| 10 | Safety | SAFETY- |
| 11 | Complaints | COMPLAINT- |
| 12 | Account history | ACCOUNT- |
| 13 | Geographic restrictions | GEO- |
| 14 | Regulatory policy | POLICY- |
Identity
| Code | Condition | Default action |
|---|---|---|
IDENTITY-001 | Driver identity not verified | BLOCK |
IDENTITY-002 | Passenger identity not verified | BLOCK |
IDENTITY-003 | Identity verification expired | REVIEW or BLOCK |
The exact treatment is configurable. What is not configurable is treating an expired verification as a valid one.
Driver
| Code | Condition | Default action |
|---|---|---|
DRIVER-001 | Driver profile incomplete | BLOCK |
DRIVER-002 | Driving licence verification failed | BLOCK |
DRIVER-003 | Driver account suspended | BLOCK |
DRIVER-004 | Driver verification expired | REVIEW |
A user must never be able to bypass verification by creating a second driver profile. The uniqueness of driver_profiles.user_id is what makes this enforceable.
Vehicle
| Code | Condition | Default action |
|---|---|---|
VEHICLE-001 | Vehicle not verified | BLOCK |
VEHICLE-002 | Vehicle verification expired | REVIEW |
VEHICLE-003 | Vehicle unavailable | BLOCK |
VEHICLE-004 | Seating capacity exceeded | BLOCK |
Journey
| Code | Condition | Default action |
|---|---|---|
JOURNEY-001 | Journey is cancelled | BLOCK |
JOURNEY-002 | Journey is already completed | BLOCK |
JOURNEY-003 | Journey has no available seats | BLOCK |
JOURNEY-004 | Driver creates repeated passenger-specific journeys | REVIEW |
JOURNEY-004 is a risk signal, not a legal determination. See Risk Signals.
The existing-journey rule
The most important control in the platform is a structural one, not a rule.
The permitted flow:
Driver creates journey
↓
Journey published
↓
Passengers request compatible seatsThe prohibited flow:
Passenger requests trip
↓
System creates a driver journey
↓
Driver transports passengerThe second pattern makes the product behave like an on-demand passenger transport marketplace regardless of what the rest of the system says. It is prevented by construction — a journey always belongs to a driver and a vehicle, and a ride request can only attach to an existing journey.
Relationship rules
The system supports relationship information where the approved operating model requires it.
Application-level values: FRIEND, RELATIVE, CO_WORKER, SAME_EMPLOYER, SAME_SCHOOL, SAME_COMMUNITY, OTHER.
These are application data categories. They are not an independent legal determination and must not be presented as one. Which categories qualify is set by relationship.approvedTypes in the active policy.
Verification state of a declared relationship: UNVERIFIED, SELF_DECLARED, INVITED, VERIFIED, REJECTED, REVIEW.
A self-declared relationship is data. It does not by itself satisfy an eligibility rule, and the policy decides whether that is acceptable.
Risk levels
| Level | Typical action |
|---|---|
LOW | Allow |
MEDIUM | Monitor / review |
HIGH | Hold / manual review |
CRITICAL | Block / suspend / escalate |
These are system classifications, not legal classifications. Thresholds are configurable per policy version.
Rule evaluation result
Every rule returns the same shape, pass or fail.
{
"ruleCode": "DRIVER-001",
"policyVersion": "PILOT-0.1",
"result": "PASS",
"severity": "LOW",
"action": "ALLOW",
"evidence": { "driverVerified": true }
}{
"ruleCode": "VEHICLE-001",
"policyVersion": "PILOT-0.1",
"result": "FAIL",
"severity": "HIGH",
"action": "BLOCK",
"evidence": { "vehicleVerified": false }
}ruleCode is required, not optional. A decision that cannot name the rules that produced it cannot be explained or reviewed later.
Compliance decision object
{
"decisionId": "uuid",
"subject": {
"journeyId": "uuid",
"matchId": "uuid",
"bookingId": "uuid"
},
"policy": {
"policyId": "uuid",
"version": "PILOT-0.1"
},
"decision": "ALLOW",
"risk": { "level": "LOW" },
"rules": [
{ "code": "IDENTITY-001", "result": "PASS" },
{ "code": "VEHICLE-001", "result": "PASS" }
],
"createdAt": "2026-09-30T07:20:00Z"
}Explainability
Every decision carries reason codes:
{
"decision": "REVIEW",
"reasonCodes": ["ACTIVITY-004", "CONTRIBUTION-002"]
}An administrator must be able to see, for any decision:
- the decision
- the policy version
- the rules evaluated
- the rules passed
- the rules failed
- the evidence for each
- the timestamp
- the actor or system
- the algorithm version
- previous decisions on the same subject
Without the pass/fail split, a reviewer sees a verdict with no way to check it.
Policy versioning
Every decision references a policy version.
PILOT-0.1
PILOT-0.2
RTA-APPROVED-1.0
RTA-APPROVED-1.1This exists to answer one question: which rules were active when this journey was approved?
When the approved operating framework changes, a new ruleset is activated. Rules are versioned so no application rewrite is needed.
Audit trail
Compliance decisions are append-only. See Compliance Audit.
A decision that changes does not overwrite its predecessor:
Decision #1
│
▼
Decision #2
│
▼
Decision #3The complete history stays available.
Emergency override
Emergency handling runs on a separate pathway and must not depend on ordinary matching or compliance logic. A failing or degraded compliance dependency must never be the reason an emergency alert fails to propagate.
Normal path:
Compliance -> Booking -> JourneyEmergency path:
Emergency detected
↓
Safety workflow
├── Emergency contact notification
├── Live location sharing
├── Incident creation
├── Platform safety team
└── Regulatory escalation where applicableAdministrative workflow
SYSTEM DETECTS EVENT
↓
COMPLIANCE EVENT
↓
AUTOMATIC RULE ACTION
├── ALLOW
├── HOLD
├── BLOCK
└── ESCALATE
↓
HUMAN REVIEW
↓
RESOLUTIONFail-safe behaviour
If a mandatory compliance dependency becomes unavailable:
Verification unavailable
↓
Do NOT assume PASS
↓
PENDING / REVIEWThe system must never interpret "unable to verify" as "verified".
This is the single most consequential invariant in the engine. An outage in an identity provider must degrade to REVIEW, never to ALLOW. Failing closed on availability is the price of a decision that means anything.
Evaluation contract
evaluate(passenger, driver, vehicle, journey, request, match, policy)Returns:
- a decision —
ALLOW,REVIEWorBLOCK reasonCodesriskLevelpolicyVersionruleResultsevidence
Combined matching and compliance pipeline
PASSENGER
│
▼
Ride Request
│
▼
Candidate Discovery
│
▼
Route compatibility
│
▼
Time matching
│
▼
Seat Eligibility
│
▼
COMPLIANCE ENGINE
│
┌─────────┼─────────┐
▼ ▼ ▼
BLOCK REVIEW ALLOW
│ │
▼ ▼
Human Review Ranking
│
▼
Match Offer
│
▼
Booking
│
▼
Journey
│
▼
Compliance MonitoringCompliance runs before ranking. An ALLOW match is ranked; a REVIEW match is queued for a person; a BLOCK match is never surfaced.
Privacy
Compliance does not mean unrestricted access to personal data.
Apply data minimisation, purpose limitation, role-based access, encryption, hashing where appropriate, audit logging, retention policies, restricted location visibility and secure deletion.
Sensitive identifiers are not stored in plaintext:
plate_hash
identity_reference_hash
device_reference_hash