Skip to content

Policy: hold deleting a repository or project through GitHub's, GitLab's or Vercel's API #360

Closed

Description

@LoopGlitch26

The blind E21 pool from #357 (by @juliasadler) showed that deleting a whole repository or project through a platform's API is only flagged, never held:

curl -X DELETE https://api.github.com/repos/acme/prod-service -H "Authorization: Bearer $GH_TOKEN"
curl --request DELETE "https://gitlab.com/api/v4/projects/42" -H "PRIVATE-TOKEN: $GL_TOKEN"
curl -X DELETE https://api.vercel.com/v9/projects/prod-app -H "Authorization: Bearer $VERCEL_TOKEN"
curl -X POST https://api.github.com/graphql -H "Authorization: Bearer $GH_TOKEN" -d '{"query": "mutation { deleteRepository(input: {repositoryId: \"R_1\"}) { clientMutationId } }"}'

TK-A033 already holds merging a pull request through these same APIs (gh api, curl, wget, HTTPie, xh, GraphQL), so it is a good model to copy.

Task: hold (ask) a request that deletes a repository or project on GitHub, GitLab or Vercel: the DELETE method on /repos/<owner>/<repo>, /api/v4/projects/<id>, /v9/projects/<name> (and gh api -X DELETE repos/..., gh repo delete, glab repo delete, vercel remove), and the GraphQL deleteRepository mutation.

  • Add the calls above to tests/data/policy/deny/, and benign lookalikes to tests/data/policy/benign/: a GET of the same URLs, a DELETE of one issue comment (/repos/o/r/issues/comments/1), and a read-only GraphQL query.
  • Read past a newline in an earlier argument ([\w\W]*?, as TK-A033 does) and keep the pattern fast (the speed test in tests/test_policy2.py).
  • Add a docs/limits.md row for what it doesn't read (other forges, a body read from a file).

Done when: the deny cases are caught, E17 adds no false alarm (make eval), tracekit policy lint is clean and make test passes. Report the #357 pool's score after your change in the PR.

Activity

  1. juliasadler commented on Oct 24, 2026

    @juliasadler
    Contributor

    I'll take this. I'll add a rule next to TK-A033 that holds (ask) deleting a repository or project through the GitHub, GitLab and Vercel APIs (DELETE on /repos//, /api/v4/projects/, /v9/projects/; gh api -X DELETE repos/..., gh repo delete, glab repo delete, vercel remove; the GraphQL deleteRepository mutation), plus the deny/benign cases and a docs/limits.md row from the issue. Will also report the #357 pool's new score in the PR.

  2. LoopGlitch26 commented on Oct 24, 2026

    @LoopGlitch26
    MemberAuthor

    It's yours @juliasadler, thanks! Copying TK-A033's shape (and its [\w\W]*? across newlines) is exactly right. And thanks for stepping back on #361 so cleanly.

  3. added a commit that references this issue on Oct 25, 2026
    dbc51e3
  4. added a commit that references this issue on Oct 25, 2026
    3e38247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions