humanizer_idle
Simulate human-like idle behavior using mouse micro-jitter and occasional micro-scrolls to evade bot-detection scripts that monitor activity.
Instructions
Simulate idle behavior with mouse micro-jitter and occasional micro-scrolls. Keeps the page 'alive' to avoid idle detection by bot-detection scripts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target_id | Yes | Target ID from interceptor_browser_launch or interceptor_camoufox_launch | |
| duration_ms | Yes | How long to simulate idle behavior in ms | |
| intensity | No | Idle intensity: 'subtle' (±3px jitter) or 'normal' (±8px jitter, more scrolls) | subtle |
Implementation Reference
- src/humanizer/engine.ts:163-201 (handler)The idle() method on HumanizerEngine that executes the core logic: mouse micro-jitter and micro-scrolls to simulate human idle behavior.
async idle( targetId: string, durationMs: number, intensity: "subtle" | "normal" = "subtle", ): Promise<{ totalMs: number; eventsDispatched: number }> { const page = await getPageForTarget(targetId); const state = getMouseState(targetId); const start = Date.now(); let eventsDispatched = 0; const jitterRadius = intensity === "subtle" ? 3 : 8; const scrollChance = intensity === "subtle" ? 0.05 : 0.15; const actionInterval = intensity === "subtle" ? rand(400, 1200) : rand(200, 600); while (Date.now() - start < durationMs) { const waitMs = Math.min( Math.round(rand(actionInterval * 0.7, actionInterval * 1.3)), durationMs - (Date.now() - start), ); if (waitMs > 0) await sleep(waitMs); if (Date.now() - start >= durationMs) break; if (Math.random() < scrollChance) { const microDelta = Math.round(rand(-20, 20)); if (microDelta !== 0) { await page.mouse.wheel(0, microDelta); eventsDispatched++; } } else { const jx = Math.round(state.x + rand(-jitterRadius, jitterRadius)); const jy = Math.round(state.y + rand(-jitterRadius, jitterRadius)); await page.mouse.move(jx, jy); state.x = jx; state.y = jy; eventsDispatched++; } } return { totalMs: Date.now() - start, eventsDispatched }; - src/tools/humanizer.ts:179-209 (handler)The MCP tool handler for 'humanizer_idle' that calls humanizerEngine.idle() and formats the response.
server.tool( "humanizer_idle", "Simulate idle behavior with mouse micro-jitter and occasional micro-scrolls. " + "Keeps the page 'alive' to avoid idle detection by bot-detection scripts.", { target_id: z.string().describe("Target ID from interceptor_browser_launch or interceptor_camoufox_launch"), duration_ms: z.number().describe("How long to simulate idle behavior in ms"), intensity: z.enum(["subtle", "normal"]).optional().default("subtle") .describe("Idle intensity: 'subtle' (±3px jitter) or 'normal' (±8px jitter, more scrolls)"), }, async ({ target_id, duration_ms, intensity }) => { try { const result = await humanizerEngine.idle(target_id, duration_ms, intensity); return { content: [{ type: "text", text: JSON.stringify({ status: "success", target_id, action: "idle", requested_ms: duration_ms, intensity, stats: { total_ms: result.totalMs, events_dispatched: result.eventsDispatched }, }), }], }; } catch (e) { return { content: [{ type: "text", text: JSON.stringify({ status: "error", target_id, action: "idle", error: errorToString(e) }) }] }; } }, ); - src/tools/humanizer.ts:183-188 (schema)Schema/input validation for humanizer_idle tool: target_id, duration_ms, and optional intensity ('subtle' or 'normal').
{ target_id: z.string().describe("Target ID from interceptor_browser_launch or interceptor_camoufox_launch"), duration_ms: z.number().describe("How long to simulate idle behavior in ms"), intensity: z.enum(["subtle", "normal"]).optional().default("subtle") .describe("Idle intensity: 'subtle' (±3px jitter) or 'normal' (±8px jitter, more scrolls)"), }, - src/index.ts:71-71 (registration)Registration of all humanizer tools (including humanizer_idle) in the MCP server via registerHumanizerTools().
registerHumanizerTools(server); - src/tools/humanizer.ts:20-20 (registration)The registerHumanizerTools function exported from humanizer.ts that registers all humanizer tools on the MCP server.
export function registerHumanizerTools(server: McpServer): void {