tiktag AGENTS.md

tiktag AGENTS.md is an instructions file for Codex, OpenCode from agmxyz/tiktag. It costs 819 tokens per session, scanned A, original, MIT.

A project rule file for tiktag, a Rust text-anonymizing library and command-line tool. It records the rules, limits, and usage contract that coding agents must follow.

In plain words
What is it for?
Use it when modifying tiktag's library, command-line tool, or project files. It guides decisions about supported private-data types, model use, and how the library should be called.
Why use it?
It keeps agent changes focused and consistent with the project's existing behavior. It also makes important assumptions and checks explicit instead of leaving agents to guess.

Instructions file for CodexOpenCode

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

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 instructions/agmxyz/tiktag/agents-md
Clone the repo
git clone --depth 1 https://github.com/agmxyz/tiktag

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 tiktag AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/agmxyz/tiktag/agents-md.svg)](https://agentmods.dev/instructions/agmxyz/tiktag/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/agmxyz/tiktag/agents-md"><img src="https://agentmods.dev/badge/instructions/agmxyz/tiktag/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 819 This file is loaded in full into every session.
When invoked 819 The same file — it is already loaded in full.
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.00819 $0.00819
Opus 5 $0.00409 $0.00409
Sonnet 5 $0.00164 $0.00164
Haiku 4.5 $0.00082 $0.00082

Measured 5d ago against content hash 3b10472baa58, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

tiktag 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 5d 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 · 78 lines

How it starts

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

AGENTS.md

Authoritative project contract for tiktag. Keep this file to contract, invariants, and real caveats only. README.md stays user-facing and short.

Working rules

  • state assumptions when they matter; if ambiguity changes implementation, ask instead of guessing
  • prefer smallest change that solves request; no speculative features, abstractions, or configurability
  • touch requested scope only; do not refactor or clean unrelated code
  • verify behavior-changing work with targeted checks before declaring done

Project

tiktag = text anonymizer.

  • one Rust crate: library + thin CLI
  • built-in model: Xenova/distilbert-base-multilingual-cased-ner-hrl (quantized ONNX)
  • built-in model scope: PERSON, ORG, LOCATION
  • regex recognizers are additive supplements after model inference
  • current built-in regex recognizer: email

Library contract

use tiktag::{Tiktag, TiktagError, TiktagOutput};

let mut tiktag = Tiktag::new(&profiles_path)?;   // loads tokenizer + ONNX session once
let out: TiktagOutput = tiktag.anonymize(text)?; // reuses runtime per call
let text = &out.anonymization.anonymized_text;
  • construct once, call many: new is expensive; anonymize reuses runtime
  • anonymize takes &mut self; no internal locking
  • multi-thread hosts use Mutex<Tiktag> or per-thread instance
  • profiles_path is explicit
  • relative model_dir resolves against profile file parent only
  • TiktagOutput = anonymization + sequence_len + window_count
  • errors are TiktagError; keep typed variants for profile, bundle, and inference boundaries
  • placeholder numbering is stable per call only; no cross-document identity

CLI contract

  • tiktag "<text>" or tiktag --stdin prints anonymized text to stdout with trailing newline
  • tiktag --json emits machine-readable output without reversible metadata
  • tiktag --debug-json emits reversible metadata for local/debug use only
  • tiktag download fetches bundled model assets
  • diagnostics and timing logs go to stderr via log
  • JSON modes also emit stats.timings on stdout payload
  • CLI resolves models/profiles.toml from app-data first, then legacy fallback: <exe_dir>/models/profiles.toml, then cwd
  • no model/profile selection flags
  • prefer --stdin for large inputs

Read the full file on GitHub · 78 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. 5d ago First seen · 78 lines · 819 tokens per session scan A 3b10472baa58

Subscribe to this mod's changes

tiktag AGENTS.md is an instructions file published in the GitHub repository agmxyz/tiktag (5 stars, last pushed 4mo ago), licensed MIT. It adds 819 tokens to every session, about $0.0041 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-31.