> ## Documentation Index
> Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
> Use this file to discover all available pages before exploring further.

# prompt

> Create a custom prompt to ask the user for credentials where you can provide titles, icons, text and default answer

## Summary

Create a custom prompt to ask the user for credentials where you can provide titles, icons, text and default answer

* Needs Admin: False
* Version: 1
* Author: @its\_a\_feature\_

<Warning>
  This can potentially hang the agent as dependent on user interaction, so be careful
</Warning>

### Arguments

#### title

* Description: Title of the dialog box
* Required Value: False
* Default Value: Application Needs to Update

#### icon

* Description: full path to .icns file to use
* Required Value: False
* Default Value: "/System/Library/PreferencePanes/SoftwareUpdate.prefPane/Contents/Resources/SoftwareUpdate.icns"

#### text

* Description: additional descriptive text to display
* Required Value: False
* Default Value: An application needs permission to update

#### answer

* Description: Default answer to pre-populate
* Required Value: False
* Default Value: None

## Usage

```
prompt
```

## MITRE ATT\&CK Mapping

* T1141

## Detailed Summary

Uses JXA to issue a prompt to the user and returns the information they supply:

```javascript theme={null}
let cbID = currentApp.systemAttribute('__CFBundleIdentifier').toString()
let contextApp = Application(cbID)
contextApp.includeStandardAdditions = true;
let prompt = currentApp.displayDialog(text, {
			defaultAnswer: answer,
			buttons: ['OK', 'Cancel'], 
			defaultButton: 'OK',
			cancelButton: 'Cancel', 
			withTitle: title,  
			withIcon: Path(icon),
			hiddenAnswer: true 
		});
return {"user_output":prompt.textReturned, "completed": true};
```
