We study the boundary of the cone of real polynomials that can be decomposed as a sum of squares (SOS) of real polynomials. This cone is included in the cone of nonnegative polynomials and both cones share a part of their boundary, which corresponds to polynomials that vanish at at least one point. We focus on the part of the boundary which is not shared, corresponding to strictly positive polynomials.
For the cases of polynomials of degree 6 in 3 variables and degree 4 in 4 variables, this boundary has been completely characterized by G. Blekherman. For the cases of a polynomial f in more variables or of higher degree, results by G. Blekherman, R. Sinn and M. Velasco and other authors based on a conjecture by Ottaviani and Paoletti give bounds for the maximum number of linearly independent polynomials that can appear in an SOS decomposition of f, or equivalently the maximum rank of the matrices in the Gram spectrahedron of f. We show that the same bounds can be obtained from the Eisenbud-Green-Harris conjecture. Combining theoretical results and computational techniques, we compute examples that allow us to prove the optimality of the bounds for all degrees and number of variables. Additionally, we give examples for the following problems: examples in the boundary of the cone that are the sum of less than n squares and have common complex roots, and examples of polynomials in the boundary with SOS length larger than the expected one from the dimension.