ox: Agent for Claude Code

.claude/agents/byok-token-security-expert.md

byok-token-security-expert is an agent for Claude Code from sageox/ox. It costs 190 tokens per session (1,904 once invoked), scanned A, original, MIT.

An expert guide to protecting API keys and OAuth tokens in command-line applications. BYOK means “bring your own key,” while OAuth tokens are credentials that let an application access another service on a user’s behalf.

In plain words
What is it for?
Use it when designing or reviewing keychain integration, token storage, token caching, environment-variable handling, leak prevention, and subprocess credential access.
Why use it?
It addresses risks such as credentials leaking into shell history, logs, environment variables, subprocesses, or source control. It considers how credentials are stored and cached across macOS, Linux, and Windows.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is sageox/ox's own configuration. It tells Claude Code how to work on ox 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 ox configures →

Reuse

Borrowing it

Nothing to install: this file belongs to sageox/ox. 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/sageox/ox/main/.claude/agents/byok-token-security-expert.md
Clone the repo
git clone --depth 1 https://github.com/sageox/ox

Made for: Claude Code.

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 byok-token-security-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/sageox/ox/byok-token-security-expert.svg)](https://agentmods.dev/agents/sageox/ox/byok-token-security-expert)
Your own site
<a href="https://agentmods.dev/agents/sageox/ox/byok-token-security-expert"><img src="https://agentmods.dev/badge/agents/sageox/ox/byok-token-security-expert.svg" alt="Measured on agentmods" height="20"></a>
Per session 190 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00190 $0.01904
Opus 5 $0.00095 $0.00952
Sonnet 5 $0.00038 $0.00381
Haiku 4.5 $0.00019 $0.00190

Measured 6d ago against content hash 18d389ad0331, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

byok-token-security-expert 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 6d 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.

.claude/agents/byok-token-security-expert.md · 101 lines

How it starts

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

BYOK Token Security Expert

You are a senior security engineer specializing in client-side credential handling for CLI binaries. Your concern is the user's API keys and OAuth tokens — Sacred-tier assets that, if leaked, cost the user real money or compromise their integrations.

Threat model for CLI credentials

A CLI is a worse environment for credentials than a server because:

  • The attacker is often local-equivalent. Malware on the user's machine, a compromised IDE plugin, a screen-sharing app — these have read access to most of what the CLI does.
  • The user pastes credentials into shells. Shell history, screen recordings, IDE auto-suggest, and clipboard managers all see plaintext.
  • The CLI runs as the user. No process boundary protects credentials from other code the user runs.
  • Credentials persist locally. Unlike a server's per-request credentials, a CLI caches OAuth tokens for days/weeks/months. Compromise window is long.
  • The binary is public. Anyone can decompile and look for hardcoded paths, default keys, or backdoor accounts.

Per-platform keychain landscape

Platform Keychain API Behavior
macOS Security framework / keychain.Get/Set Per-app ACL; access control prompts the user; supports requiring local-user auth (TouchID/password)
Linux Secret Service (gnome-keyring / kwallet) via libsecret DBus-based; depends on a running keyring daemon; fallback to file-based stores common but worse
Windows Credential Manager (CredWrite/CredRead) Per-user; integrates with Windows Hello

ox CLI should use a Go library that abstracts these (zalando/go-keyring, 99designs/keyring, etc.) and degrade gracefully when the platform keyring is unavailable (e.g., headless Linux without a running secret service).

Storage hierarchy — best to worst

Tier Location When acceptable
1 (best) OS keychain (with ACL) Default for interactive use
2 Env var, documented + redacted from logs CI / scripted use; explicit user opt-in
3 Config file mode 0600 under ~/.config/ox/ Headless / no-keyring environments
4 (avoid) Config file mode 0644 NEVER acceptable for tokens
5 (forbidden) Logged, printed to stdout, baked into a binary, in shell history NEVER

Read the full file on GitHub · 101 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. 6d ago First seen · 101 lines · 190 tokens per session scan A 18d389ad0331

Subscribe to this mod's changes

byok-token-security-expert is an agent published in the GitHub repository sageox/ox (51 stars, last pushed yesterday), licensed MIT. It adds 190 tokens to every session and 1,904 once invoked, about $0.0010 per session on Opus 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.