RideKit
Docs/Reference/Risk areas: warning drivers, and passes that do not count

Risk areas: warning drivers, and passes that do not count

Built: 2026-11-03. Written for operators (Brazil first, any market) and whoever maintains the code.

In Brazilian cities some neighbourhoods are dangerous to drive into, at least at night. 99 and Uber warn drivers before they accept a trip there and let them pass without it counting against them. RideKit does the same.

What the driver sees

On the ride offer, before accepting:

⚠️ Pickup in a risk area: Paulista Pick up at the corner, not mid-block Your call: passing on this trip does not count against you.

  • The banner is red for high risk and amber for caution.
  • It covers the pickup, the drop-off, or both, and shows the operator's note if there is one.
  • Nothing is refused: the driver decides.
  • Declining, or letting the offer run out, is recorded as a risk-area pass. Such passes are left out of the acceptance rate that driver tiers use.

Drawing risk areas

Admin → Zones → Draw new zone → type Risk area:

Field Meaning
Level Caution or High risk
Note for drivers Optional, up to 200 characters (e.g. "Avoid stopping on the main road")
All day / From–Until When it applies, in market time. A range across midnight (22:00–05:00) works.
Source Where the polygon came from, for your records

The zone list shows each risk area's level and hours.

Importing from the state's crime data

Admin → Zones → Import risk areas: choose a GeoJSON file of polygons, such as São Paulo's SSP or Rio's ISP data, or any map exported from a GIS tool. Set the level, hours and source.

  • Every Polygon becomes one risk area, and every part of a MultiPolygon becomes one too.
  • Names are taken from the feature's properties (name, nome, bairro, NM_BAIRRO, distrito, NM_DISTRIT), or numbered if there are none.
  • Features that are not polygons are skipped and counted.
  • At most 500 polygons can be imported at a time.

Which neighbourhoods to mark, and when, is the operator's decision. Base it on current data and review it regularly.

For the code

What Where
Rules (level, note, hours, source; in force; worst wins) backend/src/geo/risk-rules.ts
Lookup at a ride's ends, import geo/geo.service.ts rideRisk, importRiskAreas (POST /geo/zones/import-risk)
On the offer rides/dispatch-offer.service.ts payload risk
Penalty-free passes dispatch.service.ts reject and the offer timeout mark riskArea: true; drivers/driver-tiers.service.ts leaves them out
Zone type migration 170 (zone_type gains risk)
Driver app src/components/OfferSheet.tsx (offer-risk)
Admin zones/RiskFields.tsx, RiskImportModal.tsx, risk-form.ts

Check before launch. Telling drivers that an area is dangerous is a sensitive statement about a neighbourhood. Base it on official data, word the notes neutrally, and confirm your approach with counsel in Brazil.

source: docs/risk-areas.md (ships identically in the product zip)