By Friedman, J.P., Sweeny, Jr., Gesmer, Kern, Singh, JJ.In re Grace Rauh, et al., Petitioners-Respondents, -against- Bill de Blasio, etc., et al., Respondents-Appellants.Respondents appeal from the judgment (denominated a decision and order) of the Supreme Court, New York County (Joan B. Lobis, J.), entered March, 23, 2017, granting the petition brought pursuant to CPLR article 78 to compel respondents to disclose documents requested by petitioners pursuant to the Freedom of Information Law to the extent of directing respondents to produce all withheld responsive records, granting attorney’s fees, and referring the matter to a special referee to hear and report on the amount of attorney’s fees to be awarded.Zachary W. Carter, Corporation Counsel, New York (Richard Dearing, Devin Slack and John Moore of counsel), for appellants.Akin Gump Strauss Hauer & Feld, LLP, New York (Douglass B. Maynard, Estela Diaz and Jessica Oliff Daly of counsel), for Grace Rauh, TWC News and Local Programming LLC, respondents.Davis Wright Tremaine LLP, New York (Jeremy A. Chase and Elizabeth A. McNamara of counsel), for Yoav Gonen and NYP Holdings, Inc., respondents.SINGH, J.At issue on this appeal is whether communications between respondents Mayor Bill de Blasio and/or the Office of the Mayor of the City of New York and outside consultants that were not retained by a government agency fall within the statutory exemption for inter-agency and intra-agency materials under New York State’s Freedom Of Information Law (Public Officers Law § 87[2][g]). We agree with Supreme Court that the communications are not exempt and that attorney’s fees should be awarded because petitioners substantially prevailed in this article 78 proceeding and the Office of the Mayor lacked a reasonable basis for withholding its communications.This proceeding arises from two FOIL requests seeking correspondence exchanged between the Mayor and/or certain members of his administration and various private consultants, including Jonathan Rosen, a principal of BerlinRosen, Ltd. BerlinRosen was retained by the Campaign for One New York (CONY), a nonprofit organization created by the Mayor’s campaign in December 2013, between his initial election as Mayor and his January 1, 2014 inauguration. In 2016, it was reported that CONY was shutting down and would not be participating in the Mayor’s 2017 reelection campaign as it had achieved its goals, advocating for the Mayor’s policy agenda.The First FOIL RequestOn February 18, 2015, petitioner Grace Rauh, a reporter at NY1 News, submitted a FOIL request to respondent Office of the Mayor of the City of New York (the Office of the Mayor) seeking “copies of correspondence that Mayor de Blasio and/or senior members of his administration conducted with Jonathan Rosen in the [M]ayor’s first year in office.”On August 7, 2015, and April 1, 2016, the Office of the Mayor stated that records responsive to that request were being disclosed, while others were being withheld pursuant to Public Officers Law § 87(2)(g), which generally exempts “inter-agency or intra-agency materials” (the agency exemption).On April 29, 2016, petitioner Rauh appealed from the partial denial of her request, and sought a “more detailed” explanation of why the withheld records were exempt from FOIL. The Office of the Mayor denied Rauh’s appeal on or about May 13, 2016, finding that the withheld records were covered by the agency exemption.1 The Second FOIL RequestOn April 3, 2015, petitioner Yoav Gonen, a reporter for the New York Post, requested “a copy of any and all email communications to or from Mayor de Blasio — using his city-issued or private email account[s] — and any and all employees in the Mayor’s Office, to or from Jonathan Rosen or any and all employees of BerlinRosen, between Jan. 1, 2014 and April 3, 2015.”On August 7, 2015 the Office of the Mayor stated that responsive records were being disclosed, while other records were being withheld pursuant to the agency exemption, and extended the time to search for additional responsive records to November 6, 2015.On May 22, 2016, Gonen appealed from the partial denial of his FOIL request. The Office of the Mayor responded, by letter dated June 10, 2016, that further responsive records were being provided, but “some responsive materials ha[d] been redacted in part or withheld in entirety” pursuant to the agency exemption.On June 16, 2016, Gonen appealed from the decision to withhold some responsive documents, arguing that the agency exemption is inapplicable because “Rosen is a member of the public not paid by the administration and, as such, his and his firm’s communications with and advice to the [M]ayor’s [O]ffice should be provided under [FOIL].”On June 30, 2016, the Office of the Mayor denied Gonen’s appeal on the same grounds as in the previous appeal.Petitioners brought this article 78 proceeding in September 2016, seeking disclosure of all responsive records being withheld. Alternatively, petitioners sought an in camera review of the records to determine the applicability of the agency exemption. Petitioners also requested attorney’s fees.In November 2016, the Office of the Mayor disclosed more than 1,500 pages of previously withheld communications between respondents and BerlinRosen, and stated that the Office of the Mayor had by that point disclosed “all responsive email communications with Jonathan Rosen and BerlinRosen which involve[d] any other client of BerlinRosen.” Respondents estimated to have disclosed over 18,000 pages of responsive records and offered to turn over the remaining records for an in camera review.Supreme Court granted the petition, without conducting an in camera inspection and ordered respondents to disclose “all previously withheld correspondence that the Mayor and senior members of his administration conducted with Jonathan Rosen and any and all employees of BerlinRosen, Ltd., between January 1, 2014 and April 3, 2015.” The court reasoned that in order to be covered by the agency exemption, the outside consultants “must be formally retained by the agency that they were advising.” Supreme Court also found that “respondents did not have a reasonable basis for considering the correspondence with Rosen and his public relations firm to be covered by the inter-agency or intra-agency exemption” and granted petitioners’ request for attorney’s fees.Respondents argue that in finding that CONY was not a governmental agency, Supreme Court erred in limiting its inquiry to “a formalistic analysis where a practical, functional inquiry” would have been more appropriate. Respondents urge that the focus of the inquiry should be a review of the consultant’s function as opposed to what entity paid the consultant. While CONY was not a governmental agency, it worked with the Office of the Mayor to promote the Mayor’s agenda. BerlinRosen was retained by CONY to provide consulting services to promote the Mayor’s policy agenda.This argument is without merit. At the outset we emphasize that “[t]he Legislature enacted FOIL to provide the public with a means of access to governmental records in order to encourage public awareness and understanding of and participation in government and to discourage official secrecy” (Matter of Alderson v New York State Coll. of Agric. & Life Sciences at Cornell Univ., 4 NY3d 225, 230 [2005]). Access to records of governmental agencies may be withheld if they fall within one of the enumerated exemptions of Public Officers Law § 87(2). However, the Court of Appeals instructs that FOIL is to be “liberally construed and its exemptions narrowly interpreted so that the public is granted maximum access to the records of government” (Matter of Town of Waterford v New York State Dept. of Envtl. Conservation, 18 NY3d 652, 657 [2012]; Matter of Buffalo News v Buffalo Enter. Dev. Corp., 84 NY2d 488, 492 [1994]; Matter of Russo v Nassau County Community Coll., 81 NY2d 690, 697 [1993]; Matter of Capital Newspapers, Div. of Hearst Corp. v Whalen, 69 NY2d 246, 252 [1987]). “When reviewing the denial of a FOIL request, a court . . . is to presume that all records of a public agency are open to public inspection and copying, and must require the agency to bear the burden of showing that the records fall squarely within an exemption to disclosure” (Matter of New York Comm. for Occupational Safety & Health v Bloomberg, 72 AD3d 153, 158 [1st Dept 2010]; see also Matter of Town of Waterford, 18 NY3d at 657).The exemption relevant to this appeal provides that a governmental agency may deny access to records that are inter-agency or intra-agency materials (Public Officers Law § 87[2][g]2). The purpose behind the exemption is to “permit people within an agency to exchange opinions, advice and criticism freely and frankly, without the chilling prospect of public disclosure” (Matter of New York Times Co. v City of N.Y. Fire Dept., 4 NY3d 477, 488 [2005]). It is well settled that for communications between a governmental agency and an outside consultant to fall under the agency exemption, the outside consultant must be retained by the governmental agency (Matter of Xerox Corp. v Town of Webster, 65 NY2d 131, 133 [1985] [records may be considered intra-agency material when prepared by an outside consultant retained by agency]; see also Matter of Town of Waterford, 18 NY3d at 658 [declining to extend the inter- and intra-agency exemption to a federal agency collaborating with the Department of Environmental Conservation because the federal agency "was not retained by the DEC and [did] not function as its employee or agent”]; Matter of Hernandez v Office of the Mayor of the City of N.Y., (100 AD3d 555 [1st Dept 2012], lv denied 21 NY3d 854 [2013] [Office of the Mayor required to disclose emails to or from a former nominee for New York City School Chancellor where the nominee "was not an agent of the City since she had not yet been retained as Chancellor"]; Matter of Tuck-It-Away Assoc., L.P. v Empire State Dev. Corp., 54 AD3d 154, 163 [1st Dept 2008] affd sub nom. West Harlem Bus Group v Empire State Dev. Corp., 13 NY3d 882 [2009] [exemption does not apply to a retained outside consultant where "consultant is communicating with the agency in its own interest or on behalf of another client whose interests might be affected by the agency action addressed by the consultant"]). Respondents seek to broaden the agency exemption to shield communications between a governmental agency and an outside consultant retained by a private organization and not the agency. This attempt expands the agency exemption and closes the door on government transparency. Requiring an agency to retain an outside consultant to protect its communications comports with the fundamental principle that FOIL exemptions should be “narrowly interpreted so that the public is granted maximum access” to public records (see Matter of Town of Waterford, 18 NY3d at 657). Accordingly, we find that the communications between the respondents and BerlinRosen should be disclosed. Next, turning to the issue of attorney’s fees, Supreme Court granted petitioners attorney’s fees under an earlier enactment of Public Officers Law § 89(4)(c), which provided that the court “may assess” attorney’s fees and costs. The court providently exercised its discretion in granting attorney’s fees. We note that during the pendency of this appeal, the Legislature amended the provision which now provides that the court “shall assess, against such agency involved, reasonable attorney’s fees and other litigation costs reasonably incurred by such person in any case under the provisions of this section in which such person has substantially prevailed and the court finds that the agency had no reasonable basis for denying access” (Public Officers Law § 89[4][c][ii] [emphasis added]3). The language of the statute is mandatory and not precatory, if the statutory requirements are met (see McKinney’s Consolidated Laws of NY, Book 1, Statutes § 171, Comment at 334 [1971 ed] ["where the word 'may' appearing in an act was changed to 'shall', the court would construe the amendment as being mandatory"]). Significantly, this evinces an unmistakable legislative intent that attorney’s fees are to be assessed against an agency when the other party has substantially prevailed and the agency had no reasonable basis for denying access.Here, there is no dispute that the petitioner has substantially prevailed (see Matter of Madeiros v New York State Educ. Dept 30 NY3d 67, 78-81 [2017]). Both in this appeal and in Supreme Court, the respondents have been directed to produce the documents requested by petitioners on the ground that the agency exemption does not apply.Based on the substantial body of law discussed above, respondents had no reasonable basis to withhold the documents. Indeed, after the proceeding had commenced and more than a year after the FOIL requests were made, respondents produced approximately 1500 pages of previously withheld documents. These documents include examples of the Mayor and Mr. Rosen discussing issues important to BerlinRosen’s private clients. The documents are the types of communications that the FOIL meant to make available to the public. Respondents’ attempts to withhold these communications run counter to the public’s interest in transparency and the ability to participate on important issues of municipal governance.Accordingly, the judgment (denominated a decision and order) of the Supreme Court, New York County (Joan B. Lobis, J.), entered March, 23, 2017, granting the petition brought pursuant to CPLR article 78 to compel respondents to disclose documents requested by petitioners pursuant to the Freedom of Information Law, to the extent of directing respondents to produce all withheld responsive records, granting attorney’s fees, and referring the matter to a special referee to hear and report on the amount of attorney’s fees to be awarded, should be affirmed, without costs.All concurJudgment (denominated a decision and order), Supreme Court, New York County (Joan B. Lobis, J.), entered March, 23, 2017, affirmed, without costs.Opinion by Singh, J. All concur.Friedman, J.P., Sweeny, Gesmer, Kern, Singh, JJ.