Skip to content

feat(adapter/grok): xAI Grok agent harness and adversarial-review backend #1416

Description

@potiuk

Goal: Add xAI's Grok as a supported agent harness, following the same path as the other runtimes in the adapter registry (Codex #313, Gemini CLI #314, …). Grounds: RFC-AI-0004 Principle 3 — Vendor neutrality.

Why Grok: Grok is not in the harness list at all today, not even as a tracked extension point. Adopters who use it have no documented way to run Magpie skills, and no way to add it as an adversarial reviewer.

What "support" means — the four integration points from docs/adapters/add-a-harness.md:

  1. Skill loading — a row in the agent-target registry (skills/setup/agents.md) and the relay symlinks, so the byte-identical SKILL.md files load from wherever the Grok CLI looks for skills / project instructions.
  2. Action guard — a tools/agent-guard adapter if the CLI exposes a pre-tool hook, otherwise the tools/agent-isolation OS-level wrapper.
  3. Spec-loop profile — a headless --cli invocation profile in tools/spec-loop/.
  4. Harness declarations — the **Harness:** lines in the substrate tools that work under it.

Also in scope:

  • Adversarial-review backend — a grok entry in tools/adversarial-review/src/adversarial_review/backends.py, with the same guarantees the others have: text-only prompt on stdin, read-only / plan mode, no MCP servers reachable, argv snapshot in tests/test_backends.py.
  • Privacy-LLM — Grok (xAI API) is not in the default-approved set in tools/privacy-llm/models.md. Document it as an opt-in entry an adopter declares in <project-config>/privacy-llm.md with a data-residency link and approval line, so the Step 0 gate stops skills that read private lists until that is done.

To verify before implementing (not assumed here):

  • Which Grok CLI to target, and whether it reads AGENTS.md / a skills directory natively.
  • Whether it has a pre-tool hook API, a sandbox mode, and an approve-before-run mode (decides step 2 and the HITL mapping).
  • Whether it can run headless with a read-only / plan mode and structured (JSON) output (decides step 3 and the reviewer backend).
  • MCP support, and how to disable it for the reviewer backend.

Suggested order (per add-a-harness.md § Scope): registry row + relay symlinks → loop profile → guard adapter → harness declarations; the reviewer backend and privacy-llm doc can land independently.

References:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    capability:platformFramework / agent substrate skills (install, verify, doctor, override, status, setup bootstrap)enhancementNew feature or requestfamily:toolstools/*

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions