What is osascript on Mac?

What osascript does, why you might see "osascript wants to make changes", how malware uses it for fake password windows, and how to check the copy on your Mac is Apple's. Checked on macOS 26.

  • Be careful
  • By Aegisrook team
  • Updated
  • Checked on macOS 26.0.1

Be carefulOften used by malware. Allow it only if you know why it's running. The rating describes the real osascript, not every copy with that name.

What it is
Runs AppleScript and JavaScript automation scripts, which control Mac apps.
Made by
Apple
Where the real one lives
/usr/bin/osascript
If you block its internet access
Automation scripts can't reach the internet.
What to do
Rarely needs the internet. Mac malware uses osascript to show fake password windows, so don't enter your password in a window you didn't expect.

osascript is the Mac command-line tool that runs AppleScript and JavaScript automation scripts. Apps, installers and your own Terminal commands use it to control other apps, show a dialog or run a shell command.

It’s part of macOS and the tool itself is safe. What matters is the script it’s running, because Mac malware uses osascript too, mostly to show fake password windows.

Is osascript safe?

The program is. The real osascript is in /usr/bin on the read-only system volume and is signed by Apple. It isn’t a background service: it starts when something runs a script and quits when the script ends. On most Macs, you won’t see it in Activity Monitor at all.

The script is another matter. osascript does whatever the script asks, with your permissions, so it’s only as safe as the app or command that started it.

Why you see “osascript wants to make changes”

That window appears when a script asks to run a command as an administrator. AppleScript’s do shell script … with administrator privileges shows the standard macOS password window, and because osascript is the program running the script, the window names it.

It’s normal when:

  • you just ran an installer or an update that uses a script, for example a printer driver or a developer tool
  • you ran a command yourself in Terminal that you copied from a source you trust
  • a utility you installed runs a script to change a setting that needs a password

It isn’t normal when nothing you did needs a password. Mac stealers such as Cuckoo Stealer use osascript to show a window that looks like a system prompt, then keep the password you type. Your Mac password also unlocks your keychain, which is why they ask for it.

Should you block or quit osascript?

osascript rarely needs the internet. If you block it in a firewall, automation scripts can’t connect. Most people won’t notice.

Don’t type your password into an osascript window you didn’t expect. Click Cancel, then find out what started it (below). Quitting it in Activity Monitor stops the script that’s running; macOS doesn’t restart it.

How to check the osascript on your Mac is the real one

Run this in Terminal while the window is on screen:

Terminal
ps -ax -o user,ppid,command | grep osascript

The real one is /usr/bin/osascript, running with your user name. The PPID column is the number of the program that started it. To see that program’s name, replace 1234 with the number:

Terminal
ps -o command= -p 1234

To see who signed osascript:

Terminal
codesign -dv /usr/bin/osascript

Look for Identifier=com.apple.osascript and Platform identifier, which only Apple’s own programs have.

When to worry

  • A password window from osascript you didn’t ask for, especially soon after you pasted a command into Terminal or opened a downloaded app. Click Cancel, and check startup items in System Settings > General > Login Items & Extensions.
  • A script started by a program in an odd place, such as /tmp, /Users/Shared or a hidden folder in your home folder.
  • osascript using the network. Ordinary scripts rarely need it. Look at Activity Monitor’s Network tab, or a firewall that asks per app.

If you typed your password into a window that may have been fake, change your Mac password. Then, from another device, change your Apple Account password and the passwords saved in your browser. Our infostealer entry says what these programs take.

Frequently asked questions

What is an osascript?

osascript is a Mac command that runs scripts written in AppleScript or JavaScript. It’s how a script controls Mac apps from Terminal or from another program.

Is osascript a virus?

No. It’s part of macOS. Malware can use it to show fake password windows, so the question is what started it, not osascript itself.

Why does osascript want my password?

A script asked to run a command as an administrator. If you just ran an installer or a command you trust, that’s expected. If you didn’t, click Cancel.

How do I run a script on a Mac?

Open it in Script Editor and click Run, or run osascript followed by the script’s file name in Terminal. Only run scripts from sources you trust.

Sources

  1. Apple, Automate tasks using AppleScript and Terminal on Mac.
  2. Apple Developer, Technical Note TN2065: do shell script in AppleScript.
  3. Apple Developer, Mac Automation Scripting Guide: Displaying Dialogs and Alerts.
  4. MITRE ATT&CK, Command and Scripting Interpreter: AppleScript (T1059.002), which lists Cuckoo Stealer’s osascript password prompt.
  5. MITRE ATT&CK, Input Capture: GUI Input Capture (T1056.002).
  6. Path, signature and the ps columns checked on macOS 26.0.1 (25A362), 4 November 2026.

How we checked. Paths, commands and behaviour were checked on macOS 26.0.1 (25A362), MacBook Pro (16-inch, 2021), 4 November 2026. They can differ on other versions of macOS.