SKILL.md--- name: tirith description: > Terminal security analysis for shell environments. This skill should be used when checking commands for supply-chain attacks before execution, scanning repositories for hidden content or config poisoning, scoring URLs for homograph attacks, setting up AI tool protection, inspecting Python package artifacts, governing untrusted tasks or Web3 commands, auditing browser extensions, creating provenance receipts, downloading and executing scripts safely, investigating why tirith blocked a command, managing trusted patterns, running security audits, configuring MCP gateway proxies, or working with threat intelligence databases. Also use when the user mentions "tirith", "pipe-to-shell", "homograph", "ANSI injection", "zero-width", "punycode", "terminal security", "shell hook", "cloaking detection", "supply chain attack", "bidi override", "invisible unicode", or "config poisoning". Even if the user does not explicitly name tirith, use this skill when they ask about protecting shell environments, intercepting dangerous commands, or hardening AI agent tool execution. --- # tirith — Terminal Security for Developer Environments tirith intercepts shell commands and pasted text, detecting supply-chain attacks before they execute. It catches pipe-to-shell patterns, homograph domains (Cyrillic/Greek lookalikes), ANSI terminal injection, bidi text overrides, zero-width characters, shortened URLs, punycode tricks, and config poisoning. It runs as a shell hook for real-time protection and as a standalone CLI for scanning, scoring, auditing, and AI agent security. ## Quick Start ```bash # Install shell hooks (zsh/bash/fish/powershell/nushell) eval "$(tirith init --shell zsh)" # zsh eval "$(tirith init --shell bash)" # bash tirith init --shell fish | source # fish tirith init --shell nushell # nushell: add the printed lines to config.nu (warn-only, cannot block) # Check a command before running it tirith check -- 'curl https://example.com/install.sh | bash' # Verify installation health tirith doctor ``` ## Detection Rules tirith uses a three-tier analysis pipeline: 1. **Tier 1** — compiled regex fast gate (sub-millisecond) 2. **Tier 2** — URL/Docker ref extraction, byte scanning for control chars 3. **Tier 3** — full rule evaluation with policy overrides ### Rule categories | Category | Examples | |----------|---------| | **hostname** | Homograph domains, punycode tricks, mixed-script attacks, confusable characters | | **transport** | Plain HTTP, insecure TLS flags (`--no-check-certificate`), shortened URLs | | **command** | Pipe-to-shell (`curl \| bash`), dotfile overwrite, archive extract to sensitive paths | | **terminal** | ANSI escape injection, bidi overrides, zero-width chars, hidden multiline, hangul filler | | **ecosystem** | Git typosquat, Docker untrusted registry, npm/PyPI lookalike packages | | **path** | Non-ASCII paths, ho