Sentry org access script tool
It’s built for an access rule. Once someone’s request for Sentry is approved, Risotto runs it to invite them to your Sentry organization with the role and team the rule sets, and Sentry emails them the invite. When their access ends, Risotto runs it again and it takes them out.
Frequently asked questions
How does an access rule run the Sentry org access script tool?
Bind it to the rule, such as a Sentry Developer rule, and pin the organization, role and team there: example-co, member and checkout, say. Once the request is approved, Risotto runs the script to grant, after any IdP group or license on the same rule. When the access ends, because a time-bound grant runs out, the agent revokes it or an admin presses “Expire access now”, Risotto runs the same script to remove. Pins are fixed per rule, so another role or team is another rule. The rule’s approval applies, not the tool’s own approval setting. How access requests work
What does the Sentry org access script tool need?
A token from an internal integration in Sentry whose Member permission is Admin, saved as SENTRY_AUTH_TOKEN, a write-only secret. Looking people up needs member:read, inviting needs member:write and removing needs member:admin. An integration’s token can only invite people as members. The tool can reach only sentry.io: change that to your organization’s region domain or your own Sentry server before you publish.
What if there’s nothing to remove, or a removal fails?
A revoke can run the removal for access Risotto never granted, so the script succeeds when the person isn’t in your Sentry organization. It also leaves alone anyone whose Sentry role isn’t the one the rule gives, so an owner who asked for member access stays an owner. If Sentry refuses a removal, Risotto keeps the grant open, marks it and tells your admins once. Fix the token or the pins, then retry with “Expire access now”. Risotto doesn’t retry on its own.
Is the Sentry org access script tool one of Risotto’s templates?
No. We wrote it for this library from what script tools can do today. Ask Risotto’s Assistant for one like it for another app with an API: it starts from a draft with both a grant and a remove branch, and tries the app’s API with a credential from your vault before it writes the code. How script tools work