Skip to content

Detect Grok Bot - #21

Merged
davidmokos merged 1 commit into
mainfrom
cursor/detect-grok-bot-f7fa
Oct 24, 2026
Merged

davidmokos merged 1 commit into
mainfrom
cursor/detect-grok-bot-f7fa

Conversation

@davidmokos

Copy link
Copy Markdown
Collaborator

Grok Bot's shell sets CURSOR_AGENT=1 and CURSOR_CONVERSATION_ID, which also match Cursor, plus SAND_BOX_BOOT_ID and SAND_BOX_STORE_ID. Each agent's env signals are OR'd, and selectBestAgent returns the first match in defaultAgents order, so grok-bot is listed before cursor. Either SAND_BOX_* variable detects it; the session id still comes from CURSOR_CONVERSATION_ID.

This is separate from the existing grok agent (GROK_AGENT / GROK_SESSION_ID).

Test plan

  • npm test (build and full suite, 21 passed)
Open in Web Open in Cursor 

Grok Bot sets CURSOR_AGENT alongside SAND_BOX_BOOT_ID and SAND_BOX_STORE_ID, so it is matched before Cursor. Session ids still come from CURSOR_CONVERSATION_ID.

Co-authored-by: David Mokos <davidmokos@users.noreply.github.com>
@davidmokos
davidmokos merged commit d2f8b90 into main Oct 24, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants