diff --git a/pyproject.toml b/pyproject.toml
index 9b7cca9c9..2870b31a5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -44,6 +44,8 @@ dependencies = [
     "starlette>=0.27.0,<0.28.0",
     "pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
     "typing-extensions>=4.5.0",
+    # TODO: remove this pin after upgrading Starlette 0.31.1
+    "anyio>=3.7.1,<4.0.0",
 ]
 dynamic = ["version"]