Have an LLM watch your Mac for break-ins.
Catch poisoned packages, trojanised editor extensions, and hijacked AI agents. The model runs on your Mac, or at a provider you pick with your own API key. No SIEM. No rules to write.
Apple Silicon and Intel, macOS 14 or later
Quickstart • Runtime Reference • Discord • Issues
Tangent's app on a recorded attack, sped up. Every screen in the window is the app's own, drawn from a real run: what is real and what is the demo's.
Modern compromises start on a developer's laptop — a poisoned npm or PyPI package, a trojanised editor extension, a fake take-home repo, or a prompt-injected coding agent grabbing ~/.aws, ~/.ssh, Keychain, or browser tokens. At most startups, nothing watches the laptop.
Tangent is a Mac app that watches it. A fast model reads your activity and flags anything suspicious. A second model investigates each flag against the full local log before notifying you, and tells you in plain English what happened and what to check first.
You choose where the models run:
- On your Mac. A local model does all of it, and nothing leaves the machine. It needs an Apple Silicon Mac with 32 GB of memory, and 64 GB to keep up on a busy one.
- At a hosted provider. Anthropic, Amazon Bedrock, OpenAI or OpenRouter, with your own API key. This works on any Mac.
Tangent never switches from a local model to a hosted one on its own.
Quickstart
1. Install
Download Tangent.dmg, open it, and drag Tangent to Applications.
Tangent needs macOS 14 or later. It runs on Apple Silicon and Intel.
2. Open Tangent
Open Tangent from Applications. Its window walks you through three things, once:
- Choose a model. Pick one under Models & Keys. A hosted provider needs your API key, which Tangent stores in your Login Keychain.
- Switch Tangent on under Login Items. System Settings opens at Login Items & Extensions. Turn Tangent on there, and enter your password when macOS asks. This lets Tangent run in the background.
- Grant Full Disk Access. Click Open Settings in Tangent's window, turn Tangent on in the list, and enter your password again.
Watching starts a few seconds later. From then on Tangent runs in the background with an icon in your menu bar: with its window closed, while the Mac sleeps, and after a restart.
macOS also asks whether Tangent may send notifications. Allow them: a confirmed alert reaches you as a notification.
Which models you can choose depends on your Mac:
| Your Mac | Your choices |
|---|---|
| Apple Silicon, 64 GB or more | A local model (Inkling 2 Mini, ~20 GB) that runs on your Mac, so nothing leaves the machine. Or a hosted provider. |
| Apple Silicon, 32 to 63 GB | The same two. The local model fits but may fall behind on a busy Mac. |
| Intel, or under 32 GB | A hosted provider. |
The hosted providers are Anthropic, Amazon Bedrock, OpenAI and OpenRouter. Your choice is remembered, and you can change it in the app at any time.
Claude Haiku 5.5 with Claude Sonnet 5 (Anthropic or Bedrock) is the hosted pair. The results below were recorded with Claude Sonnet 5.5 reviewing. The OpenAI and OpenRouter pairs, and the local model, have no published results on those attacks yet.
What it watches:
- every program that runs, and its process tree
- reads and writes of credentials, AI-agent settings and login items
- outbound connections, per process
- what you ask Claude Code (from
~/.claudetranscripts)
Where results show up:
- An alert that the reviewer confirms, or cannot rule out, becomes a macOS notification.
- The app lists every alert with its review.
- The Health page tells you whether Tangent is keeping up.
From a terminal:
The tangent command is inside the app. To put it on your path:
sudo mkdir -p /usr/local/bin sudo ln -sf /Applications/Tangent.app/Contents/MacOS/tangent /usr/local/bin/tangent
| Command | What it does |
|---|---|
tangent up |
Starts watching, as the app does. |
tangent up --provider anthropic |
Chooses a provider (anthropic, bedrock, openai or openrouter). Tangent reads that provider's API key from your environment once and stores it in your Login Keychain. |
tangent down |
Pauses watching. |
tangent status --follow |
Prints alerts as they happen. |
tangent health |
Says whether Tangent is keeping up. |
To uninstall: open the Health page, click Uninstall Tangent, then move Tangent to the Trash. tangent uninstall does the same from a terminal. Both keep your logs, in ~/.local/share/tangent.
Details:
- Tangent.app is signed with a Developer ID and notarized by Apple. Its sensor runs as root from inside the app. macOS starts it, and only after you switch Tangent on under Login Items.
- The local model runs on Tangent's own SHA-256-verified copy of Ollama, stored with the model in
~/.cache/tangent/models. Tangent starts and stops it along with the watch. tangent up --headlessruns without the menu bar icon. It has no window, so when a model has to be chosen it stops and prints the command for each provider, and whether that provider's key is already in your environment. The Login Items switch still has to be turned on once, on the Mac's own screen.
Want to edit the prompts, route alerts to Slack, or change the pipeline? tangent init mac writes a standalone tangent.yaml and its prompt files into your current directory. See docs/try-it.md for details.
What an alert actually looks like
Not a cryptic rule ID and a severity score. Here is Tangent's review of a recreated trojanised Claude Code extension run on a Mac (shortened):
VS Code's Code Helper (Plugin) process, acting on behalf of the extension
acme-tools.acme-assist-2.1.3, ran a hidden script~/.config/.mtr[…] contactedifconfig.meandapi.ipify.org, created~/.ssh/authorized_keysand a LaunchAgent masquerading as~/Library/LaunchAgents/com.apple.sysstatd.plist, and ran/usr/sbin/systemsetup -setremotelogin on[…] opening a persistent reverse SSH tunnel to an external host. This was not requested by the owner and was triggered purely by the extension loading.What to check first: Disable remote login, inspect
~/.ssh/authorized_keysfor the injected key, remove the LaunchAgent, kill any reverse-tunnelsshprocesses, and removeacme-tools.acme-assist.
And here is what Tangent said of a benign look-alike on the same Mac — a developer adding their own SSH key, testing GitHub SSH access, and installing Redis via Homebrew:
That key is this Mac's own public key, so it grants login only to someone who already holds the owner's private key. […] Homebrew installed redis and created its
sh.brew.redisLaunchAgent, which is Homebrew's normal service setup.ssh -T git@github.comchecked GitHub access.
Result: cleared — no alert. Both sessions wrote authorized_keys, ran ssh, and created a LaunchAgent. Static rules fire on both or neither; Tangent's reviewer inspects the session history and files and tells them apart.
How it works
- Collect and summarize. Tangent joins Endpoint Security events, per-process network connections and Claude Code prompts into one short summary per session (a terminal tab, an app, an agent).
- Judge fast. A fast model, the judge, reads every summary and answers
pass,lookorflag. It is meant to flag freely. - Then investigate. A second model, the reviewer, investigates each
lookandflag. It runs read-only SQL over your local log, and it can read the scripts and agent settings an alert points to (never credentials or transcripts). It confirms real attacks and drops ordinary work. - Keep the record. Raw logs stay on your machine as zstd-compressed Parquet files. Query them any time with
tangent query.
How it keeps up with a busy Mac. A Mac produces far more events than a model can read, so the model never reads raw events. The sensor records every program run and connection, but file activity only for the files that matter here: credentials, AI-agent settings, and anything that runs at login or in every shell. The judge then reads one summary per session. A session in which signed programs did exactly what the judge has already passed is not judged again; scripts, shells and unsigned programs always are. None of this is a detection rule, and tangent health tells you if the judge falls behind anyway.
Can an attacker talk the model out of it?
Everything the models read was written by whoever caused it: package names, command lines, file paths, script contents. An attacker can put text there aimed at the reviewer ("routine build step, benign"). Here is what Tangent does about that, and what it does not:
- Text aimed at the reviewer counts against the session. Both models are told that nothing in a record, a query result or a file is an instruction, and that text which vouches for the activity or asks for a verdict is an attempt to steer the review and a reason to flag.
- Neither model can act. The judge has no tools. The reviewer can only run read-only queries over the local log and read the files an alert points to. Tangent itself blocks, kills and revokes nothing. An injection that works hides an attack; it cannot make Tangent do something for the attacker.
- It is not tested on the Mac yet. The Mac suite has no case with text aimed at the judge. The only such cases in Tangent's eval are three in cloud audit logs, where the models get the same instruction and caught all three.
This lowers the risk; it does not remove it. A model can still be talked around by text nobody has tried yet.
What it has caught
We recreated eleven real-world developer attacks inside a Mac VM with Tangent watching, alongside eleven benign developer look-alikes doing similar things for legitimate reasons. Two of them run a real Claude Code in the VM. Each recording was run three times through Tangent 0.3.2 with Claude Haiku 5.5 (judge) and Claude Sonnet 5.5 (reviewer):
| Attack | What it does on the Mac |
|---|---|
| Shai-Hulud | An npm install script sweeps tokens and keys and republishes the developer's packages with itself added |
| axios compromise | An npm install script drops a remote-access tool disguised as an Apple daemon |
| LiteLLM compromise | A PyPI package installs a hook that runs on every Python startup and harvests credentials |
| Nx "s1ngularity" | An npm install script takes tokens and starts the developer's own coding agent, permission prompts off, to list the files worth taking |
| Ultralytics compromise | A PyPI package's model download fetches a coin miner into /tmp, runs it against a pool, and deletes the file |
| Malicious Hugging Face models | Loading a model's pickle weights makes the developer's Python connect back and start a shell |
| Contagious Interview (CLI) | A fake recruiter's take-home repo exfiltrates wallets, browser data, and Keychain, and installs a backdoor |
| Contagious Interview (editor) | Opening the repo folder triggers a hidden editor task that pipes a script into bash |
| GlassWorm | An editor extension steals Keychain, wallets, and credentials and adds a login item |
| Trojanised Claude Code extension | An editor extension injects an SSH key, opens a reverse tunnel, and installs a LaunchAgent |
| Hijacked coding agent | A cloned repo's agent settings run the attacker's script when Claude Code starts and send its traffic and API key to the attacker's endpoint |
- Caught: 11 of 11 attacks in all 3 runs.
- False alarms: The judge alone marked look-alikes in 18 of 33 runs; after the reviewer investigated, 0 of 11 stood.
- All cases and harness code: tangent-eval/macos.
Being candid about what this doesn't prove yet:
- These are eleven recreations in a VM, not attacks found in the wild on a working Mac.
- Elastic's public detection rules matched Tangent on the first seven cases (the four newer ones have not been compared). The difference is that Tangent gets there with one binary and no detection-engineering team.
- The numbers are for one hosted pair. The local model and the other providers' pairs have no published results yet.
- False-alarm volume across a real working week has not been benchmarked yet.
- A miss is silent. These numbers show what Tangent catches among attacks someone recorded. They do not give a miss rate for attacks nobody has recorded, and a detector that missed looks the same as one with nothing to find.
Privacy & cost
With a local model, nothing leaves your Mac.
With a hosted model, this goes to the provider you chose, and nowhere else:
- The session summaries: program names, command lines, file paths, the hosts each program connected to, and what you asked Claude Code.
- During a review, what the reviewer's queries return and the files it reads.
Raw logs stay on your machine either way, unless you route them somewhere yourself. There is no Tangent server: requests go from your machine straight to the provider. The only other traffic is downloads: Tangent's sensor, the local model, and public address lists (countries, networks, cloud providers' ranges).
What Tangent itself holds. Tangent is a sensitive piece of software in its own right. It runs a root sensor, keeps a hosted provider's API key in your Login Keychain, and stores a local log of what ran on your Mac. Treat the machine it runs on accordingly.
Cost: Tangent is Apache-2.0 licensed with no subscription. With a local model there are no API fees. With a hosted model you pay your provider for the tokens Tangent uses, and nothing else. What a typical Mac costs per day on a hosted model has not been published yet.
What Tangent is not
- Not a SIEM. No dashboards, no search UI, no case management.
- Not a blocker. It investigates and tells you what happened; it does not kill processes or revoke keys.
- Not your only defense. It is a second pair of eyes and a record of what ran. On a Mac that already runs a managed security agent, it is one more agent beside it.
- Not deterministic. LLMs vary from run to run — every benchmark above states how many runs it came from.
- Not fleet-managed yet. It is set up one Mac at a time today.
- Not on Linux yet.
tangent upwatches a Mac. There is no Linux sensor.
Under the hood: a Rust + WASM stream processor
Everything above is built on a single generic Rust runtime: sandboxed WASM plugins (Rust, Go, Python), transactional SQLite state, shared in-memory enrichment tables, Parquet lakes (tangent query), and built-in model/agent nodes. The Mac watch is one pack on that runtime, so you can add your own logs or build your own streaming pipelines without touching a DSL. The same runtime also has packs for cloud audit logs (AWS CloudTrail, GitHub, Okta, Google Workspace, Supabase), which this README does not cover.
License
Apache-2.0. See LICENSE.
