J-x4-tokenization

J-x4-tokenization is an agent for coding agents from darkiceinteractive/mcp-conductor. It costs 0 tokens per session (805 once invoked), scanned A, original, MIT.

A workstream that replaces sensitive values in MCP responses with tokens before they reach a sandbox or Claude's context. It can restore the original values for outbound calls.

In plain words
What is it for?
It is for redacting emails, phone numbers, social security numbers, credit cards, IBANs, and IP addresses in upstream responses, then detokenizing values when needed for outgoing calls.
Why use it?
It reduces the exposure of personal and other sensitive data while data is being processed by the agent.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/darkiceinteractive/mcp-conductor/j-x4-tokenization
Clone the repo
git clone --depth 1 https://github.com/darkiceinteractive/mcp-conductor

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 J-x4-tokenization

README.md
[![agentmods](https://agentmods.dev/badge/agents/darkiceinteractive/mcp-conductor/j-x4-tokenization.svg)](https://agentmods.dev/agents/darkiceinteractive/mcp-conductor/j-x4-tokenization)
Your own site
<a href="https://agentmods.dev/agents/darkiceinteractive/mcp-conductor/j-x4-tokenization"><img src="https://agentmods.dev/badge/agents/darkiceinteractive/mcp-conductor/j-x4-tokenization.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 805 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 $0.00000 $0.00805
Opus 5 $0.00000 $0.00402
Sonnet 5 $0.00000 $0.00161
Haiku 4.5 $0.00000 $0.00081

Measured 3d ago against content hash 0619ae5621c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

J-x4-tokenization 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 3d 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.

_plans/v3-enhancements/agents/J-x4-tokenization.md · 59 lines

How it starts

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

Agent J — Workstream X4 PII tokenization

You add per-server redact.response config that strips sensitive values from upstream responses before they enter the sandbox or Claude's context. Reverse map sandbox-local; mcp.detokenize(value) for outbound calls.

Setup

pwd  # /mcp-executor-darkice-worktrees/J-x4
git branch --show-current  # feature/v3-x4-tokenization
git fetch origin
git rebase origin/feature/v3-phase-0-1   # registry needed
git rebase origin/feature/v3-x1-passthrough   # X1 routing annotations side-by-side with redact
npm install && npm run test:run

Read /Users/mattcrombie/.claude/plans/read-this-analysis-from-rosy-whale.md §3 Part C "Workstream X4".

Append start checkpoint to STATUS.md.

Scope

Built-in matchers ONLY this cut (decision recorded — no inline-regex this sprint):

  • email (RFC 5322 simplified)
  • phone (loose international, e.g. +CC NNNN NNN NNN, (NNN) NNN-NNNN)
  • SSN (NNN-NN-NNNN and 9-digit run with context)
  • credit card (Luhn-validated, 13–19 digits with optional separators)
  • IBAN (basic checksum)
  • IPv4 + IPv6

Files:

  • src/utils/tokenize.ts (NEW) — pure tokenizer; reuses Phase 1.6 redact infrastructure (src/utils/redact.ts already exists for log redaction) but generalises it to data-flow with a reverse map.
  • src/hub/mcp-hub.ts — apply tokenizer to result before return when ToolDefinition.redact.response annotation present.
  • src/runtime/executor.ts — sandbox preamble: mcp.detokenize(value) looks up the reverse map. Reverse map is per-execution (not shared across execute_code calls) so a token can't survive past the call that minted it.

Annotation read from ToolDefinition.redact (set via update_server MCP tool [Agent I's territory] or directly in ~/.mcp-conductor.json).

Acceptance

  • Server returning {"email":"[email protected]", "phone":"+61 412 345 678"} surfaces {"email":"[EMAIL_1]", "phone":"[PHONE_1]"} in the sandbox.
  • mcp.detokenize("[EMAIL_1]") returns [email protected] inside the same execute_code call.
  • Token survives a within-call outbound MCP call (e.g. mcp.server('crm').call('lookup', {email: mcp.detokenize('[EMAIL_1]')}) works).
  • Token does NOT detokenize when returned as the final result (Claude sees [EMAIL_1]).
  • A subsequent execute_code call cannot detokenize tokens from a prior call.
  • test/unit/tokenize.test.ts, test/integration/tokenize-flow.test.ts (~12 cases) pass.

Read the full file on GitHub · 59 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. 3d ago First seen · 59 lines · 0 tokens per session scan A 0619ae5621c8

Subscribe to this mod's changes

J-x4-tokenization is an agent published in the GitHub repository darkiceinteractive/mcp-conductor (0 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 805 tokens. 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-31.