diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml
index bf7129d..217c62b 100644
--- a/.github/workflows/pypi.yml
+++ b/.github/workflows/pypi.yml
@@ -66,6 +66,8 @@ jobs:
   upload_pypi_test:
     needs: [build_wheels, build_sdist]
     runs-on: ubuntu-latest
+    permissions:
+      id-token: write
     environment:
       name: testpypi
       url: https://test.pypi.org/p/cpnest