egin

Write an agent as a folder of files and run it with one binary.

Docs
$ npx egin@latest init my-agent

Start from a template with --template research, ops or support.

How it works

An agent is a folder. Commit it, and review a change to its instructions like any other diff.

my-agent/
  agent.toml          model and settings
  instructions.md     system prompt
  tools/              scripts the agent can call
  skills/             instructions loaded when needed
  evals/              prompts and checks
  workspace/          files the agent works on

A tool is one script. Its opening comments say what it does and what it takes, the arguments arrive on stdin, and whatever it prints is the result. Any language works.

tools/http_check.py
#!/usr/bin/env python3
# description: GET a URL and report the status code and latency.
# safe: true
# param url (string, required): The URL to check
import json, sys, time, urllib.request

url = json.load(sys.stdin)["url"]
start = time.time()
status = urllib.request.urlopen(url, timeout=3).status
ms = int((time.time() - start) * 1000)
print(json.dumps({"status": status, "ms": ms}))

Tools run in a microVM made for each session. It reaches only the hosts you list, and it never sees your secrets: the real token is swapped in on requests to its host.

agent.toml
network = ["example.com"]
secrets = [{ name = "GITHUB_TOKEN", host = "api.github.com" }]

Each step is saved before the next one starts. Kill the process and run the session again: it carries on from the last saved step, without repeating a model call.

  1. read_filerunbooks/http-health.md3 ms
  2. http_checkhttps://example.com182 ms
  3. Process killed
  4. egin run my-agent --session 01JD7…
  5. http_checkhttps://example.com/api3.0s
  6. write_fileincidents/2026-11-16.md5 ms
  7. DEGRADED: /api timed out twice. Incident note written.

An eval is a prompt and a check. egin eval runs each one under every variant of your settings, so you know what a change is worth before you keep it.

evals/health-check.toml
prompt = "Run the health check runbook. Reply with the status."
expect = "OK"
evals/variants.toml
[default]

[bash-only]
tool_style = "bash"

Commands

Serving

egin serve my-agent starts an HTTP API on port 8787. Start a session with a POST, then follow its events as they stream.

terminal
curl localhost:8787/sessions -d '{"message": "Check the targets"}'
curl -N localhost:8787/sessions/{id}/events

To reach the agent from other services, add a channel. A webhook takes HMAC-signed POSTs, one session per thread.

channels/webhook.toml
secret = "${OPS_WEBHOOK_SECRET}"

Slack works over Socket Mode, so the server needs no public URL.

channels/slack.toml
app_token = "${SLACK_APP_TOKEN}"
bot_token = "${SLACK_BOT_TOKEN}"

To run a prompt on a timer, add a schedule.

schedules/health.toml
cron = "*/15 * * * *"
prompt = "Run the HTTP health check runbook."

To put the agent in a web app, use the React hook. Start from --template web for a full chat with attachments and approvals.

Chat.tsx
import { useAgent } from "egin/react";

const agent = useAgent({ baseUrl: "/egin" });
agent.send("Summarise this", files);
agent.approve(callId, true);

Benchmarks

egin against eve on the same model with the same web tools, over all 165 GAIA validation tasks. egin passes more on every model, at 31 to 58% less cost.

ModelegineveCost, egin / eve
Claude Sonnet 5.5136130$16.46 / $23.76
Qwen4 Max136119$19.10 / $27.77
GPT-6.1 Sol129124$12.58 / $22.35
Claude Haiku 5.5114108$1.19 / $1.74
GPT-6 Luna10398$0.80 / $1.89

Passes out of 165, dropping any pass whose search results quoted the question and its answer in agent or benchmark write-ups. On SimpleQA Verified’s 1,000 questions the two tie. Every run, including Terminal-Bench and SWE-bench, is in Results.