Security
How toge keeps pages away from your files, your agent and your machine.
toge assumes the pages it shows can’t be trusted. Agent-made pages load scripts from the internet and paste in raw data, and either could be hostile. So a page gets no power over your files, your agent, or toge.
The page runs in a box
What you open (127.0.0.1:4747/p/<id>/) is toge’s own page: the bar, pins, threads, Send and
Share. The page you’re reviewing sits inside it, in a frame served from a separate port
(127.0.0.1:4749) at a secret address.
- Its scripts can’t call toge: they come from another origin, and toge turns those away.
- They can’t read toge’s page or its storage, and can’t find other pages’ files.
- A small toge script inside the page only reports where pins go and where you clicked. Commenting, sending, resolving and publishing only happen when you click in toge’s own page.
Only your CLI can act as you
Opening files, replying as the agent, taking comments and stopping toge all need the owner
key in ~/.toge/key, which only you can read. The CLI and the agent plugins send it; no web
page can get at it.
The main port
- Listens only on
127.0.0.1, and only answers tolocalhostand127.0.0.1(this blocks DNS rebinding). - Turns away requests from other sites and from other ports on your machine.
- Needs a special header on every change.
- Can’t be put in a frame by another site, so nobody can trick you into clicking Send or Publish.
What the agent reads
Each comment is quoted line by line in what the agent receives, so one comment can’t pretend to be another, or to be you. Comments from people you shared with are marked untrusted, and the agent is told to treat them as suggestions, not instructions.
Sharing
- Wifi links use their own port (
4748), which serves shared pages and nothing else: nothing there can reach your agent. It’s only open while a link is live. - The shared copy runs in a sandbox with no origin, so its scripts can’t act as the person viewing it.
- Links aren’t leaked to sites the page links to, guests’ cookies are signed, and each page has limits on how much it takes.
- Publishing only reads the page’s own folder: nothing above it, no symlinks out, no hidden files.
- Gists use your own
ghlogin. toge never holds a GitHub token. - The Cloudflare Worker runs in your own account, set up with your own wrangler login. toge talks to it with a secret only the two of them know, and holds no Cloudflare token. The Worker follows the same rules as wifi links, and toge checks every comment it gets from there again. The Worker can’t reach your agent.
Your data
Everything lives in ~/.toge, which only you can read: your pages and threads (state.json,
plus a backup of the last save), published copies, the owner key, your settings, the Worker’s
address and secret, and the log.
What it doesn’t protect against
- Wifi links use plain HTTP on your network. Only share on networks you trust.
- An agent that can read
~/.togecould find the Worker’s secret, so “only you publish” is a guard rail there, not a wall. - Anything on your machine that can read
~/.toge/keycan act as you. On a shared machine, other users can still reach the main port from a browser.