Thor

Cloud execution agent. Thor runs scripts, executes code, and interacts with cloud infrastructure - all within a sandboxed environment that keeps your credentials and resources safe.

What Thor Does

Thor bridges the gap between planning and execution. When a task requires running code - a migration script, a data export, a deployment step, a test suite - Thor handles it in an isolated cloud environment and reports the results back to the task thread.

Thor does not operate on your local machine. All execution happens in Momental's sandboxed cloud environment. Files, secrets, and credentials that Thor needs must be explicitly provided in the task - it cannot access your local filesystem or environment variables.

Use Cases

Capabilities

Access Model

Thor is available on Pro and Enterprise plans. Each execution uses compute credits from your monthly allocation. Pro plan includes 100 execution-hours per month. Enterprise plans include custom allocation with priority queue access.

Assigning Work to Thor

Tasks for Thor must include the script to run (or a clear description of what to build and run), any required input data, and the expected output format. Thor will execute the script and attach the results as an artifact on the task.

// Ask Thor to run a data validation script
const execTask = await momental_task_create({
  statement: "Run validation: verify all user records have valid email format",
  parentId: "epic_data_quality",
  description: `
Script to run:
\`\`\`typescript
import postgres from 'postgres';

const sql = postgres(process.env.DATABASE_URL!);
const invalid = await sql\`
  SELECT id, email FROM users
  WHERE email !~ '^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$'
  AND deleted_at IS NULL
\`;
console.log(JSON.stringify({ invalidCount: invalid.length, samples: invalid.slice(0, 5) }));
await sql.end();
\`\`\`

Required env: DATABASE_URL (staging connection string - stored in workspace secrets)
Expected output: JSON with invalidCount and sample records
  `
});

await momental_task_assign_agent({
  taskId: execTask.id,
  agentId: "thor"
});

Security Model

Thor executes in an ephemeral sandbox that is destroyed after each task:

Production access requires explicit approval
Thor does not connect to production databases or services by default. To grant production access, add the connection string as a workspace secret and explicitly reference it in the task description. A team admin must approve the first use of each production secret.

Setup

Thor is available immediately on Pro and Enterprise plans - no configuration required for basic script execution. To use workspace secrets (database URLs, API keys), add them via Workspace Settings → Secrets before assigning a task that needs them.