Tegoby Attention SpanBlogBook a demo

Security and limits

Updated

Read this before you rely on Tego: what it holds an agent to, what it cannot stop, what it trusts and what it sends.

On this page

What Tego protects against

An AI agent that runs as you and makes a mistake, or one that a prompt injection has turned. Tego holds that agent to its contract (agent.yaml, the file of rules it runs under) for three things: the files it may read and write, the network hosts it may reach and the programs it may start.

The rules live outside the agent. The Linux kernel and Tego's supervisor, a separate process outside the agent, enforce them below the agent's code, so the agent cannot talk its way past them. A refused action fails as an ordinary error, such as "permission denied", and goes into the run's record.

Tego never calls a model and never rewrites what the agent does. It refuses, explains and records.

What Tego does not protect against

Data leaving through a host you allow

  • Every allowed host is an open channel. Rules match a host and port, not what a connection carries. An allowed model endpoint and an allowed github.com are equally open to anything the agent can read. Tego is not data-loss prevention. Both public leaks of this kind (Invariant Labs' GitHub MCP flow and the nx s1ngularity compromise, 2025) left through github.com. Allow as few hosts as the task needs, and keep secrets unreadable, since what the agent cannot read it cannot send.
  • Effects inside services are invisible. What the agent does inside a SaaS or a managed database shows only in that service's logs. A real case: The MCP server that blind-copied every email.

What an allowed program does

  • An allowed interpreter can do anything in its own memory. Allowing python3 decides that Python may start, not what it does. Allow only the interpreters the task needs.
  • Tego limits only what the rules name. With no network section every host is reachable, and with no program section every program runs. Give every contract all three sections; tego compile shows what each allows.
  • At Basic, some checks are best effort. Tego's supervisor decides command rules, deny_write targets and UDP destinations on its own copy of the call's arguments. A racing thread in a hostile agent can change what the kernel then acts on. TCP connections are made by the supervisor itself, so they are not open to that race. At Plus and Max the kernel decides hosts itself. Protection levels explains the levels.

What the agent can see

  • Tego is not a sandbox that hides the machine. The agent can read any path you have not denied. A built-in list keeps SSH keys, cloud credentials, token stores and .env files out of reach; add your own secret paths to deny_read.
  • Denied folders hide contents, not names. At Basic and Plus, the agent can still list the file names inside a denied folder. Keep a secret whose name matters outside every readable folder.
  • Some secrets slip past the list. A secret in a file the list does not name, or a token exported from your shell's startup files, is not covered.
  • A denied file inside a folder the agent may write. At Basic, Tego holds each read of it and refuses it, including through a renamed or hard-linked copy (held reads, the default fs.reads: auto). Set fs.reads: direct and it is not enforced. A project on a network or shared filesystem (NFS, CIFS, FUSE, sshfs, or a Mac folder shared into the VM) cannot use held reads, so the run refuses to start. In some cases, a secret file that appears after tego compile checked the contract can be renamed or linked to an unprotected name and read there (known limits, item A11). Keep secrets outside the folders the agent writes.
  • A run can read the network setup: interface names and addresses, routes, and nearby machines it has talked to.
  • host_sockets: true opens local daemon sockets, which can include your desktop session's. Leave it out of a contract that must not reach your session.

The record

  • It is tamper-evident against the agent, not against you. Each line carries the hash of the line before it, so a held agent cannot quietly edit it. The person who started the run can. Keep a record that must survive off the machine.
  • A watch-only run gives no protection to its own record. tego watch with no --boundary, or tego run --observe, enforces nothing, so the agent can rewrite its record. Use tego watch --boundary agent.yaml for any agent whose record must hold.
  • Basic does not record reads by default. A refused read still fails but leaves no line, so a clean receipt says nothing about reads. Set record: full, or run at Plus or Max.
  • A crash can lose the last lines. Lines reach the disk when the run closes, so a kernel crash or power cut can lose up to about 35 seconds of them. Tego marks such a run, and its counts are then a minimum.
  • The record is not rotated during a run. For a long-lived agent, set record.max_run_bytes.
  • Any process running as you can read the record.

Running it

  • Linux only. On macOS and Windows, run Tego and the agent inside a Linux VM. On a Mac, keep the project inside Tego's VM; a folder shared from the Mac can't be used.
  • One machine at a time. Tego has no view across machines.
  • Nothing can mount inside a run. Rootless podman, bubblewrap, unshare -m and sandboxes an agent starts itself fail, so Claude Code's and Codex's own sandboxes run off under Tego. sudo and other setuid programs do not work inside a run either.
  • The tests use stand-in agents, not live Claude Code or Codex. A new agent release can break a working contract. Try it under tego watch first.
  • A person can still loosen model routes on a Locked run. File, program and network rules never loosen while a Locked run lives.
  • A paused run whose launcher dies stays frozen. Treat it as lost and tego stop it.

MCP tool rules (preview)

MCP tool rules hold an agent that uses its MCP client. They are not a wall against an agent that attacks Tego's relay, the go-between that checks each tool call.

  • Names only. A rule decides by tool name, never by the call's arguments. You cannot allow read_file only under src/.
  • An agent that can attach to its own processes can go around the relay. If the machine's Yama ptrace_scope setting is 0 or 1, the agent can attach to the relay process it started (ptrace, or taking its socket with pidfd_getfd) and talk to the server directly, unchecked and unrecorded. Set ptrace_scope to 2 or higher where the relay must hold.
  • A forking agent can start a local server around the relay. For a server Tego starts on your machine, an agent that forks at the right moment can take the server's start for itself, with no ptrace. A denied tool then runs, and nothing is recorded. A tool that must not run has to stay out of what the run can start: leave it out of the server, or serve it from a URL your network rules do not allow.
  • Locked does not lock tool switches. On a Locked run, a person outside the run can still loosen a tool with tego mcp allow or the dashboard, after a confirmation. The agent cannot do it itself, and each change is recorded.

The full list, with the reasoning behind each item, is in the repository's GAPS.md.

What Tego trusts and what runs as root

Tego's trusted code is the launcher, the supervisor, the kernel programs and their loader, and the parsers that read the agent's traffic. The supervisor reads another process's memory, so a bug there could let a local user gain root. The code has fuzz tests, but no one outside the project has reviewed it yet.

Only what you start with sudo runs as root. The installer sets up no root service, and there is no root daemon.

What you run As root?
The installer, tego run at Basic, tego watch No
sudo tego run, for Plus and Max Yes, the launcher, for the whole run. The agent runs as you.
The kernel-program cleanup after a root run Yes, until the programs have been idle 5 minutes
sudo tego agents and sudo tego adopt Yes, while they run
The dashboard (tego serve) Never. It refuses to start as root.

Granting sudo for tego is granting root. A sudoers rule limited to tego is not a boundary Tego supports, and a setuid copy of tego refuses to start. If the supervisor dies, the agent's main process is killed and the kernel's limits stay on its children.

The dashboard listens only on the machine's loopback address and answers only the user who started it, in a Mac or Windows VM too. Other local users get refused, and so does any change sent from inside a run.

What Tego keeps and sends

  • Sent: nothing of yours. No telemetry, no update check, no crash reports, no usage metrics. Tego's own traffic is DNS lookups of the hosts your rules name and the connections it makes for the agent, such as the model forwarder's.
  • Kept: each run's record, in ~/.tego/runs/<run>/, a folder only you can open. By default it holds no request or response bodies. Under record: full it stores the model's requests and responses, which can include code and anything the agent read. Credential headers are never stored.
  • Removed: runs older than 30 days, when tego gc runs.

License and releases

Tego is open source under Apache-2.0. The kernel programs under bpf/ are dual licensed GPL-2.0-only or BSD-2-Clause, and tego licenses prints every license.

Each release is built by the repository's own workflow, rebuilt on a second machine to check the binaries match, and its checksums file is signed with cosign. The installer checks that signature when cosign or a signed-in gh is on your PATH.

Piping the installer into sh runs it before anything can check it. To check first, download and verify, then run:

Shell
tag=v0.1.3
sums=tego_${tag#v}_checksums.txt
base=https://github.com/Attention-Span-AI/Tego/releases/download/$tag
curl -fsSL -O "$base/install.sh" -O "$base/$sums" -O "$base/$sums.sigstore.json"
cosign verify-blob --bundle "$sums.sigstore.json" \
  --certificate-identity "https://github.com/Attention-Span-AI/Tego/.github/workflows/release.yml@refs/tags/$tag" \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com "$sums"
grep '  install\.sh$' "$sums" | sha256sum -c -
TEGO_VERSION=$tag sh install.sh

If cosign fails, or sha256sum does not print install.sh: OK, do not run the script. A signature says who built a file, not that the code is good. Every release and its files are on GitHub releases.

Report a vulnerability

Report it privately with Report a vulnerability on the Tego repository. Do not open a public issue, pull request or discussion.

Say what you did, what you expected and what happened. Include the output of tego version and tego doctor, your kernel and distribution, and a contract that reproduces it with any secrets removed.

No response time is promised; the project answers reports it can reproduce and credits you if you want. The latest release and main are supported. The limits on this page are not vulnerabilities by themselves; a report that shows one is worse than stated, or can be exploited from outside it, is in scope. Conduct reports use the same form.

Source: SECURITY.md and GAPS.md in the repository.