Allowing scripts to run
Review and allow scripts that changed outside Relay before they run.
Overview
A script can read your variables, including secrets, and send requests anywhere. Scripts in a workspace can come from other people: a teammate's commit in a workspace folder you share with Git, or a collection you imported from Postman. So Relay runs a script only after you've allowed it on your Mac.
Most of the time you don't notice this. Scripts you write in Relay are allowed as you type them. You're asked only when a script's text arrives some other way.
Know which scripts need allowing
Relay allows a script without asking when you:
- Type or paste it in a Scripts tab, or insert it from the Snippets menu.
- Duplicate a request, copy a request or folder, or create a draft from a history entry. The copy runs if the original would.
Relay asks before running a script that:
- Changed in a workspace's files on disk, such as after a Git pull, switching branches or editing the file in another app.
- Came with a workspace folder you opened, or with a Postman collection you imported.
- An AI agent wrote through Relay's MCP server.
Allow a script
- Select the request, or Control-click its collection or folder in the sidebar and choose Edit Scripts….
- Click Scripts. Above the script, a banner says "This script changed outside Relay."
- Read the script, then click Allow.
Allow applies to the phase you're viewing. If both of a request's scripts changed, choose the other phase in the phase menu and allow it too.
Important
relay.sendRequest with a URL you don't recognize, can expose tokens and passwords.See which scripts were skipped
When you send a request and one of the scripts that would run for it hasn't been allowed, Relay skips that script and runs the others. The response inspector's Tests tab names each skipped script and its phase, and says that it changed outside Relay. Scripts that are turned off with the Enabled switch are skipped without a note.
Understand how approvals are kept
Approvals are stored on your Mac, not in the workspace's files, so allowing a script doesn't allow it for anyone else, and a teammate can't allow a script for you. Relay records each approval for a request, folder or collection and a phase, together with the exact text of the script. Any change to the text made outside Relay needs allowing again.
Relay remembers several recent versions of each script you've allowed. When you switch between Git branches that have different versions of a script, Relay doesn't ask again for a version you've already allowed. When you delete a request, folder or collection, Relay forgets its approvals the next time it launches.
The Enabled switch is different: it's saved in the workspace's files and shared with everyone who uses them. A script runs only when it's both turned on and allowed.
See Also
- Running scripts before and after requests: Add pre-request and post-response scripts to requests, folders and collections.
- Storing a workspace in a folder: Keep a workspace as files in a folder you choose and share it with Git.
- Importing Postman collections and environments: Bring Postman collections, with their folders, auth and scripts, and Postman environments into Relay.
- Working with Relay from an agent: Learn what an agent can do in Relay and how its changes reach your workspaces.