The stud space would be considered a concealed space.
However, you need to follow the chain of cross references:
Section 717.5: “Combustible materials shall not be permitted in concealed spaces of buildings of Type I or II construction.” Exception 1: "Combustible materials in accordance with Section 603.
Section 603: “Combustible materials shall be permitted in buildings of Type I or II construction in the following applications and in accordance with Sections 603.1.1 through 603.1.3:
…
3. Foam plastics in accordance with Chapter 26.”
Chapter 26:
Section 2603.5: Exterior walls of buildings of Type I, II, III or IV construction of any height shall comply with Sections 2603.5.1 through 2603.5.7."
2603.5.1: Not applicable.
2603.5.2: “Any foam plastic insulation shall be separated from the building interior by a thermal barrier meeting the provisions of Section 2603.4…”
- Section 2603.4: "…foam plastic shall be separated from the interior of a building by an approved thermal barrier of 0.5-inch (12.7 mm) gypsum wallboard or equivalent…"2603.5.3: “The potential heat of foam plastic insulation in any portion of the wall or panel shall not exceed the potential heat expressed in Btu per square feet (mJ/m2) of the foam plastic contained in the wall assembly tested in accordance with Section 2603.5.5. The potential heat of the foam plastic insulation shall be determined by tests conducted in accordance with NFPA 259…”
Section 2603.5.4: “Foam plastic insulation, exterior coatings and facings shall be tested separately in the thickness intended for use, but not to exceed 4 inches (102 mm), and shall each have a flame spread index of 25 or less and a smoke-developed index of 450 or less as determined in accordance with ASTM E 84.”
Section 2603.5.5 (This is the kicker): “The wall assembly shall be tested in accordance with and comply with the acceptance criteria of NFPA 285.”
Section 2603.5.6: This requires a label on the insulation, which is impossible for sprayed-foam insulation. I don’t know how, other than a code modification, to comply with this requirement.
Section 2603.5.7: “Exterior walls shall not exhibit sustained flaming where tested in accordance with NFPA 268.” However, if one of the five materials listed in the exception are used on the outside, then this requirement is not applicable.
It is possible to do what you want to do, but you’ll need the test data to back it up. If Section 2603.9 is applicable, then all of the other requirements I quoted from Chapter 26 are not applicable.