Function contract
Every script exports a function withtask and responses arguments and must return an object:
For example, display an operation file inline:
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Transform task responses into supported Mythic 4.0 output views.
task and responses arguments and must return an object:
function(task, responses) {
if (task.status.toLowerCase().includes("error")) {
return { plaintext: responses.join("") };
}
const rows = responses.map((response) => {
const item = JSON.parse(response);
return {
name: { plaintext: item.name },
pid: { plaintext: item.pid },
user: { plaintext: item.user }
};
});
return {
table: [{
title: "Processes",
headers: [
{ plaintext: "name", type: "string", fillWidth: true },
{ plaintext: "pid", type: "number", width: 120 },
{ plaintext: "user", type: "string", width: 220 }
],
rows
}]
};
}
| Key | Value |
|---|---|
plaintext | A string rendered with plaintext, JSON, Markdown, and terminal view options. |
table | An array of table definitions with headers and rows. Cells can include text, tasking buttons, copy actions, and formatting. |
media | An array of objects containing an agent_file_id, optional filename, and optional editable. Mythic fetches previews and downloads with authenticated requests. |
graph | A graph definition for structured relationship output. |
tabs | An array of {title, content} objects; content uses the same supported keys recursively. |
return {
media: [{
agent_file_id: data.file_id,
filename: data.filename,
editable: false
}]
};
screenshot, download, and search renderers were removed in v4. Return media for file previews/downloads, or use supported table cells and current routes. Custom fetches must add the current Bearer token; cookie-only media access no longer works.Was this page helpful?
