Skip to main content

TAR Engine — audit AI skill safety from Claude Code, Cursor, Codex CLI

Audit AI skill safety without leaving your editor or your CI pipeline. TAR Engine exposes its skill audit pipeline two ways: a tar-engine CLI for CI, and an MCP server so any MCP-compatible agent — Claude Code, Cursor, Codex CLI — can call the audit pipeline directly from a conversation.

Five skill formats supported out of the box: SKILL.md, .claude/commands/*.md, Codex skill.yaml, manifest.json, OpenCode opencode.json.

What you get

Two surfaces ship in the same tar-engine package:

  • tar-engine — a one-shot CLI that walks a directory, audits every skill it finds, and exits with a CI-friendly status code. Drop it into GitHub Actions or a pre-commit hook to fail builds with risky skills.
  • tar-engine-mcp — the MCP server below (bundled), for interactive use from Claude Code / Cursor / Claude Desktop.

Both talk to the same backend (default https://tarai.dev, override with TAR_ENGINE_URL).

CLI quick start

# scan a directory of skills, fail the build if any score is below 70
tar-engine scan ./skills --min-score 70

# list discovered skills without running the audit
tar-engine list ./skills

# JSON output for downstream processing
tar-engine scan ./skills --json

Discovery covers five formats out of the box:

File pattern Format
**/SKILL.md OpenClaw, Claude Code, generic md
**/.claude/commands/*.md Claude Code custom commands
**/skill.yaml / .yml Codex
**/manifest.json Codex / Claude Code (key-detected)
**/opencode.json OpenCode

Each skill's audit payload includes its primary file plus sibling .sh / .py / .js / .ts / .yaml / .json helper files in the same directory tree (capped at 200 KB total). This catches the "SKILL.md looks clean but install.sh does the dirty work" pattern.

CI integration

GitHub Actions — fail the build if any skill scores below 70:

- name: Audit AI skills
  run: |
    pipx install tar-engine
    tar-engine scan ./skills --min-score 70 --format sarif -o results.sarif

- name: Upload SARIF to GitHub Security
  uses: github/codeql-action/upload-sarif@v2
  with:
    sarif_file: results.sarif

Pre-commit hook (.git/hooks/pre-commit):

#!/usr/bin/env bash
tar-engine scan ./skills --min-score 80 --strict || exit 1

The exit code is 0 on success, 1 when any skill is below the --min-score threshold or --strict finds any warning+ severity finding, and 2 for usage errors / missing path.

Optional defense in depth — if shellcheck / semgrep / trufflehog / gitleaks are installed locally, tar-engine scan orchestrates them alongside the backend audit pipeline and surfaces their findings under the same schema. Run tar-engine check-tools to see which are available and how to install the rest.


MCP tools (the LLM invokes these on its own when the user describes audit intent):

  • audit_skill_text(skill_text, lang?, domain?) — audit a SKILL.md you have in hand. Returns structured findings with rule_id, severity, line-level evidence, category, and remediation hints.
  • audit_skill_url(url, lang?, domain?) — fetch a SKILL.md from a URL and audit it.
  • list_audit_rules(category?, lang?) — list the rule registry the pipeline applies (PI-, SS-, FA-, DE-, CE-, MP-, SEM-, AR- prefixes).
  • get_audit_baseline(skill_name, limit?) — historical audit records and trend for a named skill.
  • map_skill_risks(skill_text? | url?, domain?) — audit a SKILL.md and place each finding on the step it sits in. Returns the steps with line ranges, the findings on each, irreversible actions with no confirmation step before them, a mermaid graph, and the same data as JSON (tar.risk_graph/1). Built for "fix this skill step by step". The graph is computed on your machine from the audit findings; step labels come from local rules unless you set TAR_ENGINE_BYOK_OPENAI_KEY, in which case they come from your own model endpoint, called directly. Limits: for skills that number their steps, edges follow document order (branches are not recovered); topical skills are returned as sections with no order implied. Behavioural AR-* findings are listed at skill level, not on a step.

Prompts (slash commands users can trigger explicitly):

  • audit-skill — audit a SKILL.md (paste text or URL)
  • audit-best-practices — the three defensive constraints every SKILL.md should include before publishing
  • audit-trend — show how a skill's audit score has changed over time

Configure your client

Claude Code

Add to ~/.config/claude-code/mcp.json:

{
  "mcpServers": {
    "tar-engine": {
      "command": "docker",
      "args": [
        "exec", "-i",
        "tar-engine-oss",
        "python", "/app/mcp-server/tar_engine_mcp.py"
      ]
    }
  }
}

Restart Claude Code. Available commands:

  • Type / to see audit-skill, audit-best-practices, audit-trend
  • Or just say "audit my SKILL.md" and Claude will call the right tool

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "tar-engine": {
      "command": "docker",
      "args": [
        "exec", "-i",
        "tar-engine-oss",
        "python", "/app/mcp-server/tar_engine_mcp.py"
      ]
    }
  }
}

Cursor

Settings → MCP → Add Server → use the same docker exec command.

Run directly (without docker)

If you run the engine locally without docker:

TAR_ENGINE_URL=http://localhost:8765 \
  python -m pip install mcp httpx
TAR_ENGINE_URL=http://localhost:8765 \
  python mcp-server/tar_engine_mcp.py

Then in your client config, point command at this script directly.

Environment

The MCP server reads:

  • TAR_ENGINE_URL (default https://tarai.dev) — base URL of the engine. The default sends the SKILL.md you audit to the hosted engine. Set it to your own engine (for example http://localhost:8765) to keep everything local.
  • TAR_ENGINE_TIMEOUT (default 180) — per-request timeout in seconds. Full-stack audit (L1 + L3 + L4) routinely takes 30-60s; default leaves headroom.
  • TAR_ENGINE_BYOK_OPENAI_KEY / TAR_ENGINE_BYOK_OPENAI_BASE_URL / TAR_ENGINE_BYOK_OPENAI_MODEL — your own model key, forwarded to the engine for the semantic (L3) and adversarial-fuzz (L4) layers, and used directly for step labels in map_skill_risks. Without it the audit runs L1 (regex) only. A plain OPENAI_API_KEY in your environment is deliberately not read: this server only uses a key you set for it by name.

MCP SDK versions: works with the MCP Python SDK 1.x and 2.x (mcp>=1.0,<3).

Example user flows

Audit a skill you're writing. Open Claude Code in a project that has a SKILL.md. Ask "audit this skill for security issues." Claude reads the file, calls audit_skill_text, and walks you through findings with line numbers and fix suggestions.

Check a community skill before installing. "Audit github.com/someone/cool-skill SKILL.md." Claude calls audit_skill_url with the raw URL, returns findings, you decide whether to install.

See your audit trend. After running audits on the same SKILL.md multiple times, "show me the trend for my-skill." Claude calls get_audit_baseline and reports mean/stddev/trend plus rule_ids that keep recurring.

Learn the defensive pattern. Type /audit-best-practices. Get the three-line SKILL.md prefix that closes the W23 edition's worst attack class (encoded-instruction injection that succeeded against 5 of 5 Anthropic-official skills).

Historical baseline persistence

Every audit triggered through the MCP server lands in the same cockpit_audit_history table the web endpoint writes to. The baseline you see via get_audit_baseline accumulates across all paths — MCP, CLI, web, direct HTTP. Same skill, same identity, one trend.

Set no_history: true in the audit body when you want a one-off audit that doesn't pollute the baseline (e.g. auditing a third-party skill you don't own).

Metadata

Release files for tar-engine 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tar-engine 0.4.0
File Size Uploaded Provenance Actions
tar_engine-0.4.0.tar.gz 48.8 kB Without provenance Details for tar_engine-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tar-engine 0.4.0
File Interpreter ABI Platform Actions
tar_engine-0.4.0-py3-none-any.whl Python 3 none any Details for tar_engine-0.4.0-py3-none-any.whl

Total release size: 93.7 kB

Release files / tar_engine-0.4.0.tar.gz

Download URL tar_engine-0.4.0.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b10a6b097793f7c063b1dfb774484b4ede53591fc12d19dd59fa0a14859c90a7
BLAKE2b-256 checksum
How to use checksums
2a23fa410dd4f9c430785f9d8d90c742cdaf59285ec2d47b3076b167e86114b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Release files / tar_engine-0.4.0-py3-none-any.whl

Download URL tar_engine-0.4.0-py3-none-any.whl
Size 45.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbd7362fded874fbefa8e5f9d56d9abda1047b678c482a52e7bf96513b324208
BLAKE2b-256 checksum
How to use checksums
35b59ea184c4cd66389f26a829fb5ae3b17362602c78da77d1a5460dd8fd1636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.6

Security for tar-engine 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page