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:
- 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.
- Action guard — a
tools/agent-guard adapter if the CLI exposes a pre-tool hook, otherwise the tools/agent-isolation OS-level wrapper.
- Spec-loop profile — a headless
--cli invocation profile in tools/spec-loop/.
- 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:
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:skills/setup/agents.md) and the relay symlinks, so the byte-identicalSKILL.mdfiles load from wherever the Grok CLI looks for skills / project instructions.tools/agent-guardadapter if the CLI exposes a pre-tool hook, otherwise thetools/agent-isolationOS-level wrapper.--cliinvocation profile intools/spec-loop/.**Harness:**lines in the substrate tools that work under it.Also in scope:
grokentry intools/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 intests/test_backends.py.tools/privacy-llm/models.md. Document it as an opt-in entry an adopter declares in<project-config>/privacy-llm.mdwith 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):
AGENTS.md/ a skills directory natively.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:
docs/adapters/add-a-harness.mddocs/adapters/registry.md— add Grok to the Agent harness rowdocs/vendor-neutrality.mddocs/adapters/gemini.md,docs/adapters/codex.md