apify-routing

A routing rule for Apify, a platform for running web-scraping and browser-automation programs called Actors. It sends Apify-related requests to the Apify subagent, which chooses the appropriate Apify capability.

In plain words
What is it for?
Use it for requests involving Apify Actors, the Apify Store, web scraping, browser automation, the Apify SDK or CLI, Apify packages, or Apify websites.
Why use it?
It avoids choosing between similar Apify tools or packages incorrectly. The same routing applies to quick questions and direct tool calls.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/apify/apify-cursor-plugin/apify-routing
Clone the repo
git clone --depth 1 https://github.com/apify/apify-cursor-plugin
Per session 80 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 771 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00080 $0.00771
Opus 5 $0.00040 $0.00385
Sonnet 5 $0.00016 $0.00154
Haiku 4.5 $0.00008 $0.00077

Measured yesterday against content hash f37ac965e6df, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

apify-routing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

apify/rules/apify-routing.mdc · 50 lines

How it starts

The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Apify Routing

Cursor exposes Apify skills (apify-actor-development, apify-actorization, apify-generate-output-schema, apify-sdk-integration, apify-ultimate-scraper) directly in the slash menu. They are internal capabilities owned by the apify subagent and must not be invoked on their own.

Required Behavior

When the user's request involves Apify — Actors, web scraping, browser automation, the Apify Store, the Apify SDK, the Apify CLI, the apify or apify-client npm packages, or anything at apify.com / console.apify.com — invoke the apify subagent first. Let it consult its routing matrix and dispatch to the correct skill or MCP tool.

Do not:

  • Call any apify-* skill directly from the slash menu without going through the apify subagent.
  • Guess between apify-actor-development vs apify-actorization vs apify-sdk-integration yourself — the subagent owns that decision (the apify SDK package and the apify-client package are easy to confuse and picking wrong breaks the user's project).
  • Skip the subagent for "quick" Apify questions. Even MCP tool calls (search-actors, run-actor, etc.) are routed through the subagent.

If the user types a slash command for an Apify skill explicitly, still hand off to the apify subagent so the routing matrix and authentication guidance are applied.

Why this rule exists

Apify exposes three very different products through its plugin: (1) using existing Actors via MCP, (2) building and deploying custom Actors with the SDK + CLI, and (3) calling Actors from an existing application via apify-client. Each path requires a different skill, a different authentication flow, and a different npm package. The apify subagent is the only place where the routing matrix and the package-naming trap are documented, so every Apify request must pass through it.

Apify CLI instructions:

  • Before using the CLI, always check if it is installed:
    apify --help
  • If the CLI is installed, check if it is logged in:
    # Auth check — do NOT pipe to /dev/null, you need to see errors
    apify info 2>&1
  • If the CLI is not logged in, instruct the user to log in with the non-interactive flag:
    apify login --token TOKEN
  • All of the APify commands needs to be run with the all permissions (depends on Agent sandbox)
  • Apify commands blocks with zero output until the run completes. Set block_until_ms to at least 60000 (60s).
  • For long/unknown runs, use the async pattern instead:
    apify actors start "ACTOR_ID" -i 'JSON_INPUT' --json 2>/dev/null

Then poll with apify info:

    apify info actor-runs/RUN_ID --json

Check .status for SUCCEEDED or FAILED.

Read the full file on GitHub · 50 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 50 lines · 80 tokens per session scan A f37ac965e6df

Subscribe to this mod's changes

apify-routing is a cursor rule published in the GitHub repository apify/apify-cursor-plugin (3 stars, last pushed 7d ago), licensed Apache-2.0. It adds 80 tokens to every session and 771 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.