#151

Agent: Grok Build CLI

Openayush-thatopened 3mo ago

What problem are you trying to solve

Grok models already work through the pi harness (xai/grok-4.6 via gateway or direct key). There is no first-class agent that drives the open-source Grok Build CLI the way deepsec drives Codex / Claude / Pi.

People who already use Grok Build headless (grok -p) want --agent grok without routing through pi.

What would you want deepsec to do

Add --agent grok that spawns the Grok Build CLI for process / revalidate / setup (auth via XAI_API_KEY or grok login).

I built this locally and ran it against production codebases. Found 200+ issues.

Workaround you're using today

Run Grok models on --agent pi, or use a local fork with the Grok Build harness.

Activity

4
ralphilius2mo ago

@ayush-that Can you show me your workaround? I'm trying to figure out how to run this before the PR landed, but keep failing with configuration and first run

ayush-that2mo ago

@ralphilius --agent grok is not on npm yet. The setup is in the PR docs:

https://github.com/ayush-that/deepsec/blob/main/docs/models.md#grok-build-for-local-cli-runs

Until it lands, Grok models already work through Pi:

npx deepsec init --agent pi --model xai/grok-4.6

To run the CLI harness from https://github.com/vercel-labs/deepsec/pull/152: install grok (https://x.ai/cli), XAI_API_KEY or grok login, clone the fork, pnpm install && pnpm bundle, then init --agent grok --model-auth local. If first run dies on the host read-only sandbox / docker.sock, export DEEPSEC_GROK_SANDBOX=off.

ralphilius1mo ago

Hi @ayush-that, I tried with npx deepsec init --agent pi --model xai/grok-4.6, but I got Pi model not found: xai/grok-4.6.. This is weird because my default model in pi is xai/grok-4.6

ayush-that1mo ago

Hi @ralphilius. Thanks for reporting this and sorry for the above incorrect instruction. npx deepsec downloads the current npm release, which has the older Pi catalog.

To try the PR now:

git clone --branch main --single-branch https://github.com/ayush-that/deepsec.git deepsec-grok-4.6
cd deepsec-grok-4.6
corepack pnpm@8.15.9 install
corepack pnpm@8.15.9 --filter @deepsec/core --filter @deepsec/scanner build
cd packages/deepsec && node build.mjs
export DEEPSEC_PR_DIR="$PWD/../.."

Then, from the project you want to scan:

XAI_API_KEY=... node "$DEEPSEC_PR_DIR/packages/deepsec/dist/cli.mjs" init \
  --agent pi \
  --model xai/grok-4.6 \
  --model-auth direct \
  --ai-provider xai \
  --ai-api-key-env XAI_API_KEY