Skip to main content
Glama

TANE Protocol (tane-protocol)

TANE (種 / Seed) is a zero-dependency constitutional kernel, physical MCP execution gate, and event-driven immune layer for autonomous AI coding agents.

For a human, TANE is a small boundary around untrusted web pages, mail, CSV files, and pull-request diffs. For an agent, calls that pass through mcp/tane_mcp.py are scanned and held for approval before a gated write, so a contaminated source is less likely to become an unintended edit. llms.txt is a short map of the same facts for agents and crawlers.

It separates what must never change (human primacy, reversibility, and explicit approval gates) from what should continuously improve (acquired defensive rules and operational lessons), aligned with AAIF (AGENTS.md / SKILL.md / MCP / A2A) and OWASP Top 10 for Agentic Applications (ASI01–ASI10).

AGENTS.md is the single source of truth. CLAUDE.md and .github/copilot-instructions.md mirror its marker block. .cursor/rules/tane.mdc is an always-on Layer 1–2 projection; the antibody registry stays in AGENTS.md Section 3.3.

Requires Python 3.10 or newer.


Why TANE?

  • Locked Core (Layer 1): python scripts/tane.py verify checks one SHA-256 across AGENTS.md, .cursor/rules/tane.mdc, CLAUDE.md, and .github/copilot-instructions.md. A missing copy is a failure. Pull requests that change the Layer 1 block or EXPECTED_LAYER1_HASH fail CI.

  • Physical Gate (Layer 2): mcp/tane_mcp.py (Python standard library only) strips invisible Unicode, scans indirect prompt injection, counts WRITTEN records in .tane_audit.jsonl, and continues the hash chain across process restarts.

  • Human-Approved Lessons (Layer 3): .agents/skills/tane-guard/SKILL.md stays idle during routine work. New rules are appended to AGENTS.md Section 3.3 only after an explicit human yes, then python scripts/tane.py sync.

  • Portable Export (Layer 4): python scripts/tane.py export writes tane-antibodies.json and data/tane-antibodies.jsonl with no timestamp, so unchanged rules produce an empty diff.


Related MCP server: genpark-agent-prompt-injection-jailbreak-sentinel-skill

Quick Start

1. Use as a GitHub Template

git clone https://github.com/tane-sec/tane.git
cd tane
python scripts/tane.py verify

2. Verify, sync, and run the starter checks

python scripts/tane.py verify
python scripts/tane.py sync
python scripts/tane.py export
python -m unittest discover -s tests -v
python examples/safe_fetch_pipeline.py --sample

3. Enable the physical MCP gate

.cursor/mcp.json launches python mcp/tane_mcp.py over stdio. Reload MCP tools to expose:

  • tane_read_untrusted — strips invisible Unicode and flags injection text. The body stays observational data.

  • tane_safe_write — blocks protected paths. Overwrites and writes past the persistent cap require a human summary of at least 15 characters, or the value of TANE_APPROVAL_SECRET when that variable is set.

  • tane_safe_delete — does not delete. It stops and asks a human to act.

The server anchors its workspace by walking parent directories until it finds AGENTS.md or .git.

4. Install into an existing repository

python scripts/tane.py install --target /path/to/your-repo

This updates the AGENTS.md marker block, copies the CLI, MCP server, skill, integrity workflow, LICENSE, and DATA_LICENSE.md, merges a tane-mcp entry into an existing .cursor/mcp.json without removing other servers, runs sync, and writes tane-antibodies.json plus data/tane-antibodies.jsonl. The copied workflow runs the unit tests and the sample pipeline only when tests/ and examples/ exist. In the target repository:

python scripts/tane.py verify

5. Scan, consult, and snippet

python scripts/tane.py scan path/to/untrusted.csv
python scripts/tane.py scan https://example.com/feed.csv
python scripts/tane.py consult "overwrite config file using another tool"
python scripts/tane.py snippet

scan exits 1 when it finds invisible Unicode or an indirect prompt-injection pattern, and tells you to treat the text under AGENTS.md. A clean target exits 0. consult prints matching owasp_category and defensive_rule lines from data/tane-antibodies.jsonl (or from AGENTS.md when that file is absent). snippet prints the Layer 1–2 reference block for pasting into another project or agent session.

6. Badge

[![Protected by TANE Layer 1](https://img.shields.io/badge/Protected_by-TANE_Layer_1-2ea44f)](https://github.com/tane-sec/tane)

Official account: x.com/tane_sec

Vulnerability reports and funding rules are in SECURITY.md.

7. Protect main after publication

The integrity workflow compares Layer 1 with history only on pull requests. A direct push can change the Layer 1 text and EXPECTED_LAYER1_HASH together. After the repository is public:

  1. Open GitHub → Settings → Rules → Rulesets (or Branches → Add branch protection rule).

  2. Limit the rule to main.

  3. Block direct pushes. Require a pull request before merging.

  4. Require the status check for the verify-tane job to pass.

  5. Do not allow administrators to bypass the rule.


Repository Structure

.
├── AGENTS.md                              # Canonical 4-layer protocol
├── CLAUDE.md                              # Synced projection
├── DATA_LICENSE.md                        # CC BY-SA 4.0 for rules, skills, datasets
├── LICENSE                                # MIT for executable code
├── llms.txt                               # Low-token map for agents and crawlers
├── tane-antibodies.json                   # Deterministic CC BY-SA export
├── data/tane-antibodies.jsonl             # Deterministic JSONL export
├── .cursor/rules/tane.mdc                 # Always-on Layer 1–2 projection plus Cursor front matter
├── .cursor/mcp.json                       # stdio MCP launch config
├── .github/copilot-instructions.md        # Synced projection
├── .github/workflows/tane-integrity.yml   # verify, clean sync/export, PR hash guard, tests
├── .github/pull_request_template.md
├── .agents/skills/tane-guard/SKILL.md
├── mcp/tane_mcp.py
├── scripts/tane.py                        # verify, sync, export, stage, install, scan, consult, snippet
├── examples/safe_fetch_pipeline.py
└── tests/test_tane_redteam.py

Antibody dataset

The committed exports are tane-antibodies.json and data/tane-antibodies.jsonl (CC BY-SA 4.0). The same records are published for evaluation and benchmarks at https://huggingface.co/datasets/tane-sec/tane-antibodies. Loading them with the Hugging Face datasets package is optional and is not part of TANE's zero-dependency runtime:

from datasets import load_dataset
ds = load_dataset("tane-sec/tane-antibodies", split="train")

Licenses

  • MIT (LICENSE): code under scripts/, mcp/, examples/, tests/, and .github/ automation.

  • CC BY-SA 4.0 (DATA_LICENSE.md): AGENTS.md and its synced copies, the skill, and the antibody datasets (tane-antibodies.json, data/).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP servers and local AI agents to safely interact with host environments by blocking indirect prompt injections, directory traversal, and malicious shell commands.
      MIT
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Lets MCP-compatible assistants vet inbound prompts and untrusted text for instruction-override manipulation, separator escapes, and concealed encodings before processing them. Additional inline controls cover spending limits, repetitive-plan interruption, unsafe host-action denial, and output sanitization without third-party libraries.
      1
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables autonomous AI agents and MCP-compliant clients to detect and block adversarial prompt injections, jailbreak attempts, system prompt exfiltration, and tool hijacking via a zero-dependency, sub-millisecond heuristic firewall.
      1
      -