pi-xai-oauth: Instructions file for Codex

AGENTS.md

pi-xai-oauth AGENTS.md is an instructions file for Codex, OpenCode from BlockedPath/pi-xai-oauth. It costs 3,751 tokens per session, scanned A, original, MIT.

An operations guide for adding xAI OAuth login and Grok model access to Pi, a coding assistant that supports configurable AI providers.

In plain words
What is it for?
Use it when installing or configuring the package, implementing xAI authentication, selecting models, or working on usage reporting and API streaming.
Why use it?
It gives agents the approved setup flow, provider boundaries, authentication steps, and catalog rules needed to change the package safely.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents; mentions AGENTS.md.

This is BlockedPath/pi-xai-oauth's own configuration. It tells Codex and OpenCode how to work on pi-xai-oauth itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pi-xai-oauth configures →

Reuse

Borrowing it

Nothing to install: this file belongs to BlockedPath/pi-xai-oauth. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/BlockedPath/pi-xai-oauth/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/BlockedPath/pi-xai-oauth

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pi-xai-oauth AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/blockedpath/pi-xai-oauth/agents-md/github.svg)](https://agentmods.dev/instructions/blockedpath/pi-xai-oauth/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/blockedpath/pi-xai-oauth/agents-md"><img src="https://agentmods.dev/badge/instructions/blockedpath/pi-xai-oauth/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pi-xai-oauth AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/blockedpath/pi-xai-oauth/agents-md"><img src="https://agentmods.dev/badge/instructions/blockedpath/pi-xai-oauth/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,751 This file is loaded in full into every session.
When invoked 3,751 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03751 $0.03751
Opus 5.5 $0.01500 $0.01500
Sonnet 5.5 $0.00750 $0.00750
Haiku 4.5 $0.00375 $0.00375

Measured 16d ago against content hash a12a159f4195, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pi-xai-oauth AGENTS.md 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 16d ago.

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.

AGENTS.md · 198 lines

How it starts

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

AGENTS.md — AI Agent Operations Manual for pi-xai-oauth

For AI coding agents only. Keep this file machine-readable and concise. Human-facing docs live in README.md.

Project Overview

pi-xai-oauth is a pi-package that registers the optional xAI OAuth provider (xai-auth) and the authenticated account's OAuth-visible Grok model catalog, including Grok 4.7 when entitled, with Grok 4.6 retained as the curated offline fallback. Opt-in network tools and /xai-usage also work with Pi's built-in xai SuperGrok/X Premium chat provider; setup seeds defaultProvider: xai only when unset and never overwrites an existing provider choice.

Core flow: bin/setup.js → pi install → bounded catalog selection in extensions/xai/catalog.ts → provider registration in extensions/xai-oauth.ts → browser PKCE or bounded device authorization in extensions/xai/oauth.ts / extensions/xai/device-auth.ts → pinned browser OIDC/JWKS validation in extensions/xai/oidc.ts → streaming via xAI API helpers in extensions/xai/responses.ts; explicit revision-pinned subscription usage lives in extensions/xai/usage.ts; Grok voice dictation and the opt-in TTS/STT tools live in extensions/xai/voice/.

Key Commands (Exact, Copy-Paste Ready)

  • Install / setup: node bin/setup.js or npm run setup
  • Install as pi extension: pi install npm:pi-xai-oauth
  • Explicit usage CSV export in Pi TUI/RPC: /xai-usage csv (normalized fields only, copyable output, no automatic file writes or status opt-in)
  • Grok voice dictation in Pi TUI/RPC: /xai-voice [language|auto] [live|clip], Ctrl+Space, or F8 (needs a system recorder, a real microphone, and xAI OAuth; not runnable headless)
  • Grok voice chat in Pi TUI/RPC: /xai-talk [eve|ara|rex|sal|leo] [duplex] [context] (needs a recorder, an audio player, speakers or headphones, and xAI OAuth; not runnable headless)
  • Full policy/unit/loader/CLI gate: npm test
  • Focused Vitest suite: npm run test:unit -- tests/oauth/browser-login.test.ts
  • V8 coverage: npm run test:coverage
  • Real Pi RPC e2e suite: npm run test:e2e (spawns pi --mode rpc with only this extension in an isolated HOME; offline, no credentials, no model calls; needs Node ^22.22.3 or >=24.8, so it stays out of npm test and runs in the exact-version boundary jobs instead)
  • Real Pi loader smoke: npm run test:loader
  • Real Pi version and isolated update-dispatch smoke: npm run test:cli
  • Run TypeScript: npm run typecheck (production, tests, fixtures, config)
  • Verify Pi policy/package metadata: npm run compatibility:check
  • Verify exact packed Pi boundaries: npm run compatibility:boundaries
  • Verify the scoped GitHub Packages mirror: node scripts/verify-github-package.js
  • Evaluate an unadvertised Pi candidate: node scripts/run-compatibility-matrix.js X.Y.Z --candidate
  • Git: Always work on feature branches and confirm the active branch before edits.

Read the full file on GitHub · 198 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. 16d ago Changed · +3 lines · +155 tokens per session a12a159f4195
  2. 17d ago Changed · +7 lines · +415 tokens per session 6556dc0f5d90
  3. 24d ago Changed · +3 tokens per session bc0ede578f9a
  4. 1mo ago Changed · +3 lines · +65 tokens per session c256bb7f515a
  5. 1mo ago Changed · +1 lines · +75 tokens per session 9b3f07a41e98
  6. 1mo ago Changed · +1 lines · +40 tokens per session c20b5729a1cc
  7. 1mo ago Changed · +1 lines · +37 tokens per session 8fe6a70f63c8
  8. 1mo ago First seen · 182 lines · 2,961 tokens per session scan A c71e077f3a4d

Subscribe to this mod's changes

pi-xai-oauth AGENTS.md is an instructions file published in the GitHub repository BlockedPath/pi-xai-oauth (43 stars, last pushed 3d ago), licensed MIT. It adds 3,751 tokens to every session, about $0.0150 per session on Opus 5.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-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,715 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,786 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens