Agents

Use TN with your agent

Seven skills that give your coding agent a complete picture of TN: write, annotate, read, lint, verify, manage access, and declare policy. The agent already knows the standards for your industry: PCI, HIPAA, FHIR, FERPA, FIX, CloudTrail, and eight more.

Install the skills — two commands

In any Claude Code session:

/plugin marketplace add cyaxios/tn-skills
/plugin install tn-logging@tn-skills

For Cursor, Copilot, Codex CLI, or any other agent — drop the cross-vendor brief into your project root:

curl -O https://raw.githubusercontent.com/cyaxios/tn-skills/main/AGENTS.md

That’s enough. The agent will use the right field names, call the right verbs, and cite the right standard for the code it touches. Continue below if you want the SDK wired up or an MCP server connected.

One-time SDK setup, any agent

Install the protocol once and scaffold a project. The skills assume both; if either is missing, the agent will tell you.

pip install tn-proto
python -m tn.cli init my-project

The init command writes my-project/tn.yaml, mints a keystore, and prints a one-time recovery phrase. Published on PyPI as tn-protopip install tn-proto works out of the box.

npm install @cyaxios/tn-proto

Initializes the client from your shared tn.yaml file at process startup. Published on npm as @cyaxios/tn-protonpm install @cyaxios/tn-proto works out of the box.

# C# NuGet package coming soon:
# dotnet add package TnProto

# Rust cargo crate coming soon:
# cargo add tn-proto

Native integrations for C# and Rust will be available in the next release cycle.

Agent Configuration Guides

Select your preferred coding environment to view copy-pasteable settings, MCP server configs, and project-level agent rules.

1. Install the Plugin (Recommended)

Register the marketplace once, then install the logging plugin. The plugin automatically applies safety guidelines, drafts agents.md policies, and routes fields to the right encryption groups.

# Run inside any Claude Code session
/plugin marketplace add cyaxios/tn-skills
/plugin install tn-logging@tn-skills

Alternatively, install locally from the latest release zip:

# Manual installation from release zip
gh release download v0.5.1a1 --repo cyaxios/tn-skills \
  --pattern 'tn-skills-claude-code-*.zip'
unzip tn-skills-claude-code-*.zip -d ~/.claude/plugins/tn-logging

2. Connect the TN MCP Server

To allow Claude Code to query the vault, read historical logs, and rotate keys, register the stdio-based MCP server:

# Command to register the server globally or locally
claude mcp add tn tn-mcp-server

If the CLI is installed in a python virtual environment, use the Python module wrapper instead:

claude mcp add tn python -m tn.mcp

1. Project-wide Brief (AGENTS.md)

Cursor automatically indexes the files in your project root. Drop the canonical brief into your workspace root to align Cursor's code-generation engine:

# Download the brief directly to your project root
curl -O https://raw.githubusercontent.com/cyaxios/tn-skills/main/AGENTS.md

2. Rules File (.cursorrules)

You can append the following rules to your project's .cursorrules file to enforce secure logging policies on every prompt:

# Append this block to your .cursorrules
Always use the TN protocol for logging.
- Python: import tn; tn.info("domain.action", field1=val1)
- TypeScript: import * as tn from "@cyaxios/tn-proto"; await tn.init();
- Sensitive fields (emails, IPs, card numbers, amounts) MUST use standard canonical names (email, ip, amount, currency, card_last4) so they route to encrypted groups.
- Event names must be dotted (domain.action.outcome).
Refer to AGENTS.md in the project root for full guidelines.

3. Register the MCP Server

Enable Cursor to run queries and manage keys directly. In Cursor, navigate to Settings → Features → MCP, click + Add New MCP Server, and input:

  • Name: tn
  • Type: command
  • Command: tn-mcp-server (or python -m tn.mcp if using a local project virtual environment)

Claude Desktop Configuration

To configure the vault connector in your Claude Desktop client, edit your configuration file (located at %APPDATA%\Claude\claude_desktop_config.json on Windows, or ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

Standard globally installed command:

{
  "mcpServers": {
    "tn": {
      "command": "tn-mcp-server",
      "cwd": "/path/to/your/project"
    }
  }
}

Virtual Environment (Python-module wrapper):

{
  "mcpServers": {
    "tn": {
      "command": "/path/to/your/venv/bin/python",
      "args": ["-m", "tn.mcp"],
      "cwd": "/path/to/your/project"
    }
  }
}

1. Start the Server

Know Your Exhaust (KYE) is a local MCP server that analyzes raw application logs and telemetry, identifies unencrypted PII, and offers to instrument code.

# 1. Install dependencies
pip install -r _lab/exhaust/requirements.txt

# 2. Run the server (default runs HTTP mode on port 8731)
python _lab/exhaust/server.py http

2. Register the MCP Connector

Register the dynamic audit connector with your preferred agent:

Claude Code:

claude mcp add --transport http know-your-exhaust http://127.0.0.1:8731/mcp

Claude Desktop Config (HTTP transport):

{
  "mcpServers": {
    "know-your-exhaust": {
      "type": "http",
      "url": "http://127.0.0.1:8731/mcp"
    }
  }
}

Cursor MCP (SSE mode):

  • Name: know-your-exhaust
  • Type: sse
  • URL: http://127.0.0.1:8731/mcp

Gemini CLI & Codex CLI:

# For Gemini CLI
gemini mcp add --transport http --trust know-your-exhaust http://127.0.0.1:8731/mcp

# For Codex CLI
codex mcp add know-your-exhaust --url http://127.0.0.1:8731/mcp

1. Terminal-based Agents (pi / codex)

If you use CLI coding tools, clone and symlink prompts directly into your agents directory:

# Install agents globally
npm install -g @mariozechner/pi-coding-agent @openai/codex

# Clone and symlink skills prompts globally
git clone https://github.com/cyaxios/tn-skills ~/src/tn-skills
mkdir -p ~/.agents/skills
ln -s ~/src/tn-skills/prompts ~/.agents/skills/tn

# Or configure locally for this workspace only
mkdir -p ./.agents/skills
ln -s ~/src/tn-skills/prompts ./.agents/skills/tn

2. Source Prompts & Custom Systems

The skills are written in plain Markdown. For custom or proprietary agents:

  • Per-topic prompts: Feed system-prompt.md as system message, and matching usage-*.md as the user prompt. Browse them on GitHub prompts/.
  • Skill Bundles: Concatenated markdown files ready to drop in. Download tn-skills-hermes-*.zip from the releases page.

What you can ask for

tn-logging

“Log this like we usually do.”

Your agent emits TN log lines in the spots that matter: after a database write, an HTTP call, a payment, a user action. It follows your project conventions so the event names stay tidy.

tn-annotate

“Add TN logging to this file.”

Point it at an existing file full of print() or console.log() calls. The agent retrofits them to TN, preserves comments and behavior, and keeps your sensitive values out of the event name.

tn-verify

“Is this record tampered?”

The agent walks the chain, checks signatures, and reports back in plain English. Ask it to compare the same event across two parties and it tells you whether both sides agree.

tn-admin

“Give the auditor access to the amount field.”

Grants, rotations, and revocations happen through a short conversation with the agent. It tells you what changes, asks for confirmation on the sensitive ones, and writes the config.

tn-query

“Show me the last ten payment errors.”

The agent reads your tables with tn.read(…), decrypts the fields you are allowed to see, and answers with real records. Sorts by sequence and reaches for the real read verbs (tn.read for history, tn.watch for live tailing, with verify=, raw=, as_recipient= as flags) instead of inventing helpers.

tn-lint

“Run tn.lint on payments/.”

Static analysis on tn.* calls. Catches PII in event-type strings (R1), field names absent from your tn.yaml routing (R2), and forbidden-post-auth fields routed to a public group (R3). Non-zero exit on any rule fire — drop it in as a pre-commit hook.

tn-policy

“Draft an agents policy for order.created.”

Authors and maintains .tn/config/agents.md — the machine-readable policy that travels alongside every record so downstream LLM consumers see the rules next to the data. Five required subsections per event type; missing one raises at tn.init time.

Industries the agent already knows

Logs become receipts when they’re signed and sealed. Sealed by what? By the rules of the industry the receipt belongs to. PCI knows what counts as cardholder data. HIPAA knows what counts as a patient record. FERPA knows what counts as a student record. The agent ships knowing all of them, so when it walks a codebase it can tell which values need locking and which can stay legible. That is what DRM for logs looks like in practice.

Industry Standard What the standard is about
Identity and auth OIDC Core 1.0 + RFC 7519 The names a login system uses for who someone is, what they can do, and the tokens that prove it.
Payments PCI DSS v4.0 What banks call “the card data”. The number, the expiry, the CVV, the PIN. Some of it must vanish the moment a charge clears.
E-commerce orders Schema.org Order Customer name, address, line items, totals, fulfillment. The shape Shopify, Stripe, and direct-to-consumer storefronts already use.
Healthcare records HL7 FHIR R4 The clinical record. Who the patient is, what the doctor noted, what the lab measured, what was prescribed. PHI under HIPAA.
Customer relationships Salesforce object model Contacts, leads, opportunities, support cases. The data sales and customer-success teams keep about people and deals.
Cloud audit logs AWS CloudTrail The receipt every cloud account leaves behind. Who did what, from where, against which resource. The same shape covers GCP and Azure.
Email RFC 5322 and RFC 5321 The headers and body of an email message. From, To, Subject, the routing trail, and the body itself.
Trading FIX 4.4 / 5.0 SP2 The wire format banks and exchanges use to place orders and confirm fills. Symbols are public; account ids and the prices on a working order are not.
IoT and geolocation NMEA 0183 + OGC SensorThings 1.1 Device telemetry. A stable id, where the device is, how fast it is moving, what it is reading. Location plus a stable device id is a person.
K-12 education 1EdTech OneRoster 1.2 The student information system. Who is enrolled in which class, with which teacher, at which school. FERPA-protected.
Custody and portfolio ISO 20022 semt.002 The end-of-day statement of holdings. Which account owns how many of which security and what it is worth.

How the agent uses what it knows

Ask the agent to look at a file, a folder, or the whole repo. It reads the code, recognises the standards in play, and points to every spot where a value should be sealed instead of left in the open. The agent does not invent rules. It cites them. Every flag traces back to the section of the standard that named the field.

Fixes happen in the same conversation. Seal a field. Rotate a key. Grant the auditor read access to one column and nothing else. The receipts that result prove what happened. The people allowed can read them. Everyone else sees ciphertext. DRM for logs.

What it looks like in chat

Y
You: Add TN logging to checkout.py.
A
I read the file. I see print() calls around the charge, the refund, and the error path. I will replace them with tn.info("payment.charged", …), tn.info("payment.refunded", …), and tn.error("payment.failed", …). Field names follow your existing tn.yaml. Proceed?
Y
You: Yes. Also give the finance partner read access to the amount field.
A
I added partner-finance to the amount field’s reader list and rotated the group key. From the next entry on, they can decrypt amount for payment.charged. The customer and card fields stay sealed.

Data governance

Logging is the beginning. Two more surfaces make policy machine-readable and help you find sensitive data that’s already escaping unencrypted.

The policy layer

Every event type can carry a declared policy: what the data is for, what it must not be used for, and what a downstream agent should do if something goes wrong. These declarations live in .tn/config/agents.md and are spliced onto every emitted record at runtime, so LLM consumers see the rules alongside the ciphertext.

tn-annotate does this automatically. When it retrofits a file it also drafts the five required agents.md subsections for each new event type it introduces: instruction, use_for, do_not_use_for, consequences, on_violation_or_error. Missing a subsection raises at tn.init time, so the policy is never half-written. Use tn-policy to add or revise policy sections later without touching the logging code.

Know Your Exhaust Experimental

What about logs you didn’t write with TN? Know Your Exhaust (KYE) is a local MCP server that analyzes your application’s runtime exhaust — existing log files, telemetry, traces — finds unencrypted PII and join keys, and offers to instrument the source code so future writes route through TN.

The analysis runs seven deterministic stages: profile the format, enumerate event types and fields, collapse thousands of lines to canonical templates, match fields to the eleven published industry standards, classify per-field sensitivity, detect cross-row re-identification risk, then generate a default-private TN config. The agent walks you through each finding and asks before it touches any code.

When connected to your vault, the agent can also decrypt what you are entitled to see and apply the policy rules the data carries — all local, no key escrow.

Setup: start the server and register the connector using the Know Your Exhaust tab in the configuration guide above. Then ask: “classify my exhaust” or “what’s in my logs.”

Where it fits

If you already use an AI assistant for day-to-day coding, the TN plugin lets you add a new question to its repertoire: “what does this log say”, “who can read it”, “prove it has not changed”. Answers come back in the same chat window.

← Back to the vault