Lyft Inc. has reached an agreement with San Francisco City Attorney Dennis Herrera to share information about driver practices and the services the ride-hailing company offers to disabled passengers and low-income neighborhoods.

Herrera’s office subpoenaed four years of records from Lyft and rival Uber Technologies Inc. last June, arguing the city needs the data to analyze how the companies affect traffic congestion and pedestrian safety and whether they’re complying with state and local laws. An estimated 45,000 drivers for both companies pick up passengers in San Francisco, according to the city.